You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Michael Mutschler <mi...@mutschler.de> on 2002/12/19 12:08:19 UTC

spaces in filenames ...

Hallo,

I know this topic has been very often discussed. But I haven't found
any help on this in the FAQ.

I know, you have to encode the filename, in order to get this work.
What I want to know is: is there any sample mehtod to perform this
conversion? java.net.URLEncoder.encode() will not work, since it
translates ' ' into '+'.

Another thing, which I don't like in this context is the Constructor
   javax.xml.transform.stream.StreamSource(java.io.FileĀ f)
which I use for creating an XSLT Transformer.
Here you have a File for the constructor, and when this File-object
is a file containing a space, you run into the MalformedUrlException
when you use xerces as parser.
I actually dislike the idea of using an encoded-File-object.
Perhaps this constructor should be deprecated, and instead one
should use the constructorwhich takes a SystemID? Or better:
shouldn't the 'File'-Constructor perform this encoding?

I just saw "public Document DocumentBuilder.parse(File f)". You
probably have the same problem here too.

So what is the right way to parse a file using jaxp so all parsers can
handle all files? And can anybody give an example of a (fully) working
File->systemID converter?

-- 
Best regards,
 Michael                          mailto:michael@mutschler.de



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org