Exclusive XML Canonicalization Example (Interop?)

Interop on c14n-exc will be a bit trickier since we'll often want to test 
against two inputs: an XPath expression and input document. We should think 
about how to build a test for this, but here's a simple example that tests 
my understanding:

the eg3 document [1] is evaluated for the element, attribute, and namespace 
nodes of any element whose self or ancestor is e7 [1], yielding the result 
[3].

___

[1] c14n_nodelist = xpath.Evaluate('(//. | //@* 
//namespace::*)[ancestor-or-self::e7]', context=con)

[2] eg3 = """<!DOCTYPE doc [<!ATTLIST e9 attr CDATA "default">]>
<doc xmlns:foo="http://www.bar.org">
   <e1   />
   <e2   ></e2>
   <e3    name = "elem3"   id="elem3"    />
   <e4    name="elem4"   id="elem4"    ></e4>
   <e5 a:attr="out" b:attr="sorted" attr2="all" attr="I'm"
       xmlns:b="http://www.ietf.org"
       xmlns:a="http://www.w3.org"
       xmlns="http://example.org"/>
   <e6 xmlns="" xmlns:a="http://www.w3.org" xml:lang="foo">
       <e7 xmlns="http://www.ietf.org">
           <e8 xmlns="" xmlns:a="http://www.w3.org" foo:bar="baz">
               <e9 xmlns="" xmlns:a="http://www.ietf.org"/>
           </e8>
       </e7>
   </e6>
</doc>
"""

[3] """<e7 xmlns="http://www.ietf.org">
           <e8 xmlns="" xmlns:foo="http://www.bar.org" foo:bar="baz">
               <e9 attr="default"></e9>
           </e8>
       </e7>"""

1. The doc xmlns:foo isn't in e7, but in e8 where it is actually first 
used.
2. A declaration only appears if it's used and not decared by a rendered 
parent. e8 doesn't have xmlns:a="http://www.w3.org" 
3. There's no space before <e7>, but there is before </e7>. (If I think 
back about this, the first text node with value '\0xa           ' doesn't 
have e7 as an ancestor, but the later one does...?)
4. xml:lang doesn't appear in e7 as it would in c14n.

Can anyone confirm?

-- 

* I will be in France from 3-9 November for the W3C AC Meeting.

Joseph Reagle Jr.                 http://www.w3.org/People/Reagle/
W3C Policy Analyst                mailto:reagle@w3.org
IETF/W3C XML-Signature Co-Chair   http://www.w3.org/Signature/
W3C XML Encryption Chair          http://www.w3.org/Encryption/2001/

Received on Thursday, 1 November 2001 16:40:59 UTC