RFC3076 - Canonical XML Version 1.0(2)

时间:2005-02-17 来源: 作者: 点击:
the problems cannot easily be fixed in those cases, whereas here we have an opportunity to avoid purposefully introducing such a limitation. Applications that must test for logical equivalence must p
  
the problems cannot easily be fixed in those cases, whereas here we
have an opportunity to avoid purposefully introducing such a
limitation.

Applications that must test for logical equivalence must perform more
sophisticated tests than mere octet stream comparison. However, this
is quite likely to be necessary in any case in order to test for
logical equivalencies based on application rules as well as rules
from other XML-related recommendations, working drafts, and future
works.

4.5 Order of Namespace Declarations and Attributes

The C14N-20000119 Canonical XML draft alternated between namespace
declarations and attribute declarations. This is part of the
namespace prefix rewriting scheme, which this specification
eliminates. This specification follows the XPath data model of
putting all namespace nodes before all attribute nodes.

4.6 Superfluous Namespace Declarations

Unnecessary namespace declarations are not made in the canonical
form. Whether for an empty default namespace, a non-empty default
namespace, or a namespace prefix binding, the XML canonicalization
method omits a declaration if it determines that the immediate parent
element in the canonical form has an equivalent declaration in scope.
The root document element is handled specially since it has no parent
element. All namespace declarations in it are retained, except the
declaration of an empty default namespace is automatically omitted.

Relative to the method of simply rendering the entire namespace
context of each element, implementations are not hindered by more
than a constant factor in processing time and memory use. The
advantages include:

* Eliminates overrun of xmlns="" from canonical forms of
applications that may not even use namespaces, or support them
only minimally.
* Eliminates namespace declarations from elements where they may
not belong according to the application's content model,
thereby simplifying the task of reattaching a document type
declaration to a canonical form.

Note that in document subsets, an element with omissions from its
ancestral element chain will be rendered to the canonical form with
namespace declarations that may have been made in its omitted
ancestors, thus preserving the meaning of the element.

4.7 Propagation of Default Namespace Declaration in Document Subsets

The XPath data model represents an empty default namespace with the
absence of a node, not with the presence of a default namespace node
having an empty value. Thus, with respect to the fact that element
e3 in the following examples is not namespace qualified, we cannot
tell the difference between <e1 xmlns="a:b"><e2
xmlns=""><e3/></e2></e1> versus <e1 xmlns="a:b"><e2><e3
xmlns=""/></e2></e1>. All we know is that e3 was not namespace
qualified on input, so we preserve this information on output if e2
is omitted so that e3 does not take on the default namespace
qualification of e1.

4.8 Sorting Attributes by Namespace URI

Given the requirement to preserve the namespace prefixes declared in
a document, sorting attributes with the prefix, rather than the
namespace URI, as the primary key is viable and easier to implement.

However, the namespace URI was selected as the primary key because
this is closer to the intent of the XML Names specification, which is
to identify namespaces by URI and local name, not by a prefix and
local name. The effect of the sort is to group together all
attributes that are in the same namespace.

Security Considerations

Security issues are discussed in section 1.3.

References

[C14N-20000119] Canonical XML Version 1.0, W3C Working Draft.
T. Bray, J. Clark, J. Tauber, and J. Cowan.
January 19, 2000.
http://www.w3.org/TR/2000/WD-xml-c14n-
20000119.html.

[CharModel] Working Draft. eds. Martin J. Durst, Francois
Yergeau, Misha Wolf, Asmus Freytag, Tex Texin.
http://www.w3.org/TR/charmod/.

[Cowan] Example of Harmful Effect of Character Model
Normalization, Letter in XML Signature Working
Group Mail Archive. John Cowan, July 7, 2000
http://lists.w3.org/Archives/Public/w3c-ietf-
xmldsig/2000JulSep/0038.html.

[Infoset] XML Information Set, W3C Working Draft. John
Cowan, Richard Tobin.
http://www.w3.org/TR/xml-infoset.

[ISO-8859-1] ISO-8859-1 Latin 1 Character Set.
http://www.utoronto.ca/webdocs/HTMLdocs/
NewHTML/iso_table.html or
http://www.iso.ch/cate/cat.html.

[Keywords] Bradner, S., "Key words for use in RFCs to
Indicate Requirement Levels", BCP 14, RFC
2119, March 1997.

[Namespaces] Namespaces in XML, W3C Recommendation. eds.
Tim Bray, Dave Hollander, and Andrew Layman.
http://www.w3.org/TR/REC-xml-names/

[NFC] TR15, Unicode Normalization Forms. M. Davis,
M. Durst. Revision 18: November 1999.
http://www.unicode.org/unicode/reports/tr15/
tr15-18.html.

[NFC-Corrigendum] NFC-Corrigendum. The Unicode Consortium.
http://www.unicode.org/unicode/uni2errata/
Normalization_Corrigendum.html.

[Unicode] The Unicode Standard, version 3.0. The Unicode
Consortium. ISBN 0-201-61633-5.
http://www.unicode.org/unicode/standard/
versions/Unicode3.0.html.

[UTF-16] Hoffman, P. and F. Yergeau, "UTF-16, an
encoding of ISO 10646", RFC2781, February
2000.

[UTF-8] Yergeau, F., "UTF-8, a transformation format
of ISO 10646", RFC2279, January 1998.

[URI] Berners-Lee, T., Fielding, R. and L. Masinter,
"Uniform Resource Identifiers (URI): Generic
Syntax", RFC2396, August 1998.

[XBase] XML Base ed. Jonathan Marsh. 07 June 2000.
http://www.w3.org/TR/xmlbase/.

[XML] Extensible Markup Language (XML) 1.0 (Second
Edition), W3C=20 Recommendation. eds. Tim
Bray, Jean Paoli, C. M. Sperberg-McQueen and
Eve Maler. 6 October 2000.
http://www.w3.org/TR/REC-xml.

[XML DSig] Eastlake, D., Reagle, J. and D. Solo, "XML-
Signature Syntax and Processing", RFC3075,
July 2000.

[XML Plenary Decision] W3C XML Plenary Decision on relative URI
References In namespace declarations, W3C
Document. 11 September 2000.
http://lists.w3.org/Archives/Public/xml-
uri/2000Sep/0083.html.

[XPath] XML Path Language (XPath) Version 1.0, , W3C
Recommendation. eds. James Clark and Steven
DeRose. 16 November 1999.
http://www.w3.org/TR/1999/REC-xpath-19991116.

Author's Address

John Boyer
PureEdge Solutions Inc.

Phone: 1-888-517-2675
EMail: jboyer@PureEdge.com

Acknowledgements

The following people provided valuable feedback that improved the
quality of this specification:

* Doug Bunting, Ariba
* John Cowan, Reuters
* Martin J. Durst, W3C
* Donald Eastlake 3rd, Motorola
* Merlin Hughes, Baltimore
* Gregor Karlinger, IAIK TU Graz
* Susan Lesch, W3C
* Jonathan Marsh, Microsoft
* Joseph Reagle, W3C
* Petteri Stenius, Done360
* Kent Tamura, IBM

Full Copyright Statement

Copyright (C) The Internet Society (2001). All Rights Reserved.

This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.

The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement

Funding for the RFCEditor function is currently provided by the
Internet Society.

------分隔线----------------------------
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容