W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > April to June 2000

serialize spec.

From: TAMURA Kent <kent@trl.ibm.co.jp>
Date: Thu, 6 Apr 2000 14:46:59 +0900
Message-Id: <200004060547.OAA31630@ns.trl.ibm.com>
To: "IETF/W3C XML-DSig WG (E-mail)" <w3c-ietf-xmldsig@w3.org>

In message "RE: Enveloped signatures and XPath"
    on 00/03/23, "John Boyer" <jboyer@PureEdge.com> writes:
> <p>
> <a name="function-serialize"><b>Function: </b><i>string</i>
> <b>serialize</b>(<i>node-set</i>)</a>
> </p>
> 
> <p>This function converts a node-set into a string by generating the
> representative text
> for each node in the node-set.  The nodes of a node-set are processed in
> ascending order
> of the nodes' <b>document order</b> positions except for attribute and
> namespace nodes,
> which do not have document order positions.</p>
> 
> <p>The nodes in the attribute and namespace axes will each be processed in
> lexicographic order,
> with the namespace axis preceding the attribute axis.  Lexicographic
> comparison is performed using
> namespace URI as the primary key and local name as secondary key (nodes with
> no namespace
> qualification have an empty namespace URI, which is defined to be
> lexicographically least).
> Lexicographic comparison is based on the UCS codepoint values, which is
> equivalent to lexical
> ordering based on UTF-8.</p>

This paragraph does not mention the order in namespace axes.
Are they sorted with prefix? or namespace URI?


> <p>The method of text generation is dependent on the node type and given in
> the following list:</p>
> 
> <ul>
> <li><b>Root Node-</b> Nothing (no byte order mark, no XML declaration, no
> document
> type declaration).</li>
> 
> <li><b>Element Nodes-</b> An open angle bracket (&lt;), the element QName,
> the nodes of the
> namespace axis, the nodes of the attribute axis, a close angle bracket (>),
> the descendant
> nodes of the element that are in the node-set (in document order), an open
> angle bracket, a
> forward slash (/), the element QName, and a close angle bracket.
> The element <a href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</a>
> is either the
> local name if the namespace prefix string is empty or the namespace prefix
> and a colon,
> then the local name of the element.</li>
> 
> <li><b>Namespace and Attribute Nodes-</b> a space, the node's QName, an
> equals sign,
> an open double quote, the modified string value, and a close double quote.
> The string value of the node is modified by replacing all ampersands (&amp;)
> with <code>&amp;amp;</code>,
> and all double quote characters with <code>&amp;quot;</code>, and all
> illegal characters for UTF-8
> encoding with hexadecimal character references (e.g.
> <code>&amp;#x0D;</code>).</li>

There are no `illegal characters for UTF-8 encoding.'  UTF-8 can
encode all characters in 0-7fffffff.

> 
> <li><b>Text Nodes-</b> the string value, except all ampersands are replaced
> by <code>&amp;amp;</code>,
> all open angle brackets (&lt;) are replaced by <code>&amp;lt;</code>, and
> all illegal characters
> for UTF-8 encoding with hexadecimal character references (e.g.
> <code>&amp;#x0D;</code>).</li>
> 
> <li><b>Processing Instruction Nodes-</b> an open angle bracket, a question
> mark, the PI target name
> of the node, a space, the string value, the question mark, and a close angle
> bracket.</li>

Is a target-only PI serialized as "<?target ?>"?

> <li><b>Comment Nodes-</b> the open comment sequence (&lt;!--), the string
> value of the node, and the close
> comment sequence (-->).</li>
> </ul>


I think it is easy to follow Canonical XML about detailed
points.


-- 
TAMURA Kent @ Tokyo Research Laboratory, IBM
Received on Thursday, 6 April 2000 01:47:43 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.29 : Thursday, 13 January 2005 12:10:09 GMT