RDF C14N Inclusive or Exclusive

>
> RDF C14N Inclusive or Exclusive (B)
> ===============================
> Discussion of the differences between the two C14N specs.
>

C14N provides two quite different treatment of namespaces.
These two specs also differ in their treatment of attributes in the XML
namespace, (see below).

Background
==========
People using XML envelopes found the earlier inclusive canonicalization spec
a little problematic, in that information from the envelope ended up in the
canonical version of the payload. Exclusive C14N is intended to be useful
for such applications. rdf:parseType="Literal" appears to be such an
enveloping application and so we should seriously consider exclusive C14N.


Namespaces
==========

In the inclusive treatment all namespaces on a node are made explicit in the
canonical form.

In the exclusive treatment only those that are visibly utilized on elements
qnames or attribute qnames are made explicit.

http://www.w3.org/TR/xml-exc-c14n#def-visibly-utilizes

As an example consider:


<rdf:Description
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xml:lang="en"
  xmlns:eg="http://example.org/">
  <eg:bar rdf:parseType="Literal">
    <foo xsi:type="xsd:decimal">10.09</foo>
  </eg:bar>
</rdf:Description>

Under inclusive C14N the literal value is:

"\n    <foo xml:lang="en" xmlns="" xmlns:eg="http://example.org/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:decimal">10.09</foo>\n  "

although I've probably got the attributes in the wrong order.

All the namespaces, including the rdf one (which must be present because of
rdf:parseType) are present.

Under exclusive C14N the literal value is:
"\n    <foo xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xsd:decimal">10.09</foo>\n  "

because only the xsi and default namespaces are visibly used.

I note that in some sense the exclusive C14N has got this example wrong,
since we need to preserve the binding of the xsd prefix to preserve the
semantics of this example.


Attributes in the XML namespace
===============================

Note that the exclusive form does not copy the xml:lang attribute, whereas
the inclusive form does.

Received on Monday, 4 March 2002 09:45:35 UTC