xmlTreeNewDocFromString

SYNOPSIS

xmlDoc xmlTreeNewDocFromString(string data [, string encoding]
                                 [, string options])

Parameters:

  • data - the XML data to parse

  • encoding 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:

  • the parsed xmlDoc from the text data


DESCRIPTION
xmlTreeNewDocFromString() 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 errors

  • XML_PARSE_NOENT - substitute entities

  • XML_PARSE_DTDLOAD - load the external subset

  • XML_PARSE_DTDATTR - default DTD attributes

  • XML_PARSE_DTDVALID - validate with the DTD

  • XML_PARSE_NOERROR - suppress error reports

  • XML_PARSE_NOWARNING - suppress warning reports

  • XML_PARSE_PEDANTIC - pedantic error reporting

  • XML_PARSE_NOBLANKS - remove blank nodes

  • XML_PARSE_XINCLUDE - Implement XInclude substitution

  • XML_PARSE_NONET - Forbid network access

  • XML_PARSE_NSCLEAN - remove redundant namespaces declarations

  • XML_PARSE_NOCDATA - merge CDATA as text nodes

  • XML_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 ALSO
xmlTreeNewDoc, xmlTreeNewDocFromFile, xmlTreePrintDoc, xmlTreeSaveDoc


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.