RE: Updated c14n Spec

The current XPath canonicalization is starting to look quite nice. 

However, the namespace canonicalization process is one thing I would like to
discuss.

My suggestion is that we define the spec to be a combination of the old C14N
spec and the current XPath spec, so that we drop namespace rewriting and
also drop the requirement for the "namespace::" axis functionality.

My main motivation is performance: the namespace axis approach requires one
to walk the parent nodes of a element when canonicalizing and keep track of
inherited namespaces etc., the old C14N spec is very simple to implement in
one single pass. 

Other motivations are that the original C14N approach (even without
namespace rewriting) is simpler to implement and that many XML processors do
not implement the namespace axis functionality.


This is a part from the sample in [1]:

<doc xmlns:x="http://w3.org/2" xmlns:y="http://w3.org/1">
<x:e a="a"/>
<x:e x:a="x:a"/>
...

Canonicalized by this suggestion:

<doc xmlns="">
<x:e xmlns:x="http://w3.org/2" a="a"></x:e>
<x:e xmlns:x="http://w3.org/2" x:a="x:a"></x:e>

Canonicalized by the current XPath spec:

<doc xmlns="" xmlns:y="http://w3.org/1" xmlns:x="http://w3.org/2">
<x:e xmlns:y="http://w3.org/1" xmlns:x="http://w3.org/2" a="a"></x:e>
<x:e xmlns:y="http://w3.org/1" xmlns:x="http://w3.org/2" x:a="x:a"></x:e>


The idea is that an element always declares only those namespaces that
appear on the element itself and on the element's attributes. The default
namespace is only declared when the element belongs to the default
namespace. No namespace prefix rewriting is necessary. The namespaces can
well be declared in the order given in chapter A.4 of [2].


Petteri


[1] http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html
[2]
http://lists.w3.org/Archives/Public/w3c-ietf-xmldsig/2000AprJun/att-0246/01-
xml-c14n.htm

Received on Monday, 12 June 2000 09:45:37 UTC