Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] debug everywhere

Jason Hunter

2007-01-19

Replies:

When you pass a string to the build() command you are passing a
systemId, not a path to file. Internally it's converted to a SAX
InputSource. Odds are it's a backslash related issue in that you were
lucky sometimes your file path worked as a systemId, but on Windows it
doesn't because of C: and backslashes.

-jh-

dmatthews@(protected):
> Hi jdom
>
> import org.jdom.Document;
> SAXBuilder builder = new SAXBuilder();
> try{
>         Document doc = builder.build("path to file");
> } catch(Exception e){}
>
> on Gnu\Linux with java 1.5 or 1.6 - good
> on Windows with java 1.5 - good
> on Windows with java 1.6 - NullPointerException
>
> this works in all above cases:-
>
> File file = new File("path to file");
> try{
>        Document doc = builder.build(file);
> } catch(Exception e){}
>
>
>
> hope this is of interest
> thanks for jdom
>
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
>
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.