[jdom-interest] possible bug with nested namespaces

philip.nelson at omniresources.com philip.nelson at omniresources.com
Tue Aug 21 08:53:01 PDT 2001


Yep, that is a problem.  I'll see if I can find a few spare moments to
reproduce it.  Could you do me a favor and rerun it changing the xlink
prefix to something else?  I seem to remember some special casing for xlink
(but could be wrong on that).

> 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.  
> > 
> 
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list