SYNOPSISxmlReader xmlReaderNewFromString(string data
[, string encoding ]
[, string options ] )
Parameters:
data
- the XML you want to parse and readencoding
(optional) - encoding to use for the fileoptions
(optional) - a comma-separated list of
parsing options (see below)
Returns:
xmlReader
for this string
DESCRIPTIONxmlReaderNewFromString()
parses XML data from a Vortex variable
into an xmlReader
.
A copy of the variable is made at the time that
xmlReaderNewFromString()
is called, so changes to the variable
that contains XML data after the xmlReader
has been created
will not affect the xmlReader
.
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<$xml = "<item>I'm a simple XML document!</item>">
<$reader = (xmlReaderNewFromString($xml))>
SEE ALSOxmlReaderNewFromFile