fn:parse-xml-fragment

This function takes as input an XML external entity represented as a string, and returns the document node at the root of an XDM tree representing the parsed document fragment.

For details of error handling, see the parse-xml() function.

parse-xml-fragment($value as (xs:string | xs:hexBinary | xs:base64Binary)?, $options as map(*)?:={}) ➔ document-node()?

Arguments

 

$value

(xs:string | xs:hexBinary | xs:base64Binary)?

The lexical XML string to be parsed as a document fragment

 

$options

map(*)?

:= {}

Options map

Result

document-node()?

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 3.1 Functions and Operators

XPath 4.0 Functions and Operators

Saxon availability

Available in XPath 3.0, XSLT 3.0, XQuery 3.0, and later versions. From Saxon 9.6, available in all editions. Available for all platforms.

Notes on the Saxon implementation

Available since Saxon 9.5, provided XPath 3.0 is enabled.