[jdom-interest] possible bug with nested namespaces

John Caron caron at unidata.ucar.edu
Tue Aug 21 08:09:25 PDT 2001


Original:

<test xmlns:xlink="http://www.w3.org/1999/xlink">
   <e1 xlink:href="#htn_sst_decloud"/>
   <wipeout xmlns:xlink="http://www.w3.org/1999/xlink">
     <server type="DODS" ID="this" 
xlink:href="html://thredds.unidata.ucar.edu:8080/dodsC/"/>
   </wipeout>
   <e1 xlink:href="#htn_sst_decloud2"/> <!-- NOTE xlink namespace -->
</test>

After parsing:

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:xlink="http://www.w3.org/1999/xlink">
   <e1 xlink:href="#htn_sst_decloud" />
   <wipeout>
     <server type="DODS" ID="this" 
xlink:href="html://thredds.unidata.ucar.edu:8080/dodsC/" />
   </wipeout>
   <e1 href="#htn_sst_decloud2" /> <!-- HERES THE PROBLEM - the xlink 
namespace removed !! -->
</test>

Yes, I see what you are saying, that the namespace declaration has been 
removed from the <wipeout> elemnt.

But the problem is on the second <e1> element, where the xlink: prefix 
has been removed from the href attribute. This makes the 2 docs not 
equivalent.

I retested with xerces 1.4.3 with same result.



philip.nelson at omniresources.com wrote:

>>When nested elements declare the same namespace, it appears 
>>that when the
>>inner element is done being processed, the namespace on other elements
>>contained in the outer element is lost.
>>
> 
> I think that you may be confusing a namespace and a namespace declaration.
> You did lose a namespace declaration.  However the input and output
> documents are equivalent.  JDOM does move namespace declarations up to the
> outermost necesary element.  In fact JDOM doesn't keep track of where
> declarations occur so the "problem" is that when xmloutputter is used, it
> has to create the declarations as needed.  
> 





More information about the jdom-interest mailing list