[XML-SIG] problem with empty namespace uri

Uche Ogbuji uche.ogbuji@fourthought.com
Mon, 29 Jan 2001 14:22:38 -0700


> Uche Ogbuji writes:
>  > > Uche Ogbuji writes:
>  > >  > Hmm.  I introduced this behavior while fixing another drv_pyexpat bug (default 
>  > >  > namespaces on unprefixes attributes were being returned as the namespace of 
>  > >  > the element).
>  > > Is this not correct?
>  > > 
>  > > I interpreted the following phrase from the namespace spec
>  > > in this direction:
>  > > 
>  > >    "Note that default namespaces do not apply directly to attributes."
>  > 
>  > Yes.  And I fixed the driver to meet this.  Prior to my fix, drv_xmlproc was 
>  > returning the default namespace on unprefixed attributes in violation of XML 
>  > Namespaces 1.0, and in particular, the portion you quoted.  Now it returns 
>  > None, or after I check in Alexandre's patch, "".
> I interpret this part differently:
> 
>   Default namespaces do not apply directly to attributes but
>   indirectly via the element they belong to.
> 
>   If a have:
> 
>      <ns:elem attr=val ...>
> 
>   then (at least semantically), "attr" delongs to the same
>   namespace as "elem" (the namespace associated with "ns").

No, I think this much is pretty clear from authoritative discussion, even 
though the XMLNS 1.0 spec is stupidly vague on the matter.  Based on my 
understanding of Tim Bray, James Tauber, etc, unprefixed attributes are 
*syntactically* in no namespace.

It is up to the application to decide that it *semantically* shares the 
namespace of its owner element, and this determination is easy enough to 
determine even though it differs from the strict syntax.

Basically, the XMLNS 1.0 processor should return a null namespace for attr in 
your example, but the appication is free to say "it's an attribute of elem, so 
I'll treat it as being in the {ns} namespace.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python