LoadIBContent method: XmlDoc class
Syntax
LoadIBContent(Content[, RootTagName])
Description
Use LoadIBContent to load data into an XmlDoc object. This function is primarily used for display purposes, the main use is found in the Integration Broker Monitor for viewing message structures.
When Content is an XML string, the XmlDoc contains the DOM representation of the XML.
When Content is not an XML string, LoadIBContents generates a DOM wrapper.
Parameters
| Parameter | Description |
|---|---|
|
Content |
Specify the content of the XmlDoc. |
|
RootTagName |
Specify the root tag name to be used in the XmlDoc object used as the wrapper, if the data is non-Xml. If a root tag name is not specified, and the data is non-Xml, the contents are not wrapped with the default of root tag name of PSMessage. |
Returns
This method returns a Boolean value that is always True.
Example
Using the following data:
John Q. Public,1234 West Eastland,925-987-0909
Jane Doe,423 Someplace,234-992-9383
The following PeopleCode program specifies a root name:
Local XmlDoc &inXMLDoc;
Local boolean &ret;
Local string &inStr;
&inStr = "John Q. Public,1234 West Eastland,925-987-0909" | Char(13) | "Jane⇒
Doe,423 Someplace,234-992-9383";
&inXMLDoc = CreateXmlDoc("");
&ret = &inXMLDoc.LoadIBContent(&inStr, "Root");
This produces the following:
<?xml version="1.0"?>
<Root>
<data PsNonXml="Yes">
<![CDATA[John Q. Public,1234 West Eastland,925-987-0909
Jane Doe,423 Someplace,234-992-9383]]>
</data>
</Root>
The following PeopleCode program does not specify a root name:
Local XmlDoc &inXMLDoc;
Local boolean &ret;
Local string &inStr;
&inStr = "John Q. Public,1234 West Eastland,925-987-0909" | Char(13) | "Jane⇒
Doe,423 Someplace,234-992-9383";
&inXMLDoc = CreateXmlDoc("");
&ret = &inXMLDoc.LoadIBContent(&inStr);
This produces the following:
<?xml version="1.0"?>
<PSMessage>
<data PsNonXml="Yes">
<![CDATA[John Q. Public,1234 West Eastland,925-987-0909
Jane Doe,423 Someplace,234-992-9383]]>
</data>
</PSMessage>
The following is an example of a valid XML document:
Local XmlDoc &inXMLDoc;
Local boolean &ret;
Local string &inStr;
&inStr = "<?xml version='1.0'?><root/>";
&inXMLDoc = CreateXmlDoc("");
&ret = &inXMLDoc.LoadIBContent(&inStr);
This produces the following:
<?xml version="1.0"?>
<root/>