Werner Dittmann wrote:

C14N requires a well formed XML document as input (according to the
specs). Content as defined by XML Encryption (and the referenced
XML base specs) is not required to be well formed as it can be
a DocumentFragment. If this understanding is correct,
then we cannot serialize a DoucmentFragment directly but
the Encryption code must deal with it (loop over the
siblings and call serializeNode correctly).

C14n requires either an octet stream that represents a well formed XML Document or an XPath nodeset (or equivalent) representing a set of nodes to serialise. In the latter case, the input may not (and often will not) be well formed.


C14n doesn't directly handle a DocumentFragment node, but it can easily be made to do so by simply canonicalising each child in order and concatenating the result. Alternatively it can directly handle the serialisation be setting the input to be the nodeset represented by all the children (and grandchildren) of the DocumentFragment.

Cheers,
        Berin




Reply via email to