PBDOM_BUILDER:
BuildFromString method
Description
Builds
a PBDOM_DOCUMENT from a string.
Syntax
1 |
<span>pbdom_builder_name.</span>BuildFromString(string <span>strXMLStream</span>) |
Argument |
Description |
---|---|
pbdom_builder_name |
The name of a PBDOM_BUILDER |
strXMLStream |
A string containing XML |
Return Values
PBDOM_DOCUMENT.
Throws
EXCEPTION_INVALID_ARGUMENT – The
input string is invalid. This can happen if it has not been initialized
properly or is a null object reference.
EXCEPTION_MEMORY_ALLOCATION_FAILURE – Insufficient
memory was encountered while executing this method.
Examples
The following PowerScript code fragment demonstrates
how to use the BuildFromString method with an
input string. A string containing XML is passed to the BuildFromString method
and the return value is assigned to a PBDOM_DOCUMENT.
1 |
PBDOM_Builder pbdom_bldr<br>pbdom_document pbdom_doc<br>string strXML<br> <br>strXML = "<Music:abc xmlns:ZMusic="<br>strXML += "~"http://www.ZMusic.com~">"<br>strXML += "Root Element Data<data>ABC Data"<br>strXML += "<inner_data>My Inner Data</inner_data>" |
1 |
strXML += "My Data</data></abc>"<br> <br>pbdom_bldr = Create PBDOM_Builder<br>pbdom_doc = pbdom_bldr.BuildFromString (strXML) |
Usage
The encoding specified in the XML export template determines
the encoding of the document created using BuildFromString.