[jdom-interest] Attribute and Namespace

Jason Hunter jhunter at collab.net
Wed Oct 3 23:50:00 PDT 2001


JDOM uses Xerces (or some other parser) so your statement is a little
odd.  It might be that JDOM differs from the DOM built by Xerces. 
Before we get into that, have you tried this with the latest code in
CVS?  

-jh-

"Tom M. Yeh" wrote:
> 
> Hi,
> 
> I found a behavior of JDOM differs from Xerces. When parsing the following XML (thru SAXBuilder+Xerces).
> 
> <ns:ele xmlns:ns="http://anydomain" ns:attr>
> ...
> 
> Then, the namespace of the 'attr' attribute is NO_NAMESPACE, rather than the ns namespace. On the other hand, it works well if I use JAXP + Xerces.
> 
> After looking the source codes, I found SAXHandler seems not adding element's namespace to availableNamespaces. Thus, when SAXHandler.getNamespace got called for the attribute, no namespace is found!
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list