SYNOPSISxmlDoc xmlTreeNewDocFromString(string data [, string encoding]
[, string options])
Parameters:
data - the XML data to parseencoding optional - encoding to use for the file.
If none given, the parser will attempt to discover on its own.options optional - a comma-separated list of
parsing options (see below)
Returns:
xmlDoc from the text data
DESCRIPTIONxmlTreeNewDocFromString() parses the XML data contained within
the string data and returns the xmlDoc for it.
The possible values for the options parameter are:
XML_PARSE_RECOVER - recover on errorsXML_PARSE_NOENT - substitute entitiesXML_PARSE_DTDLOAD - load the external subsetXML_PARSE_DTDATTR - default DTD attributesXML_PARSE_DTDVALID - validate with the DTDXML_PARSE_NOERROR - suppress error reportsXML_PARSE_NOWARNING - suppress warning reportsXML_PARSE_PEDANTIC - pedantic error reportingXML_PARSE_NOBLANKS - remove blank nodesXML_PARSE_XINCLUDE - Implement XInclude substitutionXML_PARSE_NONET - Forbid network accessXML_PARSE_NSCLEAN - remove redundant namespaces declarationsXML_PARSE_NOCDATA - merge CDATA as text nodesXML_PARSE_NOXINCNODE - do not generate XINCLUDE START/END nodes
EXAMPLE<capture>
<?xml version="1.0"?>
<top>
<item>I'm an item!</item>
</top>
</capture><$xml = $ret>
<$doc = (xmlTreeNewDocFromString($xml, 'XML_PARSE_NOBLANKS'))>
SEE ALSOxmlTreeNewDoc,
xmlTreeNewDocFromFile,
xmlTreePrintDoc,
xmlTreeSaveDoc