CARVIEW |
Test cases for Canonical XML 2.0
W3C Working Group Note
- This version:
- https://www.w3.org/TR/2013/NOTE-xml-c14n2-testcases-20130618/
- Latest published version:
- https://www.w3.org/TR/xml-c14n2-testcases/
- Latest editor's draft:
- https://www.w3.org/2008/xmlsec/Drafts/c14n-20/test-cases/
- Previous version:
- https://www.w3.org/TR/2013/NOTE-xml-c14n2-testcases-20130411/
- Editors:
- Pratik Datta, pratik.datta@oracle.com
- Frederick Hirsch, frederick.hirsch@nokia.com
Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.
Abstract
This document outlines test cases for Canonical XML 2.0 [XML-C14N20].
Status of This Document
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document outlines test cases for Canonical XML 2.0 [XML-C14N20]. Changes since the previous publication include a correction to the text in section 3.4 Namespace Re-declarations (diff).
This document was published by the XML Security Working Group as a Working Group Note. If you wish to make comments regarding this document, please send them to public-xmlsec@w3.org (subscribe, archives). All comments are welcome.
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Table of Contents
1. Introduction
This document has various test cases for Canonical XML 2.0 [XML-C14N20]. All the test files are available in this directory: files.The test cases are organized as follows:
- Input file All the input files are named starting with "in".
e.g.
inNsPushdown.xml
. - C14N parameter filesThe C14n parameters files contain
a
<CanonicalizationMethod>
element containing canonicalization parameters.c14nDefault.xml
: Default canonicalization.c14nComment.xml
: Canonicalization with comment removal.c14nPrefix.xml
: Canonicalization with prefix rewriting.c14nPrefixQName.xml
: Canonicalization with prefix rewriting and a Qname aware attributexsi:type
.c14nQname.xml
: Canonicalization with a Qname aware attributexsi:type
, but not prefix rewriting.c14nQnameElem.xml
: Canonicalization with a Qname aware element<a:bar>
, but not prefix rewriting.c14nQnameXpathElem.xml
: Canonicalization with a Qname aware element<a:bar>
, and Qname aware XPath element<dsig2:IncludedXPath>
, but not prefix rewriting.c14nPrefixQnameXpathElem.xml
: Canonicalization with prefix rewriting and a Qname aware element<a:bar>
, and Qname aware XPath element<dsig2:IncludedXPath>
.
- Output files Each input file is run with each
canonicalization parameter file to produce canonicalize
output files. These are named "out_" + <input file name> + "_"
+ <c14n parameter file name>,
e.g.
out_inNsPushdown_c14nDefault.xml
.
2. Examples from Canonical XML 1.0
The examples in this section assume a non-validating processor, primarily so that a document type declaration can be used to declare entities as well as default attributes and attributes of various types (such as ID and enumerated) without having to declare all attributes for all elements in the document. As well, one example contains an element that deliberately violates a validity constraint (because it is still well-formed).2.1 PIs, Comments, and Outside of Document Element
Demonstrates:- Loss of XML declaration
<?xml version="1.0"?>
- Loss of DTD
<!DOCTYPE doc SYSTEM "doc.dtd">
- Normalization of whitespace outside of document element (first character of both canonical forms is '<'; single line breaks separate PIs and comments outside of document element)
- Loss of whitespace between PITarget and its data
- Retention of whitespace inside PI data
- Comment removal from uncommented canonical form, including delimiter for comments outside document element (the last character in both canonical forms is '>')
Original Data | After c14n | After c14n with Comments |
---|---|---|
Example 1 <?xml version="1.0"?> <?xml-stylesheet href="doc.xsl" type="text/xsl" ?> <!DOCTYPE doc SYSTEM "doc.dtd"> <doc>Hello, world!<!-- Comment 1 --></doc> <?pi-without-data ?> <!-- Comment 2 --> <!-- Comment 3 --> |
Example 2 <?xml-stylesheet href="doc.xsl" type="text/xsl" ?> <doc>Hello, world!</doc> <?pi-without-data?> |
Example 3 <?xml-stylesheet href="doc.xsl" type="text/xsl" ?> <doc>Hello, world!<!-- Comment 1 --></doc> <?pi-without-data?> <!-- Comment 2 --> <!-- Comment 3 --> |
2.2 Whitespace in Document Content
"After c14n" Demonstrates:- Retain all whitespace between consecutive start tags, clean or dirty
- Retain all whitespace between consecutive end tags, clean or dirty
- Retain all whitespace between end tag/start tag pair, clean or dirty
- Retain all whitespace in character content, clean or dirty
Note: For "After c14n", the input document and canonical form are identical. Both end with '>' character.
"After c14n with Trim whitespace" Demonstrates:- Retain white space inside text, i.e. inbetween
A
andB
but remove all leading and trailing whitespace
Original Data | After c14n | After c14n with Trim whitespace |
---|---|---|
Example 4 <doc> <clean> </clean> <dirty> A B </dirty> <mixed> A <clean> </clean> B <dirty> A B </dirty> C </mixed> </doc> |
Example 5 <doc> <clean> </clean> <dirty> A B </dirty> <mixed> A <clean> </clean> B <dirty> A B </dirty> C </mixed> </doc> |
Example 6 <doc><clean></clean><dirty>A B</dirty><mixed>A<clean></clean>B<dirty>A B</dirty>C</mixed></doc> |
2.3 Start and End Tags
"After c14n" Demonstrates:- Empty element conversion to start-end tag pair.
I.e.
<e1 />
becomes<e1></e1>
- Normalization of whitespace in start and end tags.
I.e..
<e2 ></e2>
becomes<e2></e2>
- Relative order of namespace and attribute axes,
I.e. in
<e5>
the namespace declarations precede the attribute declarations. - Lexicographic ordering of namespace and attribute axes
- Retention of namespace prefixes from original document
- Elimination of superfluous namespace declarations
- Addition of default attribute. I.e.
<e9 attr="default">
.
Note: Some start tags in the canonical form are very long, but each start tag in this example is entirely on a single line.
Note: In e5
, b:attr
precedes
a:attr
because the primary key is namespace URI not namespace
prefix, and attr2
precedes b:attr
because
the default namespace is not applied to unqualified attributes (so
the namespace URI for attr2
is empty).
Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 7 <!DOCTYPE doc [<!ATTLIST e9 attr CDATA "default">]> <doc> <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="https://www.ietf.org" xmlns:a="https://www.w3.org" xmlns="https://example.org"/> <e6 xmlns="" xmlns:a="https://www.w3.org"> <e7 xmlns="https://www.ietf.org"> <e8 xmlns="" xmlns:a="https://www.w3.org"> <e9 xmlns="" xmlns:a="https://www.ietf.org"/> </e8> </e7> </e6> </doc> |
Example 8 <doc> <e1></e1> <e2></e2> <e3 id="elem3" name="elem3"></e3> <e4 id="elem4" name="elem4"></e4> <e5 xmlns="https://example.org" xmlns:a="https://www.w3.org" xmlns:b="https://www.ietf.org" attr="I'm" attr2="all" b:attr="sorted" a:attr="out"></e5> <e6> <e7 xmlns="https://www.ietf.org"> <e8 xmlns=""> <e9 attr="default"></e9> </e8> </e7> </e6> </doc> |
Example 9 <n0:doc xmlns:n0=""> <n0:e1></n0:e1> <n0:e2></n0:e2> <n0:e3 id="elem3" name="elem3"></n0:e3> <n0:e4 id="elem4" name="elem4"></n0:e4> <n1:e5 xmlns:n1="https://example.org" xmlns:n2="https://www.ietf.org" xmlns:n3="https://www.w3.org" attr="I'm" attr2="all" n2:attr="sorted" n3:attr="out"></n1:e5> <n0:e6> <n2:e7 xmlns:n2="https://www.ietf.org"> <n0:e8> <n0:e9 attr="default"></n0:e9> </n0:e8> </n2:e7> </n0:e6> </n0:doc> |
After c14n with Trim whitespace | ||
Example 10 <doc><e1></e1><e2></e2><e3 id="elem3" name="elem3"></e3><e4 id="elem4" name="elem4"></e4><e5 xmlns="https://example.org" xmlns:a="https://www.w3.org" xmlns:b="https://www.ietf.org" attr="I'm" attr2="all" b:attr="sorted" a:attr="out"></e5><e6><e7 xmlns="https://www.ietf.org"><e8 xmlns=""><e9 attr="default"></e9></e8></e7></e6></doc> |
2.4 Character Modifications and Character References
Demonstrates:- Character reference replacement
- Attribute value delimiters set to quotation marks (double quotes)
- Attribute value normalization
- CDATA section replacement
- Encoding of special characters as character references in attribute values (&, <, ", 
, 
, 	)
- Encoding of special characters as character references in text (&, <, >, 
)
Note: The last element, normId
, is well-formed
but violates a validity constraint for attributes of type ID. For
testing canonical XML implementations based on validating processors,
remove the line containing this element from the input and canonical
form. In general, XML consumers should be discouraged from using this
feature of XML.
Note: Whitespace character references other than   are not affected by attribute value normalization [XML10].
Note: In the canonical form,
the value of the attribute named attr
in the element
norm
begins with a space, an apostrophe (single quote), then
four spaces before the first character reference.
Note: The expr
attribute of the second
compute
element contains no line breaks.
Original Data | After c14n | After c14n with Trim whitespace |
---|---|---|
Example 11 <!DOCTYPE doc [ <!ATTLIST normId id ID #IMPLIED> <!ATTLIST normNames attr NMTOKENS #IMPLIED> ]> <doc> <text>First line Second line</text> <value>2</value> <compute><![CDATA[value>"0" && value<"10" ?"valid":"error"]]></compute> <compute expr='value>"0" && value<"10" ?"valid":"error"'>valid</compute> <norm attr=' ' ' '/> <normNames attr=' A B '/> <normId id=' ' ' '/> </doc> |
Example 12 <doc> <text>First line Second line</text> <value>2</value> <compute>value>"0" && value<"10" ?"valid":"error"</compute> <compute expr="value>"0" && value<"10" ?"valid":"error"">valid</compute> <norm attr=" ' ' "></norm> <normNames attr="A B"></normNames> <normId id="' '"></normId> </doc> |
Example 13 <doc><text>First line Second line</text><value>2</value><compute>value>"0" && value<"10" ?"valid":"error"</compute><compute expr="value>"0" && value<"10" ?"valid":"error"">valid</compute><norm attr=" ' ' "></norm><normNames attr="A B"></normNames><normId id="' '"></normId></doc> |
2.5 Entity References
Demonstrates:- Internal parsed entity reference replacement
- External parsed entity reference replacement (including whitespace outside elements and PIs)
- External unparsed entity reference
Original Data | After c14n | After c14n with Trim whitespace |
---|---|---|
Example 14 <!DOCTYPE doc [ <!ATTLIST doc attrExtEnt CDATA #IMPLIED> <!ENTITY ent1 "Hello"> <!ENTITY ent2 SYSTEM "world.txt"> <!ENTITY entExt SYSTEM "earth.gif" NDATA gif> <!NOTATION gif SYSTEM "viewgif.exe"> ]> <doc attrExtEnt="entExt"> &ent1;, &ent2;! </doc> <!-- Let world.txt contain "world" (excluding the quotes) --> |
Example 15 <doc attrExtEnt="entExt"> Hello, world! </doc> |
Example 16 <doc attrExtEnt="entExt">Hello, world!</doc> |
2.6 UTF-8 Encoding
Demonstrates:- Effect of transcoding from a sample encoding to UTF-8
Note: The content of the doc element are two octets whose hexadecimal values are C2 and A9, which is the UTF-8 encoding of the UCS codepoint for the copyright sign (©).
Original Data | After c14n |
---|---|
Example 17 <?xml version="1.0" encoding="ISO-8859-1"?> <doc>©</doc> |
Example 18 <doc>©</doc> |
3. Dealing with Namespaces
3.1 Namespaces declarations are pushed down
In this example there are three prefixes declarations: "a" "b" and "c". Of these "c" is not visibly utilized at all, so it does not appear in the canonicalized output. "b" is used but not by the top level "a:foo" element, but by each of its children, so canonicalization "pushes down" the declaration to where it is actually utilized. Note the three "b:bar" elements utilize the "b" prefix in the element name, whereas the last "a:bar" element utilizes that declaration not in the element name , but in the "b:att" attribute.Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 19 <a:foo xmlns:a="https://a" xmlns:b="https://b" xmlns:c="https://c"> <b:bar/> <b:bar/> <b:bar/> <a:bar b:att1="val"/> </a:foo> |
Example 20 <a:foo xmlns:a="https://a"> <b:bar xmlns:b="https://b"></b:bar> <b:bar xmlns:b="https://b"></b:bar> <b:bar xmlns:b="https://b"></b:bar> <a:bar xmlns:b="https://b" b:att1="val"></a:bar> </a:foo> |
Example 21 <n0:foo xmlns:n0="https://a"> <n1:bar xmlns:n1="https://b"></n1:bar> <n1:bar xmlns:n1="https://b"></n1:bar> <n1:bar xmlns:n1="https://b"></n1:bar> <n0:bar xmlns:n1="https://b" n1:att1="val"></n0:bar> </n0:foo> |
3.2 Default namespace declarations
In this example there are three prefixes declarations: "a", "b", and also a default prefix. Of these "a" is not visibly utilized at all, so it does not appear in the canonicalized output. The "foo" element uses the default prefix. Note however the "att2" attribute does NOT use the default prefix, it is simply in the scope of the "b:bar" element. With prefix rewriting both the default prefix and the "b" prefix are rewritten.Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 22 <foo xmlns:a="https://a" xmlns:b="https://b"> <b:bar b:att1="val" att2="val"/> </foo> |
Example 23 <foo> <b:bar xmlns:b="https://b" att2="val" b:att1="val"></b:bar> </foo> |
Example 24 <n0:foo xmlns:n0=""> <n1:bar xmlns:n1="https://b" att2="val" n1:att1="val"></n1:bar> </n0:foo> |
3.3 Sorting namespace declarations
In this example there are four prefixes declarations: "a", "b", "c" and "d". They map to namespace URIs "https://z3", "https://z2", "https://z1" and "https://z0" respectively.
Notice the following things in the default canonicalization ("After c14n"):
- In "a:foo" all the namespace declarations appear before the attribute declarations, even though they were mixed up in the original document.
- In "a:foo" the attributes are sorted in this order - "c:att3", "b:att1", "b:att2". This is because attributes are sorted by namespaceURI as primary key and localName as secondary key. Since "c" is https://z1 and "b" is https://z2, all the "c" attributes appear before "b" attributes. Note that within the "b" attributes "att1" appears before "att2".
- In "a:foo" all the namespace declarations are sorted by prefixes i.e. "a", "b", "c", and NOT by namespace URIs.
- New prefixes are assigned in the order in which they are visibly utilized:
- At first "a:foo" visibly utilizes prefixes "a", "b" and "c". These are then sorted by namespace URI, resulting in "c", "b", "a". Then they are assigned prefixes "https://z1"->"n0", "https://z2"->"n1" and "https://z3"->"n2"
- After that "c:bar" visibly utilizes prefix "d". This gets assigned prefix "n3"
- In "a:foo" all rewritten prefixes are sorted by prefixes i.e. "n0", "n1", "n2".
Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 25 <a:foo xmlns:a="https://z3" xmlns:b="https://z2" b:att1="val1" c:att3="val3" b:att2="val2" xmlns:c="https://z1" xmlns:d="https://z0"> <c:bar/> <c:bar d:att3="val3"/> </a:foo> |
Example 26 <a:foo xmlns:a="https://z3" xmlns:b="https://z2" xmlns:c="https://z1" c:att3="val3" b:att1="val1" b:att2="val2"> <c:bar></c:bar> <c:bar xmlns:d="https://z0" d:att3="val3"></c:bar> </a:foo> |
Example 27 <n2:foo xmlns:n0="https://z1" xmlns:n1="https://z2" xmlns:n2="https://z3" n0:att3="val3" n1:att1="val1" n1:att2="val2"> <n0:bar></n0:bar> <n0:bar xmlns:n3="https://z0" n3:att3="val3"></n0:bar> </n2:foo> |
3.4 Namespace Re-declarations
In this example there are three prefixes "a", "b" and the default prefix. The "foo" element defines them to be "https://z3", "https://z2" and "" respectively. But the "bar" redeclares these prefixes to "https://z2", "https://z3" abd "https://z0" respectively.
Notice the following things in the default canonicalization ("After c14n"):
- The redeclarations of the prefixes by the "bar" element are not removed by canonicalization, since these declarations are not superfluous.
And notice these things in canonicalization with prefix rewriting ("After c14n with PrefixRewrite"):
- With prefix rewriting, the new prefixes are never redeclared. Instead the same prefix gets rewritten to two different values depending on what namespace it currently declares. For example, for element "foo" attribute "a:att1" gets rewritten to "n2:att1", whereas for element "bar" attribute "a:att1" gets rewritten to "n1:att1". Essentially with prefix rewriting, the current prefixes are completely ignored, and canonicalization assigns new prefixes based on namespace values.
Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 28 <foo xmlns:a="https://z3" xmlns:b="https://z2" a:att1="val1" b:att2="val2"> <bar xmlns="https://z0" xmlns:a="https://z2" a:att1="val1" b:att2="val2" xmlns:b="https://z3" /> </foo> |
Example 29 <foo xmlns:a="https://z3" xmlns:b="https://z2" b:att2="val2" a:att1="val1"> <bar xmlns="https://z0" xmlns:a="https://z2" xmlns:b="https://z3" a:att1="val1" b:att2="val2"></bar> </foo> |
Example 30 <n0:foo xmlns:n0="" xmlns:n1="https://z2" xmlns:n2="https://z3" n1:att2="val2" n2:att1="val1"> <n3:bar xmlns:n3="https://z0" n1:att1="val1" n2:att2="val2"></n3:bar> </n0:foo> |
3.5 Superfluous Namespace declarations
In this example there are five prefixes "a", "b", "c", "d" and the default prefix and they are all declared to the same namespace URI "https://z0". The "a" prefix is defined twice, one in the "foo" element, and then again in "c:bar" element; obviously the definition of "a" in "c:bar" is unnecessary.
Notice the following things in the default canonicalization ("After c14n"):
- It does not attempt to recognize that "a", "b", "c", "d" and default are pointing to the same thing.
- It removes the extra declaration of "xmlns:a" in the "c:bar" as that is superfluous.
- All the file prefixes "a", "b", "c", "d" are rewritten to the same prefix - "z0".
Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 31 <foo xmlns:a="https://z0" xmlns:b="https://z0" a:att1="val1" b:att2="val2" xmlns="https://z0"> <c:bar xmlns:a="https://z0" xmlns:c="https://z0" c:att3="val3"/> <d:bar xmlns:d="https://z0"/> </foo> |
Example 32 <foo xmlns="https://z0" xmlns:a="https://z0" xmlns:b="https://z0" a:att1="val1" b:att2="val2"> <c:bar xmlns:c="https://z0" c:att3="val3"></c:bar> <d:bar xmlns:d="https://z0"></d:bar> </foo> |
Example 33 <n0:foo xmlns:n0="https://z0" n0:att1="val1" n0:att2="val2"> <n0:bar n0:att3="val3"></n0:bar> <n0:bar></n0:bar> </n0:foo> |
3.6 Special namespaces "xml", "xsi", "xsd"
In this example there are are three special namespace declaration the "xml" namespace used
in the attribute xml:id="23"
and also the "xsi" and "xsd" namespaces used in
xsi:type="xsd:string"
.
Canonicalization only treats "xml" as a special namespace. It is never rewritten by prefix-rewriting. "xsi" and "xsd" are treated as regular namespaces.
Notice the following things in the default canonicalization ("After c14n"):
- It does not consider the "xsd" prefix as visibly utilized since it is embedded in the content. That is why it removes the "xsd" namespace declaration completely.
- It also removes the "xsd" declaration completely.
- It doesn't change the "xml" prefix to anything else, also it doesn't emit the namespace declaration for the "xml" prefix.
- But it does rewrite the "xsi" prefix to "ns1".
- Look at the
CanonicalzationMethod
in c14nQname.xml. it lists "xsi:type" as a Qualified Attribute in the QNameAware element. - So now the canonicalization looks into the "xsi:type" for prefixes. It finds the "xsd" element and considers it visibly utilized, and hence emits the "xsd" namespace declaration.
- Look at the
CanonicalzationMethod
in c14nPrefixQname.xml. it lists "xsi:type" as a Qualified Attribute in the QNameAware element. It also PrefixRewite=sequential - So now "xsd" is considered visibly utilized, and it is rewritten to "n1".
I.e.
xsi:type="xsd:string"
changes ton2:type="n1:string".
Original Data | After c14n | After c14n with PrefixRewrite |
---|---|---|
Example 34 <foo xmlns="https://z0" xml:id="23"> <bar xsi:type="xsd:string" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">data</bar> </foo> |
Example 35 <foo xmlns="https://z0" xml:id="23"> <bar xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">data</bar> </foo> |
Example 36 <n0:foo xmlns:n0="https://z0" xml:id="23"> <n0:bar xmlns:n1="https://www.w3.org/2001/XMLSchema-instance" n1:type="xsd:string">data</n0:bar> </n0:foo> |
After c14n with QNameAware | After c14n with QNameAware and PrefixRewrite | |
Example 37 <foo xmlns="https://z0" xml:id="23"> <bar xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">data</bar> </foo> |
Example 38 <n0:foo xmlns:n0="https://z0" xml:id="23"> <n0:bar xmlns:n1="https://www.w3.org/2001/XMLSchema" xmlns:n2="https://www.w3.org/2001/XMLSchema-instance" n2:type="n1:string">data</n0:bar> </n0:foo> |
3.7 Prefixes in Element content
Notice the following things in the default canonicalization ("After c14n"):
- It does not consider the "xsd", "soap-env" and "b" prefixes as visibly utilized since they are embedded in the content. That is why it removes these namespace declarations completely.
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar>"):
- It considers the "xsd", as visbily utilized in element, but not "soap-env" and "b" prefixes as visibly utilized since they are embedded in the XPath content.
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath>"):
- All three embedded prefixes "xsd", "soap-env" and "b" prefixes as considered as visibly utilized.
- prefix "c" is not considered visibly utilized since it is inside an XPath sring. Single and double quoted strings inside an XPath expression are not searched for prefixes.
- "child:" is not a prefix, it is an XPath axis, as indicated by the double colon.
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath> and PrefixRewrite"):
- All three embedded prefixes "xsd", "soap-env" and "b" prefixes as considered as visibly utilized. They are rewritten to "n1", "n3" and "n2" respectively.
- The text content is modified because of prefix rewriting.
- Even though the "xsd" prefix is rewritten to "n1", the 'xsd:string' is left unchanged, as it inside a single quoted string.
Original Data | After c14n | After c14n with QNameAware <a:bar> |
---|---|---|
Example 39 <a:foo xmlns:a="https://a" xmlns:b="https://b" xmlns:child="https://c" xmlns:soap-env="https://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="https://www.w3.org/2001/XMLSchema"> <a:bar>xsd:string</a:bar> <dsig2:IncludedXPath xmlns:dsig2="https://www.w3.org/2010/xmldsig2#">/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']</dsig2:IncludedXPath> </a:foo> |
Example 40 <a:foo xmlns:a="https://a"> <a:bar>xsd:string</a:bar> <dsig2:IncludedXPath xmlns:dsig2="https://www.w3.org/2010/xmldsig2#">/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']</dsig2:IncludedXPath> </a:foo> |
Example 41 <a:foo xmlns:a="https://a"> <a:bar xmlns:xsd="https://www.w3.org/2001/XMLSchema">xsd:string</a:bar> <dsig2:IncludedXPath xmlns:dsig2="https://www.w3.org/2010/xmldsig2#">/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']</dsig2:IncludedXPath> </a:foo> |
After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath> | After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath> and PrefixRewrite | |
Example 42 <a:foo xmlns:a="https://a"> <a:bar xmlns:xsd="https://www.w3.org/2001/XMLSchema">xsd:string</a:bar> <dsig2:IncludedXPath xmlns:b="https://b" xmlns:dsig2="https://www.w3.org/2010/xmldsig2#" xmlns:soap-env="https://schemas.xmlsoap.org/wsdl/soap/">/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']</dsig2:IncludedXPath> </a:foo> |
Example 43 <n0:foo xmlns:n0="https://a"> <n0:bar xmlns:n1="https://www.w3.org/2001/XMLSchema">n1:string</n0:bar> <n4:IncludedXPath xmlns:n2="https://b" xmlns:n3="https://schemas.xmlsoap.org/wsdl/soap/" xmlns:n4="https://www.w3.org/2010/xmldsig2#">/n3:body/child::n2:foo[@att1 != "c:val" and @att2 != 'xsd:string']</n4:IncludedXPath> </n0:foo> |
A. References
Dated references below are to the latest known or appropriate edition of the referenced work. The referenced works may be subject to revision, and conformant implementations may follow, and are encouraged to investigate the appropriateness of following, some or all more recent editions or replacements of the works cited. It is in each case implementation-defined which editions are supported.
A.1 Normative references
- [XML-C14N20]
- John Boyer; Glen Marcy; Pratik Datta; Frederick Hirsch. Canonical XML Version 2.0. 11 April 2013. W3C Working Group Note. URL: https://www.w3.org/TR/xml-c14n2/
- [XML10]
- C. M. Sperberg-McQueen et al. Extensible Markup Language (XML) 1.0 (Fifth Edition). 26 November 2008. W3C Recommendation. URL: https://www.w3.org/TR/xml/