c14n/exc-c14n interop samples
merlin <[email protected]> Tue, 28 May 2002 15:02:57 +0100
| Newsgroups | gmane.ietf.xmldsig |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Attached is a signature with 9 XPath-transformed examples
run through c14, exc-c14n and exc-c14n with an inclusive
namespace prefix list. The XPath transforms variously
manipulate the namespace axis to demonstrate c14n behaviour
in different situations. For example:
<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:Something>
<bar:Something>
<foo:Something>
<baz:Something />
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" ... />
</foo:Root
The following XPath selects the bar:Something subtree, but
only includes namespace nodes that are directly used by their
parent element.
ancestor-or-self::bar:Something and
(self::text() or
(namespace-uri() != "") or
(string(self::node()) = namespace-uri(parent::node())))
I believe that the canonical form is then:
<bar:Something xmlns:bar="http://example.org/bar" xml:lang="en-ie">
<foo:Something xmlns:foo="http://example.org/foo">
<bar:Something xmlns:bar="http://example.org/bar">
<foo:Something xmlns:foo="http://example.org/foo">
<baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
And I believe that the exclusive canonical form is:
<bar:Something xmlns:bar="http://example.org/bar">
<foo:Something xmlns:foo="http://example.org/foo">
<bar:Something>
<foo:Something>
<baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
</foo:Something>
</bar:Something>
</foo:Something>
</bar:Something>
Merlin
merlin-c14n-two.tar.gz
(application/x-tar-gz, 5.3 KB) - not displayed