Re: exc c14n bugs

r/JBoyer@pureedge.com/2002.06.04/10:07:44
>OK, that helps.  But, what is the connection that characterizes the
>problem as the result of 'inheriting xmlns="" behaviour from c14n'.

Because xmlns="" is, uniquely, not represented in the node set
as presence of a namespace node, but absence of a namespace
node. As a result, we have special language in c14n that
describes when to emit xmlns="": When the current element
does not have a default namespace node and its ancestor does.

Exc-c14n is specified in terms of c14n with exceptions; i.e.,
it inherits behaviour from c14n. It describes when to ignore
namespace nodes (when they are not visibly utilized), but it
does not describe when to ignore xmlns="" (when the default
namespace is not visibly utilized).

This is why I characterize the problem as I do.

>More importantly (though perhaps just a different facet of the same
>question), why is the default namespace declaration being retained in
>the output of element b:B?
>
>b:B either does or does not visibly utilize the default namespace.  If
>it does, then the nearest output ancestor of C that has a default
>namespace assigns a different value, so the default namespace
>declaration would appear in the canonicalization of C.  If it does not
>(which is the case in this example), then C is emitted as you've shown,
>but the xmlns="" should also be excluded such that the interpretation of
>C is unaltered.
>
>If it were possible to add an attribute to b:B that visibly utilizes the
>default namespace, then xmlns="" would appear in b:B, but according to
>the former statement above, the default namespace for C would no longer
>be excluded.
>
>Note, however, that it is impossible to add such an attribute.  An
>attribute with no namespace prefix is not considered to be utilizing the
>default namespace according to the Namespaces Rec.  The only way to
>visibly utilize the default namespace is with an element, which the
>exc-c14n spec notes when it says "...an element E in a document subset
>that visibly utilizes the default namespace declaration, which occurs if
>E has no namespace prefix".

http://www.w3.org/TR/xml-c14n, §4.7:
  The XPath data model represents an empty default namespace with the
  absence of a node, not with the presence of a default namespace node
  having an empty value

In this example, xmlns="" does not corresponding to a
visibly utilized namespace node; it does not correspond to
any namespace node at all.

I've been completely wrong about this before; feel free to
continue the trend.

Merlin

Received on Tuesday, 4 June 2002 13:59:48 UTC