Optional
ignoreOptional
includeWhen true
, the starting and ending byte offsets of each node in the input
string will be made available via start
and end
properties on the node.
Optional
preserveWhen true
, CDATA sections will be preserved in the document as XmlCdata
nodes. Otherwise CDATA sections will be represented as XmlText
nodes,
which keeps the node tree simpler and easier to work with.
Optional
preserveWhen true
, comments will be preserved in the document as XmlComment
nodes. Otherwise comments will not be included in the node tree.
Optional
preserveWhen true
, a document type declaration (if present) will be preserved in
the document as an XmlDocumentType
node. Otherwise the declaration will
not be included in the node tree.
Note that when this is true
and a document type declaration is present,
the DTD will precede the root node in the node tree (normally the root
node would be first).
Optional
preserveWhen true
, an XML declaration (if present) will be preserved in the
document as an XmlDeclaration
node. Otherwise the declaration will not be
included in the node tree.
Note that when this is true
and an XML declaration is present, the
XML declaration will be the first child of the document (normally the root
node would be first).
Optional
resolveWhen an undefined named entity is encountered, this function will be called
with the entity as its only argument. It should return a string value with
which to replace the entity, or null
or undefined
to treat the entity
as undefined (which may result in a parse error depending on the value of
ignoreUndefinedEntities
).
Optional
sortWhen true
, attributes in an element's attributes
object will be sorted
in alphanumeric order by name. Otherwise they'll retain their original
order as found in the XML.
When
true
, an undefined named entity (like "&bogus;") will be left in the output as is instead of causing a parse error.