XPath transform

http://www.w3.org/TR/2000/WD-xmldsig-core-20000104#sec-XPath
> The XPath transform applies the W3C XML canonicalization
> [XML-C14N] to the input resource. This ensures all entity
> reference substitutions and attribute normalizations are
> performed in a manner consistent with a validating XML
> processor. Linefeeds are normalized, and CDATA sections are
> eliminated. The types of quotes around attributes are
> normalized, and the order of attributes is defined. Namespace
> attributes are created in descendant elements that use
> namespace definitions. All of these modifications are necessary
> to achieve a consistent interpretation of the XPath expression
> and a consistent output of the XPath transform.

If the XML-C14N is applied to the input before the XPath
processing, the attribute order is not constant in the result
node-set.

The attribute order get unsettled when:
A) An XML processor parses the document, or
B) An XPath processor collects attributes in an element (An
XPath processor may reorder attributes because the attribute
order is implementation-dependent accoding to XPath 1.0
Recommendation)

Applying the XML-C14N might avoid A (if an XML processor does
not used between the XML-C14N and the XPath) and never avoid B.


> The result of the XPath is a string, boolean, number, or
> node-set. If the result of the XPath expression is a string,
> then the string is the output of the XPath transform.

How to calculate a digest value of the result string? That is,
what character encoding is used to convert the result string to
an octet sequence?

-- 
TAMURA Kent @ Tokyo Research Laboratory, IBM

Received on Friday, 14 January 2000 02:36:05 UTC