You can always do this;
    new DocumentBuilder()
        .parse(new InputSource(new FileReader(filename)));
which lets the java.io stuff handle the processing of the filename with
spaces.

Jeff

----- Original Message -----
From: "Neeraj Bajaj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 11:09 AM
Subject: Re: Re[2]: spaces in filenames ...


> Michael wrote:
>
> > I just tried a little more:
> > I have a file "C:\xtest\x 2.xml" containing the following:
> > <?xml version="1.0"?>
> > <!DOCTYPE test SYSTEM "entities.dtd">
> > <test>with entity 2: "&ent2;"</test>
> >
> > and in the same directory I have the entities.dtd with:
> > <!ENTITY ent1 "entity1" >
> > <!ENTITY ent2 "entity2" >
> >
> > I have the following results when loading the file (tested in
> > C:\xtest) with the following code:
> > DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
> InputSource(fname));
>
> try if the following works for you,
> DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
> File(fname));
>
>
> > I haven't found these. I did a full-search over all of the
> > xerces-javadoc and couldn't find anything, neither in the xml-pack
> > summer02_01
>
> Probably they are not part of javadoc because its not public class. But I
am
> sure, its very well in the code :-)
>
>
> Neeraj
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to