[jdom-interest] DOMOutputter attribute/namespace problem.

Jason Hunter jhunter at xquery.com
Mon Apr 12 22:47:17 PDT 2004


No one else is working on it.  I'd welcome a patch or summary of what 
slipped through.

-jh-

Spindizzy - The Dizzy Wizard wrote:

> I looked through the 'interest' list, and noticed that a number of
> people commented that various namespace fixes needed to be applied to
> DOMOutputter, as well as to whichever class they were working on at
> that time.
> 
> Unfortunately, it looks like this has slid through the cracks.
> 
> If you look at DOMOutputter.java (which I got from CVS in the last hour
> or so), at line 307 a check is made to see if the attribute namespace
> is the same as the element namespace.  If it isn't, the attribute
> namespace is added regardless of what namespaces are presently in
> scope.
> 
> If no one else is already dealing with this, let me know, and I'll take
> a swing at it, although I'm likely to only fix the one problem.  Little
> time, lotsa work, and this is the only one I know of for certain.
> 
> A few more details:
> 
> <?xml version="1.0"?>
> <test xmlns="http://foo/test" xmlns:bar="http://bar/test">
> <bar:embedded bar:ID="1">
> <bar:type bar:value="alpha"/>
> <otherobject bar:value="beta"/>
> <otherprop>propvalue</otherprop>
> </bar:embedded>
> </test>
> 
> When pushed through DOMOutputter, and then serialized (don't ask why),
> you get the following:
> 
> <?xml version="1.0"?>
> <test xmlns="http://foo/test" xmlns:bar="http://bar/test">
> <bar:embedded bar:ID="1">
> <bar:type bar:value="alpha"/>
> <otherobject bar:value="beta" xmlns:bar="http://bar/test"/>
> <otherprop>propvalue</otherprop>
> </bar:embedded>
> </test>
> 
> Notice the extra namespace declaration on 'otherobject'?
> 
> 
> =====
> Spindizzy, the Dizzy Wizard
> (spindizzy_wizard at yahoo.com)
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th
> http://taxes.yahoo.com/filing.html
> _______________________________________________
> 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