You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1313 lines
89 KiB
1313 lines
89 KiB
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<title>Test cases for Canonical XML 2.0</title>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
|
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
table
|
|
{
|
|
border-collapse:collapse;
|
|
}
|
|
|
|
table,th,td
|
|
{
|
|
border:1px solid black;
|
|
}
|
|
td
|
|
{
|
|
vertical-align: top;
|
|
/* width:300px; */
|
|
}
|
|
pre
|
|
{
|
|
width:300px;
|
|
overflow-x: scroll;
|
|
/*
|
|
white-space: pre-wrap;
|
|
white-space: -moz-pre-wrap;
|
|
white-space: -pre-wrap;
|
|
white-space: -o-pre-wrap;
|
|
word-wrap: break-word;
|
|
*/
|
|
}
|
|
</style>
|
|
<style type="text/css">
|
|
/*****************************************************************
|
|
* ReSpec CSS
|
|
* Robin Berjon (robin at berjon dot com)
|
|
* v0.05 - 2009-07-31
|
|
*****************************************************************/
|
|
|
|
|
|
/* --- INLINES --- */
|
|
em.rfc2119 {
|
|
text-transform: lowercase;
|
|
font-variant: small-caps;
|
|
font-style: normal;
|
|
color: #900;
|
|
}
|
|
|
|
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
|
|
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
|
|
border: none;
|
|
}
|
|
|
|
dfn {
|
|
font-weight: bold;
|
|
}
|
|
|
|
a.internalDFN {
|
|
color: inherit;
|
|
border-bottom: 1px solid #99c;
|
|
text-decoration: none;
|
|
}
|
|
|
|
a.externalDFN {
|
|
color: inherit;
|
|
border-bottom: 1px dotted #ccc;
|
|
text-decoration: none;
|
|
}
|
|
|
|
a.bibref {
|
|
text-decoration: none;
|
|
}
|
|
|
|
code {
|
|
color: #ff4500;
|
|
}
|
|
|
|
|
|
/* --- WEB IDL --- */
|
|
pre.idl {
|
|
border-top: 1px solid #90b8de;
|
|
border-bottom: 1px solid #90b8de;
|
|
padding: 1em;
|
|
line-height: 120%;
|
|
}
|
|
|
|
pre.idl::before {
|
|
content: "WebIDL";
|
|
display: block;
|
|
width: 150px;
|
|
background: #90b8de;
|
|
color: #fff;
|
|
font-family: initial;
|
|
padding: 3px;
|
|
font-weight: bold;
|
|
margin: -1em 0 1em -1em;
|
|
}
|
|
|
|
.idlType {
|
|
color: #ff4500;
|
|
font-weight: bold;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/*.idlModule*/
|
|
/*.idlModuleID*/
|
|
/*.idlInterface*/
|
|
.idlInterfaceID, .idlDictionaryID {
|
|
font-weight: bold;
|
|
color: #005a9c;
|
|
}
|
|
|
|
.idlSuperclass {
|
|
font-style: italic;
|
|
color: #005a9c;
|
|
}
|
|
|
|
/*.idlAttribute*/
|
|
.idlAttrType, .idlFieldType, .idlMemberType {
|
|
color: #005a9c;
|
|
}
|
|
.idlAttrName, .idlFieldName, .idlMemberName {
|
|
color: #ff4500;
|
|
}
|
|
.idlAttrName a, .idlFieldName a, .idlMemberName a {
|
|
color: #ff4500;
|
|
border-bottom: 1px dotted #ff4500;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/*.idlMethod*/
|
|
.idlMethType {
|
|
color: #005a9c;
|
|
}
|
|
.idlMethName {
|
|
color: #ff4500;
|
|
}
|
|
.idlMethName a {
|
|
color: #ff4500;
|
|
border-bottom: 1px dotted #ff4500;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/*.idlParam*/
|
|
.idlParamType {
|
|
color: #005a9c;
|
|
}
|
|
.idlParamName {
|
|
font-style: italic;
|
|
}
|
|
|
|
.extAttr {
|
|
color: #666;
|
|
}
|
|
|
|
/*.idlConst*/
|
|
.idlConstType {
|
|
color: #005a9c;
|
|
}
|
|
.idlConstName {
|
|
color: #ff4500;
|
|
}
|
|
.idlConstName a {
|
|
color: #ff4500;
|
|
border-bottom: 1px dotted #ff4500;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/*.idlException*/
|
|
.idlExceptionID {
|
|
font-weight: bold;
|
|
color: #c00;
|
|
}
|
|
|
|
.idlTypedefID, .idlTypedefType {
|
|
color: #005a9c;
|
|
}
|
|
|
|
.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
|
|
color: #c00;
|
|
font-weight: normal;
|
|
}
|
|
|
|
.excName a {
|
|
font-family: monospace;
|
|
}
|
|
|
|
.idlRaises a.idlType, .excName a.idlType {
|
|
border-bottom: 1px dotted #c00;
|
|
}
|
|
|
|
.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
|
|
width: 45px;
|
|
text-align: center;
|
|
}
|
|
.excGetSetTrue, .prmNullTrue, .prmOptTrue { color: #0c0; }
|
|
.excGetSetFalse, .prmNullFalse, .prmOptFalse { color: #c00; }
|
|
|
|
.idlImplements a {
|
|
font-weight: bold;
|
|
}
|
|
|
|
dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
|
|
margin-left: 2em;
|
|
}
|
|
|
|
.attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
|
|
font-weight: normal;
|
|
}
|
|
|
|
.attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
|
|
font-weight: bold;
|
|
color: #000;
|
|
font-family: monospace;
|
|
}
|
|
|
|
.attributes dt code, .fields dt code, .dictionary-members dt code {
|
|
background: #ffffd2;
|
|
}
|
|
|
|
.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
|
|
color: #005a9c;
|
|
background: transparent;
|
|
font-family: inherit;
|
|
font-weight: normal;
|
|
font-style: italic;
|
|
}
|
|
|
|
.methods dt code {
|
|
background: #d9e6f8;
|
|
}
|
|
|
|
.constants dt code {
|
|
background: #ddffd2;
|
|
}
|
|
|
|
.attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
table.parameters, table.exceptions {
|
|
border-spacing: 0;
|
|
border-collapse: collapse;
|
|
margin: 0.5em 0;
|
|
width: 100%;
|
|
}
|
|
table.parameters { border-bottom: 1px solid #90b8de; }
|
|
table.exceptions { border-bottom: 1px solid #deb890; }
|
|
|
|
.parameters th, .exceptions th {
|
|
color: #fff;
|
|
padding: 3px 5px;
|
|
text-align: left;
|
|
font-family: initial;
|
|
font-weight: normal;
|
|
text-shadow: #666 1px 1px 0;
|
|
}
|
|
.parameters th { background: #90b8de; }
|
|
.exceptions th { background: #deb890; }
|
|
|
|
.parameters td, .exceptions td {
|
|
padding: 3px 10px;
|
|
border-top: 1px solid #ddd;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.parameters tr:first-child td, .exceptions tr:first-child td {
|
|
border-top: none;
|
|
}
|
|
|
|
.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
|
|
width: 100px;
|
|
}
|
|
|
|
.parameters td.prmType {
|
|
width: 120px;
|
|
}
|
|
|
|
table.exceptions table {
|
|
border-spacing: 0;
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
|
|
/* --- TOC --- */
|
|
.toc a {
|
|
text-decoration: none;
|
|
}
|
|
|
|
a .secno {
|
|
color: #000;
|
|
}
|
|
|
|
/* --- TABLE --- */
|
|
table.simple {
|
|
border-spacing: 0;
|
|
border-collapse: collapse;
|
|
border-bottom: 3px solid #005a9c;
|
|
}
|
|
|
|
.simple th {
|
|
background: #005a9c;
|
|
color: #fff;
|
|
padding: 3px 5px;
|
|
text-align: left;
|
|
}
|
|
|
|
.simple th[scope="row"] {
|
|
background: inherit;
|
|
color: inherit;
|
|
border-top: 1px solid #ddd;
|
|
}
|
|
|
|
.simple td {
|
|
padding: 3px 10px;
|
|
border-top: 1px solid #ddd;
|
|
}
|
|
|
|
.simple tr:nth-child(even) {
|
|
background: #f0f6ff;
|
|
}
|
|
|
|
/* --- DL --- */
|
|
.section dd > p:first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.section dd > p:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.section dd {
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
.section dl.attrs dd, .section dl.eldef dd {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
/* --- EXAMPLES --- */
|
|
pre.example {
|
|
border-top: 1px solid #ff4500;
|
|
border-bottom: 1px solid #ff4500;
|
|
padding: 1em;
|
|
margin-top: 1em;
|
|
}
|
|
|
|
pre.example::before {
|
|
content: "Example";
|
|
display: block;
|
|
width: 150px;
|
|
background: #ff4500;
|
|
color: #fff;
|
|
font-family: initial;
|
|
padding: 3px;
|
|
font-weight: bold;
|
|
margin: -1em 0 1em -1em;
|
|
}
|
|
|
|
/* --- EDITORIAL NOTES --- */
|
|
.issue {
|
|
padding: 1em;
|
|
margin: 1em 0em 0em;
|
|
border: 1px solid #f00;
|
|
background: #ffc;
|
|
}
|
|
|
|
.issue::before {
|
|
content: "Issue";
|
|
display: block;
|
|
width: 150px;
|
|
margin: -1.5em 0 0.5em 0;
|
|
font-weight: bold;
|
|
border: 1px solid #f00;
|
|
background: #fff;
|
|
padding: 3px 1em;
|
|
}
|
|
|
|
.note {
|
|
margin: 1em 0em 0em;
|
|
padding: 1em;
|
|
border: 2px solid #cff6d9;
|
|
background: #e2fff0;
|
|
}
|
|
|
|
.note::before {
|
|
content: "Note";
|
|
display: block;
|
|
width: 150px;
|
|
margin: -1.5em 0 0.5em 0;
|
|
font-weight: bold;
|
|
border: 1px solid #cff6d9;
|
|
background: #fff;
|
|
padding: 3px 1em;
|
|
}
|
|
|
|
/* --- Best Practices --- */
|
|
div.practice {
|
|
border: solid #bebebe 1px;
|
|
margin: 2em 1em 1em 2em;
|
|
}
|
|
|
|
span.practicelab {
|
|
margin: 1.5em 0.5em 1em 1em;
|
|
font-weight: bold;
|
|
font-style: italic;
|
|
}
|
|
|
|
span.practicelab { background: #dfffff; }
|
|
|
|
span.practicelab {
|
|
position: relative;
|
|
padding: 0 0.5em;
|
|
top: -1.5em;
|
|
}
|
|
|
|
p.practicedesc {
|
|
margin: 1.5em 0.5em 1em 1em;
|
|
}
|
|
|
|
@media screen {
|
|
p.practicedesc {
|
|
position: relative;
|
|
top: -2em;
|
|
padding: 0;
|
|
margin: 1.5em 0.5em -1em 1em;
|
|
}
|
|
}
|
|
|
|
/* --- SYNTAX HIGHLIGHTING --- */
|
|
pre.sh_sourceCode {
|
|
background-color: white;
|
|
color: black;
|
|
font-style: normal;
|
|
font-weight: normal;
|
|
}
|
|
|
|
pre.sh_sourceCode .sh_keyword { color: #005a9c; font-weight: bold; } /* language keywords */
|
|
pre.sh_sourceCode .sh_type { color: #666; } /* basic types */
|
|
pre.sh_sourceCode .sh_usertype { color: teal; } /* user defined types */
|
|
pre.sh_sourceCode .sh_string { color: red; font-family: monospace; } /* strings and chars */
|
|
pre.sh_sourceCode .sh_regexp { color: orange; font-family: monospace; } /* regular expressions */
|
|
pre.sh_sourceCode .sh_specialchar { color: #ffc0cb; font-family: monospace; } /* e.g., \n, \t, \\ */
|
|
pre.sh_sourceCode .sh_comment { color: #A52A2A; font-style: italic; } /* comments */
|
|
pre.sh_sourceCode .sh_number { color: purple; } /* literal numbers */
|
|
pre.sh_sourceCode .sh_preproc { color: #00008B; font-weight: bold; } /* e.g., #include, import */
|
|
pre.sh_sourceCode .sh_symbol { color: blue; } /* e.g., *, + */
|
|
pre.sh_sourceCode .sh_function { color: black; font-weight: bold; } /* function calls and declarations */
|
|
pre.sh_sourceCode .sh_cbracket { color: red; } /* block brackets (e.g., {, }) */
|
|
pre.sh_sourceCode .sh_todo { font-weight: bold; background-color: #00FFFF; } /* TODO and FIXME */
|
|
|
|
/* Predefined variables and functions (for instance glsl) */
|
|
pre.sh_sourceCode .sh_predef_var { color: #00008B; }
|
|
pre.sh_sourceCode .sh_predef_func { color: #00008B; font-weight: bold; }
|
|
|
|
/* for OOP */
|
|
pre.sh_sourceCode .sh_classname { color: teal; }
|
|
|
|
/* line numbers (not yet implemented) */
|
|
pre.sh_sourceCode .sh_linenum { display: none; }
|
|
|
|
/* Internet related */
|
|
pre.sh_sourceCode .sh_url { color: blue; text-decoration: underline; font-family: monospace; }
|
|
|
|
/* for ChangeLog and Log files */
|
|
pre.sh_sourceCode .sh_date { color: blue; font-weight: bold; }
|
|
pre.sh_sourceCode .sh_time, pre.sh_sourceCode .sh_file { color: #00008B; font-weight: bold; }
|
|
pre.sh_sourceCode .sh_ip, pre.sh_sourceCode .sh_name { color: #006400; }
|
|
|
|
/* for Prolog, Perl... */
|
|
pre.sh_sourceCode .sh_variable { color: #006400; }
|
|
|
|
/* for LaTeX */
|
|
pre.sh_sourceCode .sh_italics { color: #006400; font-style: italic; }
|
|
pre.sh_sourceCode .sh_bold { color: #006400; font-weight: bold; }
|
|
pre.sh_sourceCode .sh_underline { color: #006400; text-decoration: underline; }
|
|
pre.sh_sourceCode .sh_fixed { color: green; font-family: monospace; }
|
|
pre.sh_sourceCode .sh_argument { color: #006400; }
|
|
pre.sh_sourceCode .sh_optionalargument { color: purple; }
|
|
pre.sh_sourceCode .sh_math { color: orange; }
|
|
pre.sh_sourceCode .sh_bibtex { color: blue; }
|
|
|
|
/* for diffs */
|
|
pre.sh_sourceCode .sh_oldfile { color: orange; }
|
|
pre.sh_sourceCode .sh_newfile { color: #006400; }
|
|
pre.sh_sourceCode .sh_difflines { color: blue; }
|
|
|
|
/* for css */
|
|
pre.sh_sourceCode .sh_selector { color: purple; }
|
|
pre.sh_sourceCode .sh_property { color: blue; }
|
|
pre.sh_sourceCode .sh_value { color: #006400; font-style: italic; }
|
|
|
|
/* other */
|
|
pre.sh_sourceCode .sh_section { color: black; font-weight: bold; }
|
|
pre.sh_sourceCode .sh_paren { color: red; }
|
|
pre.sh_sourceCode .sh_attribute { color: #006400; }
|
|
|
|
</style><link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css" charset="utf-8"></head><body style="display: inherit; "><div class="head"><p><a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a></p><h1 class="title" id="title">Test cases for Canonical XML 2.0</h1><h2 id="w3c-working-draft-05-january-2012"><acronym title="World Wide Web Consortium">W3C</acronym> Working Draft 05 January 2012</h2><dl><dt>This version:</dt><dd><a href="http://www.w3.org/TR/2012/WD-xml-c14n2-testcases-20120105/">http://www.w3.org/TR/2012/WD-xml-c14n2-testcases-20120105/</a></dd><dt>Latest published version:</dt><dd><a href="http://www.w3.org/TR/xml-c14n2-testcases/">http://www.w3.org/TR/xml-c14n2-testcases/</a></dd><dt>Latest editor's draft:</dt><dd><a href="http://www.w3.org/2008/xmlsec/Drafts/c14n-20/test-cases/">http://www.w3.org/2008/xmlsec/Drafts/c14n-20/test-cases/</a></dd><dt>Editors:</dt><dd><span>Pratik Datta</span>, <span class="ed_mailto"><a href="mailto:pratik.datta@oracle.com">pratik.datta@oracle.com</a></span> </dd>
|
|
<dd><span>Frederick Hirsch</span>, <span class="ed_mailto"><a href="mailto:frederick.hirsch@nokia.com">frederick.hirsch@nokia.com</a></span> </dd>
|
|
</dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <acronym title="World Wide Web Consortium">W3C</acronym> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p><hr></div>
|
|
<div id="abstract" class="introductory section"><h2>Abstract</h2>
|
|
This document outlines test cases for Canonical XML 2.0 [<cite><a class="bibref" rel="biblioentry" href="#bib-XML-C14N20">XML-C14N20</a></cite>].
|
|
</div><div id="sotd" class="introductory section"><h2>Status of This Document</h2><p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <acronym title="World Wide Web Consortium">W3C</acronym> publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><acronym title="World Wide Web Consortium">W3C</acronym> technical reports index</a> at http://www.w3.org/TR/.</em></p>
|
|
<p>
|
|
This document outlines test cases for Canonical XML 2.0
|
|
[<cite><a class="bibref" rel="biblioentry" href="#bib-XML-C14N20">XML-C14N20</a></cite>] and is intended to become a <acronym title="World Wide Web Consortium">W3C</acronym> Note.
|
|
</p>
|
|
<p>This document was published by the <a href="http://www.w3.org/2008/xmlsec/">XML Security Working Group</a> as a First Public Working Draft. If you wish to make comments regarding this document, please send them to <a href="mailto:public-xmlsec@w3.org">public-xmlsec@w3.org</a> (<a href="mailto:public-xmlsec-request@w3.org?subject=subscribe">subscribe</a>, <a href="http://lists.w3.org/Archives/Public/public-xmlsec/">archives</a>). All feedback is welcome.</p><p>Publication as a Working Draft does not imply endorsement by the <acronym title="World Wide Web Consortium">W3C</acronym> 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.</p><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>. The group does not expect this document to become a <acronym title="World Wide Web Consortium">W3C</acronym> Recommendation. <acronym title="World Wide Web Consortium">W3C</acronym> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42458/status" rel="disclosure">public list of any patent disclosures</a> 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 <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.</p></div><div id="toc" class="section"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#sec-Introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#sec-Canonical11" class="tocxref"><span class="secno">2. </span>Examples from Canonical XML 1.0</a><ul class="toc"><li class="tocline"><a href="#sec-Example-OutsideDoc" class="tocxref"><span class="secno">2.1 </span>PIs, Comments, and Outside of Document Element</a></li><li class="tocline"><a href="#sec-Example-WhitespaceInContent" class="tocxref"><span class="secno">2.2 </span>Whitespace in Document Content</a></li><li class="tocline"><a href="#sec-Example-SETags" class="tocxref"><span class="secno">2.3 </span>Start and End Tags</a></li><li class="tocline"><a href="#sec-Example-Chars" class="tocxref"><span class="secno">2.4 </span>Character Modifications and Character References</a></li><li class="tocline"><a href="#sec-Example-Entities" class="tocxref"><span class="secno">2.5 </span>Entity References</a></li><li class="tocline"><a href="#sec-Example-UTF8" class="tocxref"><span class="secno">2.6 </span>UTF-8 Encoding</a></li></ul></li><li class="tocline"><a href="#sec-Namespace" class="tocxref"><span class="secno">3. </span>Dealing with Namespaces</a><ul class="toc"><li class="tocline"><a href="#sec-PushDown" class="tocxref"><span class="secno">3.1 </span>Namespaces declarations are pushed down</a></li><li class="tocline"><a href="#sec-Default" class="tocxref"><span class="secno">3.2 </span>Default namespace declarations</a></li><li class="tocline"><a href="#sec-Sort" class="tocxref"><span class="secno">3.3 </span>Sorting namespace declarations</a></li><li class="tocline"><a href="#sec-Redecl" class="tocxref"><span class="secno">3.4 </span>Namespace Re-declarations</a></li><li class="tocline"><a href="#sec-Superfluous" class="tocxref"><span class="secno">3.5 </span>Superfluous Namespace declarations</a></li><li class="tocline"><a href="#sec-xmlattribs" class="tocxref"><span class="secno">3.6 </span>Special namespaces "xml", "xsi", "xsd"</a></li><li class="tocline"><a href="#sec-PrefixesInContent" class="tocxref"><span class="secno">3.7 </span>Prefixes in Element content</a></li></ul></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></div>
|
|
|
|
<div id="sec-Introduction" class="section">
|
|
<!--OddPage--><h2><span class="secno">1. </span>Introduction</h2>
|
|
This document has various test cases for Canonical XML 2.0
|
|
[<cite><a class="bibref" rel="biblioentry" href="#bib-XML-C14N20">XML-C14N20</a></cite>]. All the test files are available in this directory: <a href="files/">files</a>.
|
|
<br>
|
|
The test cases are organized as follows:
|
|
<ul>
|
|
<li><b>Input file</b> All the input files are named starting with "in".
|
|
e.g. <a href="files/inNsPushdown.xml"><code>inNsPushdown.xml</code></a>.</li>
|
|
<li><b>C14N parameter files</b>The C14n parameters files contain
|
|
a <code><CanonicalizationMethod></code> element containing
|
|
canonicalization parameters.
|
|
<ul>
|
|
<li><a href="files/c14nDefault.xml"><code>c14nDefault.xml</code></a>: Default canonicalization.</li>
|
|
<li><a href="files/c14nComment.xml"><code>c14nComment.xml</code></a>: Canonicalization with comment removal.</li>
|
|
<li><a href="files/c14nPrefix.xml"><code>c14nPrefix.xml</code></a>: Canonicalization with prefix rewriting.</li>
|
|
<li><a href="files/c14nPrefixQname.xml"><code>c14nPrefixQName.xml</code></a>: Canonicalization with prefix rewriting
|
|
and a Qname aware attribute <code>xsi:type</code>.</li>
|
|
<li><a href="files/c14nQname.xml"><code>c14nQname.xml</code></a>: Canonicalization with
|
|
a Qname aware attribute <code>xsi:type</code>, but not prefix rewriting.</li>
|
|
<li><a href="files/c14nQnameElem.xml"><code>c14nQnameElem.xml</code></a>: Canonicalization with a
|
|
Qname aware element <code><a:bar></code>, but not prefix rewriting.</li>
|
|
<li><a href="files/c14nQnameXpathElem.xml"><code>c14nQnameXpathElem.xml</code></a>: Canonicalization with a
|
|
Qname aware element <code><a:bar></code>, and Qname aware XPath element
|
|
<code><dsig2:IncludedXPath></code>, but not prefix rewriting.</li>
|
|
<li><a href="files/c14nPrefixQnameXpathElem.xml"><code>c14nPrefixQnameXpathElem.xml</code></a>: Canonicalization with
|
|
prefix rewriting and a
|
|
Qname aware element <code><a:bar></code>, and Qname aware XPath element <code><dsig2:IncludedXPath></code>.</li>
|
|
</ul>
|
|
</li>
|
|
<li><b>Output files</b> 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. <a href="files/out_inNsPushdown_c14nDefault.xml"><code>out_inNsPushdown_c14nDefault.xml </code></a>. </li>
|
|
</ul>
|
|
|
|
In the tables below the file contents are embedded in the table, but you can download the actual file by
|
|
clicking on the hyperlink on the table header.
|
|
|
|
</div>
|
|
|
|
<div id="sec-Canonical11" class="section">
|
|
<!--OddPage--><h2><span class="secno">2. </span>Examples from Canonical XML 1.0</h2>
|
|
|
|
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).
|
|
|
|
<div id="sec-Example-OutsideDoc" class="section">
|
|
<h3><span class="secno">2.1 </span>PIs, Comments, and Outside of Document Element</h3>
|
|
<b>Demonstrates:</b><br>
|
|
<ul>
|
|
<li>Loss of XML declaration <code><?xml version="1.0"?></code></li>
|
|
<li>Loss of DTD <code><!DOCTYPE doc SYSTEM "doc.dtd"> </code></li>
|
|
<li>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)</li>
|
|
<li>Loss of whitespace between PITarget and its data</li>
|
|
<li>Retention of whitespace inside PI data</li>
|
|
<li>Comment removal from uncommented canonical form, including delimiter
|
|
for comments outside document element (the last character in both
|
|
canonical forms is '>')</li>
|
|
</ul>
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N1.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N1_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inC14N1_c14nComment.xml">After c14n with Comments</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><?xml</span> <span class="sh_type">version</span><span class="sh_symbol">=</span><span class="sh_string">"1.0"</span><span class="sh_preproc">?></span>
|
|
|
|
<span class="sh_preproc"><?xml</span><span class="sh_type">-stylesheet</span><span class="sh_normal"> </span><span class="sh_type">href</span><span class="sh_symbol">=</span><span class="sh_string">"doc.xsl"</span>
|
|
<span class="sh_type">type</span><span class="sh_symbol">=</span><span class="sh_string">"text/xsl"</span> <span class="sh_preproc">?></span>
|
|
|
|
<span class="sh_preproc"><!DOCTYPE</span> <span class="sh_type">doc</span><span class="sh_normal"> </span><span class="sh_type">SYSTEM</span><span class="sh_normal"> </span><span class="sh_string">"doc.dtd"</span><span class="sh_preproc">></span>
|
|
|
|
<span class="sh_keyword"><doc></span>Hello, world!<span class="sh_comment"><!-- Comment 1 --></span><span class="sh_keyword"></doc></span>
|
|
|
|
<?pi-without-data ?>
|
|
|
|
<span class="sh_comment"><!-- Comment 2 --></span>
|
|
|
|
<span class="sh_comment"><!-- Comment 3 --></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><?xml</span><span class="sh_type">-stylesheet</span><span class="sh_normal"> </span><span class="sh_type">href</span><span class="sh_symbol">=</span><span class="sh_string">"doc.xsl"</span>
|
|
<span class="sh_type">type</span><span class="sh_symbol">=</span><span class="sh_string">"text/xsl"</span> <span class="sh_preproc">?></span>
|
|
<span class="sh_keyword"><doc></span>Hello, world!<span class="sh_keyword"></doc></span>
|
|
<?pi-without-data?></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><?xml</span><span class="sh_type">-stylesheet</span><span class="sh_normal"> </span><span class="sh_type">href</span><span class="sh_symbol">=</span><span class="sh_string">"doc.xsl"</span>
|
|
<span class="sh_type">type</span><span class="sh_symbol">=</span><span class="sh_string">"text/xsl"</span> <span class="sh_preproc">?></span>
|
|
<span class="sh_keyword"><doc></span>Hello, world!<span class="sh_comment"><!-- Comment 1 --></span><span class="sh_keyword"></doc></span>
|
|
<?pi-without-data?>
|
|
<span class="sh_comment"><!-- Comment 2 --></span>
|
|
<span class="sh_comment"><!-- Comment 3 --></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-Example-WhitespaceInContent" class="section">
|
|
<h3><span class="secno">2.2 </span>Whitespace in Document Content</h3>
|
|
<b>"After c14n" Demonstrates:</b><br>
|
|
<ul>
|
|
<li>Retain all whitespace between consecutive start tags, clean or
|
|
dirty</li>
|
|
<li>Retain all whitespace between consecutive end tags, clean or dirty</li>
|
|
<li>Retain all whitespace between end tag/start tag pair, clean or
|
|
dirty</li>
|
|
<li>Retain all whitespace in character content, clean or dirty</li>
|
|
</ul>
|
|
|
|
|
|
<p><b>Note:</b> For "After c14n", the input document and canonical
|
|
form are identical. Both end with '>' character.</p>
|
|
|
|
<b>"After c14n with Trim whitespace" Demonstrates:</b><br>
|
|
<ul>
|
|
<li>Retain white space inside text, i.e. inbetween <code>A</code> and <code>B</code> but remove
|
|
all leading and trailing whitespace </li>
|
|
</ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N2.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N2_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inC14N2_c14nTrim.xml">After c14n with Trim whitespace</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><clean></span> <span class="sh_keyword"></clean></span>
|
|
<span class="sh_keyword"><dirty></span> A B <span class="sh_keyword"></dirty></span>
|
|
<span class="sh_keyword"><mixed></span>
|
|
A
|
|
<span class="sh_keyword"><clean></span> <span class="sh_keyword"></clean></span>
|
|
B
|
|
<span class="sh_keyword"><dirty></span> A B <span class="sh_keyword"></dirty></span>
|
|
C
|
|
<span class="sh_keyword"></mixed></span>
|
|
<span class="sh_keyword"></doc></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><clean></span> <span class="sh_keyword"></clean></span>
|
|
<span class="sh_keyword"><dirty></span> A B <span class="sh_keyword"></dirty></span>
|
|
<span class="sh_keyword"><mixed></span>
|
|
A
|
|
<span class="sh_keyword"><clean></span> <span class="sh_keyword"></clean></span>
|
|
B
|
|
<span class="sh_keyword"><dirty></span> A B <span class="sh_keyword"></dirty></span>
|
|
C
|
|
<span class="sh_keyword"></mixed></span>
|
|
<span class="sh_keyword"></doc></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc><clean></clean><dirty></span>A B<span class="sh_keyword"></dirty><mixed></span>A<span class="sh_keyword"><clean></clean></span>B<span class="sh_keyword"><dirty></span>A B<span class="sh_keyword"></dirty></span>C<span class="sh_keyword"></mixed></doc></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-Example-SETags" class="section">
|
|
<h3><span class="secno">2.3 </span>Start and End Tags</h3>
|
|
|
|
<b>"After c14n" Demonstrates:</b>
|
|
<ul>
|
|
<li>Empty element conversion to start-end tag pair.
|
|
I.e. <code><e1 /></code> becomes <code><e1></e1></code></li>
|
|
<li>Normalization of whitespace in start and end tags.
|
|
I.e.. <code><e2 ></e2></code> becomes <code><e2></e2></code></li>
|
|
<li>Relative order of namespace and attribute axes,
|
|
I.e. in <code><e5></code> the namespace declarations precede the attribute declarations.</li>
|
|
<li>Lexicographic ordering of namespace and attribute axes</li>
|
|
<li>Retention of namespace prefixes from original document</li>
|
|
<li>Elimination of superfluous namespace declarations</li>
|
|
<li>Addition of default attribute. I.e. <code><e9 attr="default"></code>. </li>
|
|
</ul>
|
|
|
|
<p><b>Note:</b> Some start tags in the canonical form are very
|
|
long, but each start tag in this example is entirely on a single line.</p>
|
|
|
|
<p><b>Note:</b> In <code>e5</code>, <code>b:attr</code> precedes
|
|
<code>a:attr</code> because the primary key is namespace URI not namespace
|
|
prefix, and <code>attr2</code> precedes <code>b:attr</code> because
|
|
the default namespace is not applied to unqualified attributes (so
|
|
the namespace URI for <code>attr2</code> is empty).</p>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N3.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N3_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inC14N3_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><!DOCTYPE</span> <span class="sh_type">doc</span><span class="sh_normal"> </span><span class="sh_type">[<!ATTLIST</span><span class="sh_normal"> </span><span class="sh_type">e9</span><span class="sh_normal"> </span><span class="sh_type">attr</span><span class="sh_normal"> </span><span class="sh_type">CDATA</span><span class="sh_normal"> </span><span class="sh_string">"default"</span><span class="sh_preproc">></span>]>
|
|
<span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><e1</span> <span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"><e2</span> <span class="sh_keyword">></e2></span>
|
|
<span class="sh_keyword"><e3</span> <span class="sh_type">name</span><span class="sh_normal"> </span><span class="sh_symbol">=</span> <span class="sh_string">"elem3"</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span> <span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"><e4</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span> <span class="sh_keyword">></e4></span>
|
|
<span class="sh_keyword"><e5</span> <span class="sh_type">a:attr</span><span class="sh_symbol">=</span><span class="sh_string">"out"</span> <span class="sh_type">b:attr</span><span class="sh_symbol">=</span><span class="sh_string">"sorted"</span> <span class="sh_type">attr2</span><span class="sh_symbol">=</span><span class="sh_string">"all"</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"I'm"</span>
|
|
<span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span>
|
|
<span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span>
|
|
<span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://example.org"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"><e6</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">""</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><e7</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><e8</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">""</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><e9</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">""</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></e8></span>
|
|
<span class="sh_keyword"></e7></span>
|
|
<span class="sh_keyword"></e6></span>
|
|
<span class="sh_keyword"></doc></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><e1></e1></span>
|
|
<span class="sh_keyword"><e2></e2></span>
|
|
<span class="sh_keyword"><e3</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span><span class="sh_keyword">></e3></span>
|
|
<span class="sh_keyword"><e4</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span><span class="sh_keyword">></e4></span>
|
|
<span class="sh_keyword"><e5</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://example.org"</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"I'm"</span> <span class="sh_type">attr2</span><span class="sh_symbol">=</span><span class="sh_string">"all"</span> <span class="sh_type">b:attr</span><span class="sh_symbol">=</span><span class="sh_string">"sorted"</span> <span class="sh_type">a:attr</span><span class="sh_symbol">=</span><span class="sh_string">"out"</span><span class="sh_keyword">></e5></span>
|
|
<span class="sh_keyword"><e6></span>
|
|
<span class="sh_keyword"><e7</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><e8</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">""</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><e9</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"default"</span><span class="sh_keyword">></e9></span>
|
|
<span class="sh_keyword"></e8></span>
|
|
<span class="sh_keyword"></e7></span>
|
|
<span class="sh_keyword"></e6></span>
|
|
<span class="sh_keyword"></doc></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:doc</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">""</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:e1></n0:e1></span>
|
|
<span class="sh_keyword"><n0:e2></n0:e2></span>
|
|
<span class="sh_keyword"><n0:e3</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span><span class="sh_keyword">></n0:e3></span>
|
|
<span class="sh_keyword"><n0:e4</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span><span class="sh_keyword">></n0:e4></span>
|
|
<span class="sh_keyword"><n1:e5</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://example.org"</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span> <span class="sh_type">xmlns:n3</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"I'm"</span> <span class="sh_type">attr2</span><span class="sh_symbol">=</span><span class="sh_string">"all"</span> <span class="sh_type">n2:attr</span><span class="sh_symbol">=</span><span class="sh_string">"sorted"</span> <span class="sh_type">n3:attr</span><span class="sh_symbol">=</span><span class="sh_string">"out"</span><span class="sh_keyword">></n1:e5></span>
|
|
<span class="sh_keyword"><n0:e6></span>
|
|
<span class="sh_keyword"><n2:e7</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:e8></span>
|
|
<span class="sh_keyword"><n0:e9</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"default"</span><span class="sh_keyword">></n0:e9></span>
|
|
<span class="sh_keyword"></n0:e8></span>
|
|
<span class="sh_keyword"></n2:e7></span>
|
|
<span class="sh_keyword"></n0:e6></span>
|
|
<span class="sh_keyword"></n0:doc></span></pre></td>
|
|
</tr>
|
|
<tr>
|
|
<th></th>
|
|
<th><a href="files/out_inC14N3_c14nTrim.xml">After c14n with Trim whitespace</a></th>
|
|
<th></th>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc><e1></e1><e2></e2><e3</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem3"</span><span class="sh_keyword">></e3><e4</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span> <span class="sh_type">name</span><span class="sh_symbol">=</span><span class="sh_string">"elem4"</span><span class="sh_keyword">></e4><e5</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://example.org"</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"I'm"</span> <span class="sh_type">attr2</span><span class="sh_symbol">=</span><span class="sh_string">"all"</span> <span class="sh_type">b:attr</span><span class="sh_symbol">=</span><span class="sh_string">"sorted"</span> <span class="sh_type">a:attr</span><span class="sh_symbol">=</span><span class="sh_string">"out"</span><span class="sh_keyword">></e5><e6><e7</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.ietf.org"</span><span class="sh_keyword">><e8</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">""</span><span class="sh_keyword">><e9</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"default"</span><span class="sh_keyword">></e9></e8></e7></e6></doc></span></pre></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
|
|
<div id="sec-Example-Chars" class="section">
|
|
<h3><span class="secno">2.4 </span>Character Modifications and Character References</h3>
|
|
|
|
<b>Demonstrates:</b>
|
|
<ul>
|
|
<li>Character reference replacement</li>
|
|
<li>Attribute value delimiters set to quotation marks (double quotes)</li>
|
|
<li>Attribute value normalization</li>
|
|
<li>CDATA section replacement</li>
|
|
<li>Encoding of special characters as character references in attribute
|
|
values (&amp;, &lt;, &quot;, &#xD;, &#xA;, &#x9;)</li>
|
|
<li>Encoding of special characters as character references in text
|
|
(&amp;, &lt;, &gt;, &#xD;)</li>
|
|
</ul>
|
|
|
|
<p><b>Note:</b> The last element, <code>normId</code>, 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.</p> <p><b>Note:</b> Whitespace character references
|
|
other than &#x20; are not affected by attribute value normalization
|
|
[<cite><a class="bibref" rel="biblioentry" href="#bib-XML10">XML10</a></cite>].</p>
|
|
|
|
<p><b>Note:</b> In the canonical form,
|
|
the value of the attribute named <code>attr</code> in the element
|
|
<code>norm</code> begins with a space, an apostrophe (single quote), then
|
|
<i>four</i> spaces before the first character reference.</p>
|
|
|
|
<p><b>Note:</b> The <code>expr</code> attribute of the second
|
|
<code>compute</code> element contains no line breaks.</p>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N4.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N4_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inC14N4_c14nTrim.xml">After c14n with Trim whitespace</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><!DOCTYPE</span> <span class="sh_type">doc</span><span class="sh_normal"> </span><span class="sh_type">[</span>
|
|
<span class="sh_type"><!ATTLIST</span><span class="sh_normal"> </span><span class="sh_type">normId</span><span class="sh_normal"> </span><span class="sh_type">id</span><span class="sh_normal"> </span><span class="sh_type">ID</span><span class="sh_normal"> </span><span class="sh_type">#IMPLIED</span><span class="sh_preproc">></span>
|
|
<!ATTLIST normNames attr NMTOKENS #IMPLIED>
|
|
]>
|
|
<span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><text></span>First line&#x0d;&#10;Second line<span class="sh_keyword"></text></span>
|
|
<span class="sh_keyword"><value></span>&#x32;<span class="sh_keyword"></value></span>
|
|
<span class="sh_keyword"><compute></span><![CDATA[value>"0" && value<"10" ?"valid":"error"]]><span class="sh_keyword"></compute></span>
|
|
<span class="sh_keyword"><compute</span> <span class="sh_type">expr</span><span class="sh_symbol">=</span><span class="sh_type">'value</span><span class="sh_keyword">></span>"0" <span class="sh_preproc">&amp;&amp;</span> value<span class="sh_preproc">&lt;</span>"10" ?"valid":"error"'>valid<span class="sh_keyword"></compute></span>
|
|
<span class="sh_keyword"><norm</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_type">'</span><span class="sh_normal"> </span><span class="sh_type">&apos;</span><span class="sh_normal"> </span><span class="sh_type">&#x20;&#13;&#xa;&#9;</span><span class="sh_normal"> </span><span class="sh_type">&apos;</span><span class="sh_normal"> </span><span class="sh_type">'/</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><normNames</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_type">'</span><span class="sh_normal"> </span><span class="sh_type">A</span><span class="sh_normal"> </span><span class="sh_type">&#x20;&#13;&#xa;&#9;</span><span class="sh_normal"> </span><span class="sh_type">B</span><span class="sh_normal"> </span><span class="sh_type">'/</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><normId</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_type">'</span><span class="sh_normal"> </span><span class="sh_type">&apos;&#x20;&#13;&#xa;&#9;</span><span class="sh_normal"> </span><span class="sh_type">&apos;</span><span class="sh_normal"> </span><span class="sh_type">'/</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"></doc></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc></span>
|
|
<span class="sh_keyword"><text></span>First line&#xD;
|
|
Second line<span class="sh_keyword"></text></span>
|
|
<span class="sh_keyword"><value></span>2<span class="sh_keyword"></value></span>
|
|
<span class="sh_keyword"><compute></span>value<span class="sh_preproc">&gt;</span>"0" <span class="sh_preproc">&amp;&amp;</span> value<span class="sh_preproc">&lt;</span>"10" ?"valid":"error"<span class="sh_keyword"></compute></span>
|
|
<span class="sh_keyword"><compute</span> <span class="sh_type">expr</span><span class="sh_symbol">=</span><span class="sh_string">"value>&quot;0&quot; &amp;&amp; value&lt;&quot;10&quot; ?&quot;valid&quot;:&quot;error&quot;"</span><span class="sh_keyword">></span>valid<span class="sh_keyword"></compute></span>
|
|
<span class="sh_keyword"><norm</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">" ' &#xD;&#xA;&#x9; ' "</span><span class="sh_keyword">></norm></span>
|
|
<span class="sh_keyword"><normNames</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"A &#xD;&#xA;&#x9; B"</span><span class="sh_keyword">></normNames></span>
|
|
<span class="sh_keyword"><normId</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"' &#xD;&#xA;&#x9; '"</span><span class="sh_keyword">></normId></span>
|
|
<span class="sh_keyword"></doc></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc><text></span>First line&#xD;
|
|
Second line<span class="sh_keyword"></text><value></span>2<span class="sh_keyword"></value><compute></span>value<span class="sh_preproc">&gt;</span>"0" <span class="sh_preproc">&amp;&amp;</span> value<span class="sh_preproc">&lt;</span>"10" ?"valid":"error"<span class="sh_keyword"></compute><compute</span> <span class="sh_type">expr</span><span class="sh_symbol">=</span><span class="sh_string">"value>&quot;0&quot; &amp;&amp; value&lt;&quot;10&quot; ?&quot;valid&quot;:&quot;error&quot;"</span><span class="sh_keyword">></span>valid<span class="sh_keyword"></compute><norm</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">" ' &#xD;&#xA;&#x9; ' "</span><span class="sh_keyword">></norm><normNames</span> <span class="sh_type">attr</span><span class="sh_symbol">=</span><span class="sh_string">"A &#xD;&#xA;&#x9; B"</span><span class="sh_keyword">></normNames><normId</span> <span class="sh_type">id</span><span class="sh_symbol">=</span><span class="sh_string">"' &#xD;&#xA;&#x9; '"</span><span class="sh_keyword">></normId></doc></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
|
|
<div id="sec-Example-Entities" class="section">
|
|
<h3><span class="secno">2.5 </span>Entity References</h3>
|
|
|
|
<b>Demonstrates:</b>
|
|
<ul>
|
|
<li>Internal parsed entity reference replacement</li>
|
|
<li>External parsed entity reference replacement (including whitespace
|
|
outside elements and PIs)</li>
|
|
<li>External unparsed entity reference</li>
|
|
</ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N5.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N5_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inC14N5_c14nTrim.xml">After c14n with Trim whitespace</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><!DOCTYPE</span> <span class="sh_type">doc</span><span class="sh_normal"> </span><span class="sh_type">[</span>
|
|
<span class="sh_type"><!ATTLIST</span><span class="sh_normal"> </span><span class="sh_type">doc</span><span class="sh_normal"> </span><span class="sh_type">attrExtEnt</span><span class="sh_normal"> </span><span class="sh_type">CDATA</span><span class="sh_normal"> </span><span class="sh_type">#IMPLIED</span><span class="sh_preproc">></span>
|
|
<!ENTITY ent1 "Hello">
|
|
<!ENTITY ent2 SYSTEM "world.txt">
|
|
<!ENTITY entExt SYSTEM "earth.gif" NDATA gif>
|
|
<!NOTATION gif SYSTEM "viewgif.exe">
|
|
]>
|
|
<span class="sh_keyword"><doc</span> <span class="sh_type">attrExtEnt</span><span class="sh_symbol">=</span><span class="sh_string">"entExt"</span><span class="sh_keyword">></span>
|
|
<span class="sh_preproc">&ent1;</span>, <span class="sh_preproc">&ent2;</span>!
|
|
<span class="sh_keyword"></doc></span>
|
|
|
|
<span class="sh_comment"><!-- Let world.txt contain "world" (excluding the quotes) --></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc</span> <span class="sh_type">attrExtEnt</span><span class="sh_symbol">=</span><span class="sh_string">"entExt"</span><span class="sh_keyword">></span>
|
|
Hello, world!
|
|
<span class="sh_keyword"></doc></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc</span> <span class="sh_type">attrExtEnt</span><span class="sh_symbol">=</span><span class="sh_string">"entExt"</span><span class="sh_keyword">></span>Hello, world!<span class="sh_keyword"></doc></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
|
|
<div id="sec-Example-UTF8" class="section">
|
|
<h3><span class="secno">2.6 </span>UTF-8 Encoding</h3>
|
|
|
|
<b>Demonstrates:</b>
|
|
<ul>
|
|
<li>Effect of transcoding from a sample encoding to UTF-8</li>
|
|
</ul>
|
|
|
|
<p class="Note"><b>Note:</b> 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 (©).</p>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inC14N6.xml">Original Data</a></th>
|
|
<th><a href="files/out_inC14N6_c14nDefault.xml">After c14n</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_preproc"><?xml</span> <span class="sh_type">version</span><span class="sh_symbol">=</span><span class="sh_string">"1.0"</span> <span class="sh_type">encoding</span><span class="sh_symbol">=</span><span class="sh_string">"ISO-8859-1"</span><span class="sh_preproc">?></span>
|
|
<span class="sh_keyword"><doc></span>&#169;<span class="sh_keyword"></doc></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><doc></span>©<span class="sh_keyword"></doc></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="sec-Namespace" class="section">
|
|
<!--OddPage--><h2><span class="secno">3. </span>Dealing with Namespaces</h2>
|
|
|
|
<div id="sec-PushDown" class="section">
|
|
<h3><span class="secno">3.1 </span>Namespaces declarations are pushed down</h3>
|
|
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.
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsPushdown.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsPushdown_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsPushdown_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">xmlns:c</span><span class="sh_symbol">=</span><span class="sh_string">"http://c"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><b:bar/></span>
|
|
<span class="sh_keyword"><b:bar/></span>
|
|
<span class="sh_keyword"><b:bar/></span>
|
|
<span class="sh_keyword"><a:bar</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></a:foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><b:bar</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></b:bar></span>
|
|
<span class="sh_keyword"><b:bar</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></b:bar></span>
|
|
<span class="sh_keyword"><b:bar</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></b:bar></span>
|
|
<span class="sh_keyword"><a:bar</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">></a:bar></span>
|
|
<span class="sh_keyword"></a:foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n1:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></n1:bar></span>
|
|
<span class="sh_keyword"><n1:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></n1:bar></span>
|
|
<span class="sh_keyword"><n1:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></n1:bar></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">n1:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">></n0:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
|
|
<div id="sec-Default" class="section">
|
|
<h3><span class="secno">3.2 </span>Default namespace declarations</h3>
|
|
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.
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsDefault.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsDefault_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsDefault_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><b:bar</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span> <span class="sh_type">att2</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo></span>
|
|
<span class="sh_keyword"><b:bar</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">att2</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">></b:bar></span>
|
|
<span class="sh_keyword"></foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">""</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n1:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">att2</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span> <span class="sh_type">n1:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val"</span><span class="sh_keyword">></n1:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-Sort" class="section">
|
|
<h3><span class="secno">3.3 </span>Sorting namespace declarations</h3>
|
|
<p>In this example there are four prefixes declarations: "a", "b", "c" and "d".
|
|
They map to namespace URIs "http://z3", "http://z2", "http://z1" and "http://z0" respectively.
|
|
</p>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After
|
|
c14n"):
|
|
</p>
|
|
<ul>
|
|
<li>In "a:foo" all the namespace declarations appear before the attribute declarations, even though
|
|
they were mixed up in the original document.</li>
|
|
<li>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 http://z1 and "b" is http://z2, all the "c" attributes
|
|
appear before "b" attributes. Note that within the "b" attributes "att1"
|
|
appears before "att2". </li>
|
|
<li>In "a:foo" all the namespace declarations are sorted by prefixes
|
|
i.e. "a", "b", "c", and
|
|
NOT by namespace URIs.</li>
|
|
</ul>
|
|
|
|
And notice these things in canonicalization with prefix rewriting ("After c14n with PrefixRewrite"):
|
|
<ul>
|
|
<li>New prefixes are assigned in the order in which they are visibly utilized:
|
|
<ol>
|
|
<li> 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 "http://z1"->"n0", "http://z2"->"n1" and
|
|
"http://z3"->"n2"</li>
|
|
<li>After that "c:bar" visibly utilizes prefix "d". This gets assigned prefix "n3" </li>
|
|
</ol>
|
|
</li>
|
|
<li>In "a:foo" all rewritten prefixes are sorted by prefixes i.e. "n0", "n1", "n2". </li>
|
|
</ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsSort.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsSort_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsSort_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">c:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span> <span class="sh_type">xmlns:c</span><span class="sh_symbol">=</span><span class="sh_string">"http://z1"</span> <span class="sh_type">xmlns:d</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><c:bar/></span>
|
|
<span class="sh_keyword"><c:bar</span> <span class="sh_type">d:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></a:foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">xmlns:c</span><span class="sh_symbol">=</span><span class="sh_string">"http://z1"</span> <span class="sh_type">c:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span> <span class="sh_type">b:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><c:bar></c:bar></span>
|
|
<span class="sh_keyword"><c:bar</span> <span class="sh_type">xmlns:d</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">d:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">></c:bar></span>
|
|
<span class="sh_keyword"></a:foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n2:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://z1"</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">n0:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span> <span class="sh_type">n1:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">n1:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:bar></n0:bar></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">xmlns:n3</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">n3:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">></n0:bar></span>
|
|
<span class="sh_keyword"></n2:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-Redecl" class="section">
|
|
<h3><span class="secno">3.4 </span>Namespace Re-declarations</h3>
|
|
<p>
|
|
In this example there are three prefixes "a", "b" and the default prefix.
|
|
The "foo" element defines them to be "http://z3", "http://z2" and ""
|
|
respectively. But the "bar"
|
|
redeclares these prefixes to "http://z2", "http://z3" abd "http://z0"
|
|
respectively.
|
|
</p>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After
|
|
c14n"):
|
|
</p>
|
|
<ul>
|
|
<li>In "a:foo" all the namespace declarations appear before the attribute declarations, even though
|
|
they were mixed up in the original document.</li>
|
|
<li>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 http://z1 and "b" is http://z2, all the "c" attribute appear before "b" attributes.
|
|
And between the "b" attributes "att1" appears before "att2". </li>
|
|
<li>In "a:foo" all the namespace declarations are sorted by prefixes
|
|
i.e. "a", "b", "c", and
|
|
NOT by namespace URIs.</li>
|
|
</ul>
|
|
|
|
And notice these things in canonicalization with prefix rewriting
|
|
("After c14n with PrefixRewrite"):
|
|
<ul>
|
|
<li>New prefixes are assigned in the order in which they are visibly utilized:
|
|
<ol>
|
|
<li> 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 "http://z1"->"n0", "http://z2"->"n1" and "http://z3"->"n2"</li>
|
|
<li>After that "c:bar" visibly utilizes prefix "d". This gets assigned prefix "n3" </li>
|
|
</ol>
|
|
</li>
|
|
<li>In "a:foo" all rewritten prefixes are sorted by prefixes i.e. "n0", "n1", "n2". </li>
|
|
</ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsRedecl.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsRedecl_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsRedecl_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><bar</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><bar</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></bar></span>
|
|
<span class="sh_keyword"></foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">""</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://z2"</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://z3"</span> <span class="sh_type">n1:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span> <span class="sh_type">n2:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n3:bar</span> <span class="sh_type">xmlns:n3</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">n1:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">n2:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></n3:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-Superfluous" class="section">
|
|
<h3><span class="secno">3.5 </span>Superfluous Namespace declarations</h3>
|
|
<p>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 "http://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.
|
|
</p>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After
|
|
c14n"):
|
|
</p>
|
|
<ul>
|
|
<li>It does not attempt to recognize that "a", "b", "c", "d" and default are pointing to the
|
|
same thing.</li>
|
|
<li>It removes the extra declaration of "xmlns:a" in the "c:bar" as that is superfluous.</li>
|
|
</ul>
|
|
|
|
And notice these things in canonicalization with prefix rewriting ("After c14n with PrefixRewrite"):
|
|
<ul>
|
|
<li>All the file prefixes "a", "b", "c", "d" are rewritten to the same
|
|
prefix - "z0".
|
|
</li></ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsSuperfluous.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsSuperfluous_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsSuperfluous_c14nPrefix.xml">After c14n with PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><c:bar</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:c</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">c:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"><d:bar</span> <span class="sh_type">xmlns:d</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span><span class="sh_keyword">/></span>
|
|
<span class="sh_keyword"></foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">a:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">b:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><c:bar</span> <span class="sh_type">xmlns:c</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">c:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">></c:bar></span>
|
|
<span class="sh_keyword"><d:bar</span> <span class="sh_type">xmlns:d</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span><span class="sh_keyword">></d:bar></span>
|
|
<span class="sh_keyword"></foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">n0:att1</span><span class="sh_symbol">=</span><span class="sh_string">"val1"</span> <span class="sh_type">n0:att2</span><span class="sh_symbol">=</span><span class="sh_string">"val2"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">n0:att3</span><span class="sh_symbol">=</span><span class="sh_string">"val3"</span><span class="sh_keyword">></n0:bar></span>
|
|
<span class="sh_keyword"><n0:bar></n0:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-xmlattribs" class="section">
|
|
<h3><span class="secno">3.6 </span>Special namespaces "xml", "xsi", "xsd"</h3>
|
|
<p>
|
|
In this example there are are three special namespace declaration the "xml" namespace used
|
|
in the attribute <code>xml:id="23"</code> and also the "xsi" and "xsd" namespaces used in
|
|
<code>xsi:type="xsd:string"</code>.
|
|
</p>
|
|
<p>
|
|
Canonicalization only treats "xml" as a special namespace. It is never rewritten by prefix-rewriting.
|
|
"xsi" and "xsd" are treated as regular namespaces.
|
|
</p>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After
|
|
c14n"):
|
|
</p>
|
|
<ul>
|
|
<li>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.</li>
|
|
</ul>
|
|
|
|
Notice these things in canonicalization with prefix rewriting ("After c14n with PrefixRewrite"):
|
|
<ul>
|
|
<li>It also removes the "xsd" declaration completely.</li>
|
|
<li>It doesn't change the "xml" prefix to anything else, also it doesn't emit the namespace
|
|
declaration for the "xml" prefix.</li>
|
|
<li>But it does rewrite the "xsi" prefix to "ns1".</li>
|
|
</ul>
|
|
|
|
Notice these things in canonicalization with QName awareness ("After c14n with QNameAware"):
|
|
<ul>
|
|
<li>Look at the <code>CanonicalzationMethod</code> in <a href="files/c14nQname.xml">c14nQname.xml</a>.
|
|
it lists "xsi:type" as a Qualified Attribute in the QNameAware element. </li>
|
|
<li>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.
|
|
</li></ul>
|
|
|
|
Notice these things in canonicalization with QName awareness ("After c14n with QNameAware and PrefixRewrite"):
|
|
<ul>
|
|
<li>Look at the <code>CanonicalzationMethod</code> in <a href="files/c14nPrefixQname.xml">c14nPrefixQname.xml</a>.
|
|
it lists "xsi:type" as a Qualified Attribute in the QNameAware element. It also PrefixRewite=sequential </li>
|
|
<li>So now "xsd" is considered visibly utilized, and it is rewritten to "n1".
|
|
I.e. <code>xsi:type="xsd:string"</code> changes
|
|
to <code>n2:type="n1:string".</code>
|
|
</li></ul>
|
|
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsXml.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsXml_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsXml_c14nPrefix.xml">After c14n with
|
|
PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xml:id</span><span class="sh_symbol">=</span><span class="sh_string">"23"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><bar</span> <span class="sh_type">xsi:type</span><span class="sh_symbol">=</span><span class="sh_string">"xsd:string"</span> <span class="sh_type">xmlns:xsi</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="sh_type">xmlns:xsd</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span><span class="sh_keyword">></span>data<span class="sh_keyword"></bar></span>
|
|
<span class="sh_keyword"></foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xml:id</span><span class="sh_symbol">=</span><span class="sh_string">"23"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><bar</span> <span class="sh_type">xmlns:xsi</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="sh_type">xsi:type</span><span class="sh_symbol">=</span><span class="sh_string">"xsd:string"</span><span class="sh_keyword">></span>data<span class="sh_keyword"></bar></span>
|
|
<span class="sh_keyword"></foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xml:id</span><span class="sh_symbol">=</span><span class="sh_string">"23"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="sh_type">n1:type</span><span class="sh_symbol">=</span><span class="sh_string">"xsd:string"</span><span class="sh_keyword">></span>data<span class="sh_keyword"></n0:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
<tr>
|
|
<th></th>
|
|
<th><a href="files/out_inNsXml_c14nQname.xml">After c14n with QNameAware</a></th>
|
|
<th><a href="files/out_inNsXml_c14nPrefixQname.xml">After c14n with QNameAware and PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><foo</span> <span class="sh_type">xmlns</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xml:id</span><span class="sh_symbol">=</span><span class="sh_string">"23"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><bar</span> <span class="sh_type">xmlns:xsd</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span> <span class="sh_type">xmlns:xsi</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="sh_type">xsi:type</span><span class="sh_symbol">=</span><span class="sh_string">"xsd:string"</span><span class="sh_keyword">></span>data<span class="sh_keyword"></bar></span>
|
|
<span class="sh_keyword"></foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://z0"</span> <span class="sh_type">xml:id</span><span class="sh_symbol">=</span><span class="sh_string">"23"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema-instance"</span> <span class="sh_type">n2:type</span><span class="sh_symbol">=</span><span class="sh_string">"n1:string"</span><span class="sh_keyword">></span>data<span class="sh_keyword"></n0:bar></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
<div id="sec-PrefixesInContent" class="section">
|
|
<h3><span class="secno">3.7 </span>Prefixes in Element content</h3>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After
|
|
c14n"):
|
|
</p>
|
|
<ul>
|
|
<li>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.</li>
|
|
</ul>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar>"):
|
|
</p>
|
|
<ul>
|
|
<li>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.</li>
|
|
</ul>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath>"):
|
|
</p>
|
|
<ul>
|
|
<li>All three embedded prefixes "xsd", "soap-env" and "b" prefixes as considered as visibly utilized.</li>
|
|
<li>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. </li>
|
|
<li> "child:" is not a prefix, it is an XPath axis, as indicated by the double colon. </li>
|
|
</ul>
|
|
<p>
|
|
Notice the following things in the default canonicalization ("After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath> and PrefixRewrite"):
|
|
</p>
|
|
<ul>
|
|
<li>All three embedded prefixes "xsd", "soap-env" and "b" prefixes as considered as visibly utilized.
|
|
They are rewritten to "n1", "n3" and "n2" respectively. </li>
|
|
<li>The text content is modified because of prefix rewriting. </li>
|
|
<li>Even though the "xsd" prefix is rewritten to "n1", the 'xsd:string' is left unchanged, as it inside a single quoted string.</li>
|
|
</ul>
|
|
|
|
<table>
|
|
<tbody><tr>
|
|
<th><a href="files/inNsContent.xml">Original Data</a></th>
|
|
<th><a href="files/out_inNsContent_c14nDefault.xml">After c14n</a></th>
|
|
<th><a href="files/out_inNsContent_c14nQnameElem.xml">After c14n with QNameAware <a:bar></a></th>
|
|
</tr>
|
|
<tr>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">xmlns:child</span><span class="sh_symbol">=</span><span class="sh_string">"http://c"</span> <span class="sh_type">xmlns:soap-env</span><span class="sh_symbol">=</span><span class="sh_string">"http://schemas.xmlsoap.org/wsdl/soap/"</span> <span class="sh_type">xmlns:xsd</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><a:bar></span>xsd:string<span class="sh_keyword"></a:bar></span>
|
|
<span class="sh_keyword"><dsig2:IncludedXPath</span> <span class="sh_type">xmlns:dsig2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2010/xmldsig2#"</span><span class="sh_keyword">></span>/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']<span class="sh_keyword"></dsig2:IncludedXPath></span>
|
|
<span class="sh_keyword"></a:foo></span>
|
|
</pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><a:bar></span>xsd:string<span class="sh_keyword"></a:bar></span>
|
|
<span class="sh_keyword"><dsig2:IncludedXPath</span> <span class="sh_type">xmlns:dsig2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2010/xmldsig2#"</span><span class="sh_keyword">></span>/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']<span class="sh_keyword"></dsig2:IncludedXPath></span>
|
|
<span class="sh_keyword"></a:foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><a:bar</span> <span class="sh_type">xmlns:xsd</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span><span class="sh_keyword">></span>xsd:string<span class="sh_keyword"></a:bar></span>
|
|
<span class="sh_keyword"><dsig2:IncludedXPath</span> <span class="sh_type">xmlns:dsig2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2010/xmldsig2#"</span><span class="sh_keyword">></span>/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']<span class="sh_keyword"></dsig2:IncludedXPath></span>
|
|
<span class="sh_keyword"></a:foo></span></pre></td>
|
|
</tr>
|
|
<tr>
|
|
<th></th>
|
|
<th><a href="files/out_inNsContent_c14nQnameXpathElem.xml">After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath></a></th>
|
|
<th><a href="files/out_inNsContent_c14nPrefixQnameXpathElem.xml">After c14n with QNameAware <a:bar> and <dsig2:IncludedXPath> and PrefixRewrite</a></th>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><a:foo</span> <span class="sh_type">xmlns:a</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><a:bar</span> <span class="sh_type">xmlns:xsd</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span><span class="sh_keyword">></span>xsd:string<span class="sh_keyword"></a:bar></span>
|
|
<span class="sh_keyword"><dsig2:IncludedXPath</span> <span class="sh_type">xmlns:b</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">xmlns:dsig2</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2010/xmldsig2#"</span> <span class="sh_type">xmlns:soap-env</span><span class="sh_symbol">=</span><span class="sh_string">"http://schemas.xmlsoap.org/wsdl/soap/"</span><span class="sh_keyword">></span>/soap-env:body/child::b:foo[@att1 != "c:val" and @att2 != 'xsd:string']<span class="sh_keyword"></dsig2:IncludedXPath></span>
|
|
<span class="sh_keyword"></a:foo></span></pre></td>
|
|
<td><pre class="sh_xml sh_sourceCode"><span class="sh_keyword"><n0:foo</span> <span class="sh_type">xmlns:n0</span><span class="sh_symbol">=</span><span class="sh_string">"http://a"</span><span class="sh_keyword">></span>
|
|
<span class="sh_keyword"><n0:bar</span> <span class="sh_type">xmlns:n1</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2001/XMLSchema"</span><span class="sh_keyword">></span>n1:string<span class="sh_keyword"></n0:bar></span>
|
|
<span class="sh_keyword"><n4:IncludedXPath</span> <span class="sh_type">xmlns:n2</span><span class="sh_symbol">=</span><span class="sh_string">"http://b"</span> <span class="sh_type">xmlns:n3</span><span class="sh_symbol">=</span><span class="sh_string">"http://schemas.xmlsoap.org/wsdl/soap/"</span> <span class="sh_type">xmlns:n4</span><span class="sh_symbol">=</span><span class="sh_string">"http://www.w3.org/2010/xmldsig2#"</span><span class="sh_keyword">></span>/n3:body/child::n2:foo[@att1 != "c:val" and @att2 != 'xsd:string']<span class="sh_keyword"></n4:IncludedXPath></span>
|
|
<span class="sh_keyword"></n0:foo></span></pre></td>
|
|
</tr>
|
|
</tbody></table>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="references" class="appendix section"><!--OddPage--><h2><span class="secno">A. </span>References</h2><p>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.</p><div id="normative-references" class="section"><h3><span class="secno">A.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-XML-C14N20">[XML-C14N20]</dt><dd>John Boyer; Glen Marcy; Pratik Datta; Frederick Hirsch. <a href="http://www.w3.org/TR/2011/WD-xml-c14n2-20110421/"><cite>Canonical XML Version 2.0.</cite></a> 21 April 2011. W3C Last Call Working Draft. (Work in progress) URL: <a href="http://www.w3.org/TR/2011/WD-xml-c14n2-20110421/">http://www.w3.org/TR/2011/WD-xml-c14n2-20110421/</a>
|
|
</dd><dt id="bib-XML10">[XML10]</dt><dd>C. M. Sperberg-McQueen; et al. <a href="http://www.w3.org/TR/2008/REC-xml-20081126/"><cite>Extensible Markup Language (XML) 1.0 (Fifth Edition).</cite></a> 26 November 2008. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2008/REC-xml-20081126/">http://www.w3.org/TR/2008/REC-xml-20081126/</a>
|
|
</dd></dl></div><div id="informative-references" class="section"><h3><span class="secno">A.2 </span>Informative references</h3><p>No informative references.</p></div></div></body></html>
|