Creating an XML document from XML – PB Docs 125

Creating an XML document from XML

The PBDOM_BUILDER class provides three methods for
creating a PBDOM_DOCUMENT from an existing XML source.
It also provides the GetParseErrors method to get a list of any
parsing errors that occur.

Using BuildFromString

The following example uses an XML string and the PBDOM_BUILDER
class to create a PBDOM_DOCUMENT. First the objects are
declared:

The objects are then instantiated using the constructor and
the PBDOM_BUILDER BuildFromString method:

XML can also be loaded directly into a string variable, as
in the following example:

Using BuildFromFile

You can create an XML file using the BuildFromFile method
and a string containing the path to a file from which to create
a PBDOM_DOCUMENT:

Using BuildFromDataStore

The following PowerScript code fragment demonstrates how to
use the BuildFromDataStore method with a referenced
DataStore object.

Using GetParseErrors

After a call to any of the Build methods, you can obtain a
list of parsing and validating errors encountered by the Build methods
with the GetParseErrors method:

note.png Parsing errors

If parsing errors are found and GetParseErrors returns true,
a complete PBDOM node tree that can be inspected might still be
created.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x