[jdom-interest] Re: Not finding attributes on an element

Robert r. Sanders robert.sanders at ipov.net
Mon Jul 30 12:51:54 PDT 2001


Try setting:

    RootElement.addNamespaceDeclaration( namespace );

I was having this problem too.  The above resulted in the namespace
declaration being added to the root xml element, and when I read in the file
the attributes had the correct namespace.

P.S. It might be a good idea to add this to the javadocs and/or the online
FAQ.

Robert Sanders

----- Original Message -----
From: "Scott Ellsworth" <scott at alodar.com>
To: <jdom-interest at jdom.org>
Sent: Monday, July 30, 2001 12:34 PM
Subject: [jdom-interest] Re: Not finding attributes on an element


> One possible point of confusion: I am setting the namespace on the
> attribute when it is created, and the xml contains the namespace.  This is
> then written to a file.
>
> The above strange (to me) behaviors happen when that xml is read back
> in.  The part I find surprising is that an attribute created and written
> with a namespace does not came back in with that namespace.
>
> To try and rule out parser bugs, I have tried the above with xerces 1.3.0,
> xerces 1.4.2, and the jaxp/crimson 1.1 parsers distributed with JDOM.
>
> Scott
> Scott Ellsworth
> scott at alodar.com
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>
>
>





More information about the jdom-interest mailing list