saxon:serialize()

serialize(node, format)

This function takes two arguments: the first is a node (generally a document or element node) to be serialized. The second is the name of an xsl:output element in the stylesheet. The second argument must be known at compile time (it will typically be supplied as a string literal.) The function serializes the specified document, or the subtree rooted at the specified element, according to the parameters specified in the named xsl:output element, and returns the serialized document as a string.

This function is useful where the XSLT stylesheet wants to manipulate the serialized output, for example by embedding it as CDATA inside another XML document, or prefixing it with a DOCTYPE declaration, or inserting it into a non-XML output file.

Expand

Up  Next