spaces in filenames trouble

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

spaces in filenames trouble

Eduard Drenth

Dear all,


Search google, the archives, tested, but no solution yet....(Although building Java app using saxon api solves this)


In this snippet:


find $dir -name '*xml' | while read file
do
java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
done

No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting: "Unrecognized option: 2.xml"


filename is for example "prefix 2.xml"


Any suggestions anyone?


Eduard Drenth, Software Architekt


[hidden email]


Doelestrjitte 8

8911 DX  Ljouwert

+31 58 213 14 14

chat: [hidden email]


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Michael Kay
I'm afraid this is beyond my level of expertise in shell programming.

Michael Kay
Saxonica

On 17 Nov 2016, at 16:46, Eduard Drenth <[hidden email]> wrote:

Dear all,


Search google, the archives, tested, but no solution yet....(Although building Java app using saxon api solves this)


In this snippet:



find $dir -name '*xml' | while read file
do
java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
done

No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting: "Unrecognized option: 2.xml"


filename is for example "prefix 2.xml"


Any suggestions anyone?


Eduard Drenth, Software Architekt


[hidden email]


Doelestrjitte 8

8911 DX  Ljouwert

+31 58 213 14 14

chat: [hidden email]

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Imsieke, Gerrit, le-tex
In reply to this post by Eduard Drenth
I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
this is not a Saxon problem). It works as expected for me, using the
same quoting of arguments that you used.

Please try to find out, by using a static, non-space-containing file
name for either, whether the message about option '2.xml' stems from the
variable expansion at -s: or at -o:, or both.

Does the error occur when you type the snippet on the command line or
only when it’s embedded in a larger script?

On 17.11.2016 17:46, Eduard Drenth wrote:

> Dear all,
>
>
> Search google, the archives, tested, but no solution yet....(Although
> building Java app using saxon api solves this)
>
>
> In this snippet:
>
>
> find $dir -name '*xml' | while read file
> do
>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
> done
>
> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
> "Unrecognized option: 2.xml"
>
>
> filename is for example "prefix 2.xml"
>
>
> Any suggestions anyone?
>
>
> Eduard Drenth, Software Architekt
>
>
> [hidden email]
>
>
> Doelestrjitte 8
>
> 8911 DX  Ljouwert
>
> +31 58 213 14 14
>
> chat: [hidden email]
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>

--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
[hidden email], http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Dave Pawson-2
Suggestion:
Rather than calling up java, try
$ echo .... followed by the command you're building?
   Then you can see what command you are sending
to java / saxon?

I'll try it on bash in the morning.

regards


On 17 November 2016 at 19:33, Imsieke, Gerrit, le-tex
<[hidden email]> wrote:

> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
> this is not a Saxon problem). It works as expected for me, using the
> same quoting of arguments that you used.
>
> Please try to find out, by using a static, non-space-containing file
> name for either, whether the message about option '2.xml' stems from the
> variable expansion at -s: or at -o:, or both.
>
> Does the error occur when you type the snippet on the command line or
> only when it’s embedded in a larger script?
>
> On 17.11.2016 17:46, Eduard Drenth wrote:
>> Dear all,
>>
>>
>> Search google, the archives, tested, but no solution yet....(Although
>> building Java app using saxon api solves this)
>>
>>
>> In this snippet:
>>
>>
>> find $dir -name '*xml' | while read file
>> do
>>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>> done
>>
>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>> "Unrecognized option: 2.xml"
>>
>>
>> filename is for example "prefix 2.xml"
>>
>>
>> Any suggestions anyone?
>>
>>
>> Eduard Drenth, Software Architekt
>>
>>
>> [hidden email]
>>
>>
>> Doelestrjitte 8
>>
>> 8911 DX  Ljouwert
>>
>> +31 58 213 14 14
>>
>> chat: [hidden email]
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> [hidden email], http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Eduard Drenth
yeah, did that already

typing the command on the bash or sh commandline works fine by the way, just escape the spaces using \ or quotes

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 213 14 14
chat: [hidden email]

________________________________________
From: Dave Pawson <[hidden email]>
Sent: Thursday, November 17, 2016 9:19 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] spaces in filenames trouble

Suggestion:
Rather than calling up java, try
$ echo .... followed by the command you're building?
   Then you can see what command you are sending
to java / saxon?

I'll try it on bash in the morning.

regards


On 17 November 2016 at 19:33, Imsieke, Gerrit, le-tex
<[hidden email]> wrote:

> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
> this is not a Saxon problem). It works as expected for me, using the
> same quoting of arguments that you used.
>
> Please try to find out, by using a static, non-space-containing file
> name for either, whether the message about option '2.xml' stems from the
> variable expansion at -s: or at -o:, or both.
>
> Does the error occur when you type the snippet on the command line or
> only when it’s embedded in a larger script?
>
> On 17.11.2016 17:46, Eduard Drenth wrote:
>> Dear all,
>>
>>
>> Search google, the archives, tested, but no solution yet....(Although
>> building Java app using saxon api solves this)
>>
>>
>> In this snippet:
>>
>>
>> find $dir -name '*xml' | while read file
>> do
>>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>> done
>>
>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>> "Unrecognized option: 2.xml"
>>
>>
>> filename is for example "prefix 2.xml"
>>
>>
>> Any suggestions anyone?
>>
>>
>> Eduard Drenth, Software Architekt
>>
>>
>> [hidden email]
>>
>>
>> Doelestrjitte 8
>>
>> 8911 DX  Ljouwert
>>
>> +31 58 213 14 14
>>
>> chat: [hidden email]
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> [hidden email], http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Eduard Drenth
In reply to this post by Imsieke, Gerrit, le-tex
perhaps I am looking at a bug in my latest ubuntu bash

I would expect -o"$file" would pass the contents of $file as 1 argument to saxon....

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 213 14 14
chat: [hidden email]

________________________________________
From: Imsieke, Gerrit, le-tex <[hidden email]>
Sent: Thursday, November 17, 2016 8:33 PM
To: [hidden email]
Subject: Re: [saxon] spaces in filenames trouble

I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
this is not a Saxon problem). It works as expected for me, using the
same quoting of arguments that you used.

Please try to find out, by using a static, non-space-containing file
name for either, whether the message about option '2.xml' stems from the
variable expansion at -s: or at -o:, or both.

Does the error occur when you type the snippet on the command line or
only when it’s embedded in a larger script?

On 17.11.2016 17:46, Eduard Drenth wrote:

> Dear all,
>
>
> Search google, the archives, tested, but no solution yet....(Although
> building Java app using saxon api solves this)
>
>
> In this snippet:
>
>
> find $dir -name '*xml' | while read file
> do
>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
> done
>
> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
> "Unrecognized option: 2.xml"
>
>
> filename is for example "prefix 2.xml"
>
>
> Any suggestions anyone?
>
>
> Eduard Drenth, Software Architekt
>
>
> [hidden email]
>
>
> Doelestrjitte 8
>
> 8911 DX  Ljouwert
>
> +31 58 213 14 14
>
> chat: [hidden email]
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>

--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
[hidden email], http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Dave Pawson-2
file="prefx 2.xml"

echo java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform
-xsl:some.xslt "-s:\"$file\"" "-o:$teidir/$file"

produces

java -cp /home/dpawson/saxonpe/saxon9pe.jar -Xmx2048m
net.sf.saxon.Transform -xsl:some.xslt -s:"prefx 2.xml" -o:"/prefx
2.xml"

which I think is right for java / Saxon?

Silly question? Why have spaces in filenames in the first place?

HTH

On 18 November 2016 at 06:11, Eduard Drenth <[hidden email]> wrote:

> perhaps I am looking at a bug in my latest ubuntu bash
>
> I would expect -o"$file" would pass the contents of $file as 1 argument to saxon....
>
> Eduard Drenth, Software Architekt
>
> [hidden email]
>
> Doelestrjitte 8
> 8911 DX  Ljouwert
> +31 58 213 14 14
> chat: [hidden email]
>
> ________________________________________
> From: Imsieke, Gerrit, le-tex <[hidden email]>
> Sent: Thursday, November 17, 2016 8:33 PM
> To: [hidden email]
> Subject: Re: [saxon] spaces in filenames trouble
>
> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
> this is not a Saxon problem). It works as expected for me, using the
> same quoting of arguments that you used.
>
> Please try to find out, by using a static, non-space-containing file
> name for either, whether the message about option '2.xml' stems from the
> variable expansion at -s: or at -o:, or both.
>
> Does the error occur when you type the snippet on the command line or
> only when it’s embedded in a larger script?
>
> On 17.11.2016 17:46, Eduard Drenth wrote:
>> Dear all,
>>
>>
>> Search google, the archives, tested, but no solution yet....(Although
>> building Java app using saxon api solves this)
>>
>>
>> In this snippet:
>>
>>
>> find $dir -name '*xml' | while read file
>> do
>>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>> done
>>
>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>> "Unrecognized option: 2.xml"
>>
>>
>> filename is for example "prefix 2.xml"
>>
>>
>> Any suggestions anyone?
>>
>>
>> Eduard Drenth, Software Architekt
>>
>>
>> [hidden email]
>>
>>
>> Doelestrjitte 8
>>
>> 8911 DX  Ljouwert
>>
>> +31 58 213 14 14
>>
>> chat: [hidden email]
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> [hidden email], http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Eduard Drenth
agree with your silly question, but sometimes there is no choice.

and yes that's the commandline I need and the one I get, only thing is it doesn't function

let's close this issue here, not a saxon issue

Thanks all

Eduard Drenth, Software Architekt

[hidden email]

Doelestrjitte 8
8911 DX  Ljouwert
+31 58 213 14 14
chat: [hidden email]

________________________________________
From: Dave Pawson <[hidden email]>
Sent: Friday, November 18, 2016 8:29 AM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] spaces in filenames trouble

file="prefx 2.xml"

echo java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform
-xsl:some.xslt "-s:\"$file\"" "-o:$teidir/$file"

produces

java -cp /home/dpawson/saxonpe/saxon9pe.jar -Xmx2048m
net.sf.saxon.Transform -xsl:some.xslt -s:"prefx 2.xml" -o:"/prefx
2.xml"

which I think is right for java / Saxon?

Silly question? Why have spaces in filenames in the first place?

HTH

On 18 November 2016 at 06:11, Eduard Drenth <[hidden email]> wrote:

> perhaps I am looking at a bug in my latest ubuntu bash
>
> I would expect -o"$file" would pass the contents of $file as 1 argument to saxon....
>
> Eduard Drenth, Software Architekt
>
> [hidden email]
>
> Doelestrjitte 8
> 8911 DX  Ljouwert
> +31 58 213 14 14
> chat: [hidden email]
>
> ________________________________________
> From: Imsieke, Gerrit, le-tex <[hidden email]>
> Sent: Thursday, November 17, 2016 8:33 PM
> To: [hidden email]
> Subject: Re: [saxon] spaces in filenames trouble
>
> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
> this is not a Saxon problem). It works as expected for me, using the
> same quoting of arguments that you used.
>
> Please try to find out, by using a static, non-space-containing file
> name for either, whether the message about option '2.xml' stems from the
> variable expansion at -s: or at -o:, or both.
>
> Does the error occur when you type the snippet on the command line or
> only when it’s embedded in a larger script?
>
> On 17.11.2016 17:46, Eduard Drenth wrote:
>> Dear all,
>>
>>
>> Search google, the archives, tested, but no solution yet....(Although
>> building Java app using saxon api solves this)
>>
>>
>> In this snippet:
>>
>>
>> find $dir -name '*xml' | while read file
>> do
>>     java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>> done
>>
>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>> "Unrecognized option: 2.xml"
>>
>>
>> filename is for example "prefix 2.xml"
>>
>>
>> Any suggestions anyone?
>>
>>
>> Eduard Drenth, Software Architekt
>>
>>
>> [hidden email]
>>
>>
>> Doelestrjitte 8
>>
>> 8911 DX  Ljouwert
>>
>> +31 58 213 14 14
>>
>> chat: [hidden email]
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
> --
> Gerrit Imsieke
> Geschäftsführer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> [hidden email], http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard Vöckler
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

cmarchand
When I have this kind of problem, I use URLs :

... -u -s:file://...foe%20bar/...


HTH,

Christophe


Le 18/11/2016 à 09:27, Eduard Drenth a écrit :

> agree with your silly question, but sometimes there is no choice.
>
> and yes that's the commandline I need and the one I get, only thing is it doesn't function
>
> let's close this issue here, not a saxon issue
>
> Thanks all
>
> Eduard Drenth, Software Architekt
>
> [hidden email]
>
> Doelestrjitte 8
> 8911 DX  Ljouwert
> +31 58 213 14 14
> chat: [hidden email]
>
> ________________________________________
> From: Dave Pawson <[hidden email]>
> Sent: Friday, November 18, 2016 8:29 AM
> To: Mailing list for the SAXON XSLT and XQuery processor
> Subject: Re: [saxon] spaces in filenames trouble
>
> file="prefx 2.xml"
>
> echo java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform
> -xsl:some.xslt "-s:\"$file\"" "-o:$teidir/$file"
>
> produces
>
> java -cp /home/dpawson/saxonpe/saxon9pe.jar -Xmx2048m
> net.sf.saxon.Transform -xsl:some.xslt -s:"prefx 2.xml" -o:"/prefx
> 2.xml"
>
> which I think is right for java / Saxon?
>
> Silly question? Why have spaces in filenames in the first place?
>
> HTH
>
> On 18 November 2016 at 06:11, Eduard Drenth <[hidden email]> wrote:
>> perhaps I am looking at a bug in my latest ubuntu bash
>>
>> I would expect -o"$file" would pass the contents of $file as 1 argument to saxon....
>>
>> Eduard Drenth, Software Architekt
>>
>> [hidden email]
>>
>> Doelestrjitte 8
>> 8911 DX  Ljouwert
>> +31 58 213 14 14
>> chat: [hidden email]
>>
>> ________________________________________
>> From: Imsieke, Gerrit, le-tex <[hidden email]>
>> Sent: Thursday, November 17, 2016 8:33 PM
>> To: [hidden email]
>> Subject: Re: [saxon] spaces in filenames trouble
>>
>> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
>> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
>> this is not a Saxon problem). It works as expected for me, using the
>> same quoting of arguments that you used.
>>
>> Please try to find out, by using a static, non-space-containing file
>> name for either, whether the message about option '2.xml' stems from the
>> variable expansion at -s: or at -o:, or both.
>>
>> Does the error occur when you type the snippet on the command line or
>> only when it’s embedded in a larger script?
>>
>> On 17.11.2016 17:46, Eduard Drenth wrote:
>>> Dear all,
>>>
>>>
>>> Search google, the archives, tested, but no solution yet....(Although
>>> building Java app using saxon api solves this)
>>>
>>>
>>> In this snippet:
>>>
>>>
>>> find $dir -name '*xml' | while read file
>>> do
>>>      java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>>> done
>>>
>>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>>> "Unrecognized option: 2.xml"
>>>
>>>
>>> filename is for example "prefix 2.xml"
>>>
>>>
>>> Any suggestions anyone?
>>>
>>>
>>> Eduard Drenth, Software Architekt
>>>
>>>
>>> [hidden email]
>>>
>>>
>>> Doelestrjitte 8
>>>
>>> 8911 DX  Ljouwert
>>>
>>> +31 58 213 14 14
>>>
>>> chat: [hidden email]
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
>>>
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>> --
>> Gerrit Imsieke
>> Geschäftsführer / Managing Director
>> le-tex publishing services GmbH
>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>> Phone +49 341 355356 110, Fax +49 341 355356 510
>> [hidden email], http://www.le-tex.de
>>
>> Registergericht / Commercial Register: Amtsgericht Leipzig
>> Registernummer / Registration Number: HRB 24930
>>
>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>> Thomas Schmidt, Dr. Reinhard Vöckler
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>


------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Imsieke, Gerrit, le-tex
I don’t think you can use file URIs or hex-escaped characters for -o:
though (which could be overcome by using xsl:result-document where you
can have plain spaces in the href).

On 18.11.2016 11:02, Christophe Marchand wrote:
> When I have this kind of problem, I use URLs :
>
> ... -u -s:file://...foe%20bar/...
>
>
> HTH,
>
> Christophe

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Dave Pawson-2
In reply to this post by cmarchand
Which raises the obvious (Saxon) question,
Can saxon handle spaces | should we use URL's as
suggested?

Mike?

On 18 November 2016 at 10:02, Christophe Marchand <[hidden email]> wrote:

> When I have this kind of problem, I use URLs :
>
> ... -u -s:file://...foe%20bar/...
>
>
> HTH,
>
> Christophe
>
>
> Le 18/11/2016 à 09:27, Eduard Drenth a écrit :
>> agree with your silly question, but sometimes there is no choice.
>>
>> and yes that's the commandline I need and the one I get, only thing is it doesn't function
>>
>> let's close this issue here, not a saxon issue
>>
>> Thanks all
>>
>> Eduard Drenth, Software Architekt
>>
>> [hidden email]
>>
>> Doelestrjitte 8
>> 8911 DX  Ljouwert
>> +31 58 213 14 14
>> chat: [hidden email]
>>
>> ________________________________________
>> From: Dave Pawson <[hidden email]>
>> Sent: Friday, November 18, 2016 8:29 AM
>> To: Mailing list for the SAXON XSLT and XQuery processor
>> Subject: Re: [saxon] spaces in filenames trouble
>>
>> file="prefx 2.xml"
>>
>> echo java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform
>> -xsl:some.xslt "-s:\"$file\"" "-o:$teidir/$file"
>>
>> produces
>>
>> java -cp /home/dpawson/saxonpe/saxon9pe.jar -Xmx2048m
>> net.sf.saxon.Transform -xsl:some.xslt -s:"prefx 2.xml" -o:"/prefx
>> 2.xml"
>>
>> which I think is right for java / Saxon?
>>
>> Silly question? Why have spaces in filenames in the first place?
>>
>> HTH
>>
>> On 18 November 2016 at 06:11, Eduard Drenth <[hidden email]> wrote:
>>> perhaps I am looking at a bug in my latest ubuntu bash
>>>
>>> I would expect -o"$file" would pass the contents of $file as 1 argument to saxon....
>>>
>>> Eduard Drenth, Software Architekt
>>>
>>> [hidden email]
>>>
>>> Doelestrjitte 8
>>> 8911 DX  Ljouwert
>>> +31 58 213 14 14
>>> chat: [hidden email]
>>>
>>> ________________________________________
>>> From: Imsieke, Gerrit, le-tex <[hidden email]>
>>> Sent: Thursday, November 17, 2016 8:33 PM
>>> To: [hidden email]
>>> Subject: Re: [saxon] spaces in filenames trouble
>>>
>>> I tried it with bash 4.2.37(1) on Linux and with bash 4.3.46(7) on
>>> Cygwin, with Saxon PE versions ranging from PE 9.4 through 9.7 (although
>>> this is not a Saxon problem). It works as expected for me, using the
>>> same quoting of arguments that you used.
>>>
>>> Please try to find out, by using a static, non-space-containing file
>>> name for either, whether the message about option '2.xml' stems from the
>>> variable expansion at -s: or at -o:, or both.
>>>
>>> Does the error occur when you type the snippet on the command line or
>>> only when it’s embedded in a larger script?
>>>
>>> On 17.11.2016 17:46, Eduard Drenth wrote:
>>>> Dear all,
>>>>
>>>>
>>>> Search google, the archives, tested, but no solution yet....(Although
>>>> building Java app using saxon api solves this)
>>>>
>>>>
>>>> In this snippet:
>>>>
>>>>
>>>> find $dir -name '*xml' | while read file
>>>> do
>>>>      java -cp ~/saxonpe/saxon9pe.jar -Xmx2048m net.sf.saxon.Transform -xsl:some.xslt "-s:$file" "-o:$teidir/$file"
>>>> done
>>>>
>>>> No matter what I do with quoting, sed -e '/ /%20/', etc. I keep getting:
>>>> "Unrecognized option: 2.xml"
>>>>
>>>>
>>>> filename is for example "prefix 2.xml"
>>>>
>>>>
>>>> Any suggestions anyone?
>>>>
>>>>
>>>> Eduard Drenth, Software Architekt
>>>>
>>>>
>>>> [hidden email]
>>>>
>>>>
>>>> Doelestrjitte 8
>>>>
>>>> 8911 DX  Ljouwert
>>>>
>>>> +31 58 213 14 14
>>>>
>>>> chat: [hidden email]
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>>
>>> --
>>> Gerrit Imsieke
>>> Geschäftsführer / Managing Director
>>> le-tex publishing services GmbH
>>> Weissenfelser Str. 84, 04229 Leipzig, Germany
>>> Phone +49 341 355356 110, Fax +49 341 355356 510
>>> [hidden email], http://www.le-tex.de
>>>
>>> Registergericht / Commercial Register: Amtsgericht Leipzig
>>> Registernummer / Registration Number: HRB 24930
>>>
>>> Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
>>> Thomas Schmidt, Dr. Reinhard Vöckler
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>> --
>> Dave Pawson
>> XSLT XSL-FO FAQ.
>> Docbook FAQ.
>> http://www.dpawson.co.uk
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: spaces in filenames trouble

Michael Kay

> On 18 Nov 2016, at 12:39, Dave Pawson <[hidden email]> wrote:
>
> Which raises the obvious (Saxon) question,
> Can saxon handle spaces | should we use URL's as
> suggested?
>
> Mike?
>


Generally when we accept a filename on the command line, it can contain spaces, provided you escape them as required by the particular shell, e.g by putting the string in quotes or using backslash.

Where we accept a URI we generally don't require it to be %-encoded.

Unfortunately though it's never quite as simple as that because we pass these things on to other software and every interface has its own quirks and restrictions.

Michael Kay
Saxonica


------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...