C14n test case for non elements - ACTION-381, ISSUE-141

Forwarded message 1

  • From: Pratik Datta <pratik.datta@oracle.com>
  • Date: Tue, 27 Oct 2009 10:32:47 -0700
  • Subject: C14n test case for non elements - ACTION-381, ISSUE-141
  • To: XMLSec XMLSec <public-xmlsec-maintwg@w3.org>
  • Message-ID: <4AE72EBF.20401@oracle.com>
The Y4 test case mentioned in 
http://www.w3.org/Signature/2002/02/01-exc-c14n-interop.html
has some some cases e.g. see c14n-6.txt which only signs namespace 
elements without the enclosing element using a tricky XPath.

Here is the input XML

<foo:Root xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xml:lang="en-ie">
  <bar:Something>
    <foo:Nothing>
      <foo:Something>
        <bar:Something>
          <foo:Something>
            <foo:Nothing>
              <foo:Something>
                <baz:Something />
              </foo:Something>
            </foo:Nothing>
          </foo:Something>
        </bar:Something>
      </foo:Something>
    </foo:Nothing>
  </bar:Something>
</foo>



Here is the XPath
              ancestor-or-self::bar:Something  and
              (count(parent::node()/namespace::*)  =
               count(parent::node()/namespace::* | self::node()))



Output of canonicalization is

 xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo" 
xmlns="http://example.org/" xmlns:bar="http://example.org/bar" 
xmlns:baz="http://example.org/baz" xmlns:foo="http://example.org/foo"


This should close my ACTION-381

Pratik

Received on Tuesday, 27 October 2009 20:21:35 UTC