You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gregor Karlinger <gr...@iaik.at> on 2000/08/11 15:37:04 UTC

Bug Report: Missing default namespace propagation to attribute nodes

Hi all!

I detected a wrong behaviour of Xerces 1.1.3 for Java in connection
with the following example:

  <Envelope>
    <Signature xmlns="http://www.w3.org/2000/07/xmldsig#">
      <SignedInfo>
        <CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2000/WD-xml-c14n-20000710" />
      </SignedInfo>
    </Signature>
  </Envelope>

According to the namespace specification [1] the attribute called
"Algorithm"
should have the namespace declared in the default declaration in the
"Signature"
element:

- Namespace declaration are propagagated to all child Elements.

- Attributes are by default in the same namespace as their bearing elements.

But Xerces does not assign the "Algorithm" attribute the namespace
"http://www.w3.org/2000/07/xmldsig#", but null.


---
[1] http://www.w3.org/TR/REC-xml-names


Regards, Gregor
---------------------------------------------------------------
Gregor Karlinger
mailto://gregor.karlinger@iaik.at
http://www.iaik.at
Phone +43 316 873 5541
Institute for Applied Information Processing and Communications
Austria
---------------------------------------------------------------



Re: Bug Report: Missing default namespace propagation to attribute nodes

Posted by Arnaud Le Hors <le...@us.ibm.com>.
Gregor Karlinger wrote:
> 
> Hi all!
> 
> I detected a wrong behaviour of Xerces 1.1.3 for Java in connection
> with the following example:
> 
>   <Envelope>
>     <Signature xmlns="http://www.w3.org/2000/07/xmldsig#">
>       <SignedInfo>
>         <CanonicalizationMethod
> Algorithm="http://www.w3.org/TR/2000/WD-xml-c14n-20000710" />
>       </SignedInfo>
>     </Signature>
>   </Envelope>
> 
> According to the namespace specification [1] the attribute called
> "Algorithm"
> should have the namespace declared in the default declaration in the
> "Signature"
> element:

I know it's confusing and counter-intuitive but this is not true. The
default namespace does NOT apply to attributes. This is clearly stated
section 5.2 Namespace Defaulting
http://www.w3.org/TR/REC-xml-names/#defaulting:

"Note that default namespaces do not apply directly to attributes."
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group