Specifications

Evaluates an XPath 1.0 expression in the node’s context
and converts the result to a numeric value with the
XPath 1.0 number() function.
evalToNumber( xpath : String,
prefix-map : Map ) : Number
Evaluates an XPath 1.0 expression in the node’s context
and converts the result to a Boolean value with the
XPath 1.0 boolean() function.
evalToBoolean( xpath : String,
prefix-map : Map ) : Boolean
Document class
A Document object represents the root node of a well-formed XML document (refer to the XML
1.0 specification). The root node is the "invisible" node that contains the document element and
any top-level comments.
Document inherits from the Node class, so all functions defined for Node can be used with
Document. Document is the only class in the XML module with a constructor; all other classes
are instantiated from within a document.
Constructing, loading and saving
Constructs a new empty XML document (in memory).
Document( )
Constructs a new XML document (in memory) and parses the
contents of the file at the specified absolute path into the
Document( path : String,
discardBlankNodes:
Boolean )
document’s node tree. If the specified file is not well-formed XML,
this function logs an error message and it constructs a partial or
empty document.
If discardBlankNodes is true, text nodes that contain only white
space (such as line breaks) are discarded while parsing the input
stream. If discardBlankNodes is false, null or missing, white-space
text nodes are left in place.
Serializes the XML document into a file at the specified absolute
path.
save( path : String )
Performing transformations
Refer to the XSLT 1.0 specification and to widely available literature about XSLT for more
information.
Returns a newly created document that contains the
transformation of this document according to the rules of
createTransform( stylesheet :
Document ) : Document
the specified stylesheet. The stylesheet argument must be
a valid XML document which is assumed to be an XSLT 1.0
stylesheet.
This is a static function.
transform( in-path : String,
stylesheet-path : String, out-path
: String )
Transforms the XML file at “in-path” using the XSLT 1.0
stylesheet at “stylesheet-path” and saves the result in a
file at “out-path”.
427
Enfocus Switch 10