ParseXMLString method: Incoming Business Interlink class

Syntax

ParseXMLString(XMLstring [, DTDValidation])

Description

The ParseXMLString methods fills an existing BiDocs object with the data and shape from an XML string. This is part of the Incoming Business Interlink functionality, which enables PeopleCode to receive an XML request and return an XML response.

Parameters

Parameter Description

XMLstring

A string containing an XML document.

DTDValidation

Specify whether to validate a document type definition (DTD.) This parameter takes a Boolean value. If you specify true, the DTD validation occurs if a DTD is provided. If you specify false, and if a DTD is provided, it is ignored and the XML isn't validated against the DTD. The default value for this parameter is false.

In the case of application messaging, if a DTD is provided, it's always ignored and the XML isn't validated against the DTD.

If the XML cannot be validated against a DTD, an error is thrown saying that there was an XML parse error.

Returns

Number. The return status. NoError, or 0, means the method succeeded.

Example

The following example gets an XML request, creates an empty BiDoc, and then fills the BiDoc with the data and shape contained in the XML string. After this is done, the GetDoc method and the GetValue method can get the value of the skills XML element, which is contained within the postreq element in the XML request.

Local BIDocs &rootInDoc, &postreqDoc; 
Local string &blob; 
Local number &ret; 
&blob = %Request.GetContentBody(); 
/* process the incoming xml(request)- Create a BiDoc and fill with the request*/ 
&rootInDoc = GetBiDoc(""); 
&ret = &rootInDoc.ParseXMLString(&blob); 
&postreqDoc = &rootInDoc.GetDoc("postreq"); 
&ret = &postreqDoc.GetValue("skills", &skills);