Business Processes and Rules: Siebel Enterprise Application Integration > Data Mapping Using Scripts > XML Property Set Functions >

Top-Level Property Set Functions


These functions are used to manipulate the top-level property set passed to the Map function.

XPSGetRootElement()

This function returns the property set representing the root element of the XML document. If the root element is not present, the system raises an error. Table 43 presents the parameter for this function.

Syntax

XPSGetRootElement(xmlPropSetIn)

Table 43. Parameter for XPSGetRootElement() Method
Parameter
Description

xmlPropSetIn

The name of the property set representing the root element of the XML document.

Returns

Property set

Usage

Use this function to return the root element of an XML document.

XPSCreateRootElement()

This function creates the root element in an output XML document and returns the property set representing it. The element tag in the XML document is set to the value of the tagName argument. Table 44 presents the parameters for this function.

Syntax

XPSCreateRootElement(xmlPropSetOut, tagName)

Table 44. Parameters for XPSCreateRootElement() Method
Parameter
Description

xmlPropSetOut

The output property set.

tagName

The name you want to supply as the root element name in the XML document.

Returns

Property set

Usage

Use this function to create the root element of an XML document that represents a property set. Because the root element does not directly map to a component in the property set, you can give it any representative name.

As an example of how the XPSGetRootElement() and XPSCreateRootElement() functions work, consider the following XML document:

<?xml version="1.0"?>
<!DOCTYPE LETTER SYSTEM "letter.dtd">
<letter>
<from>Mary Smith</from>
<to>Paul Jones</to>
<text>Hello!</text>
</letter>

The root element is <letter>. The property set for the <letter> element can be retrieved from the input property set using EAIXPS_GetRootElement, or it can be created in the output property set using EAIXPS_CreateRootElement.

A map function that converts a letter to a memo might start with the following code:

function ConvertLetterToMemo (xmlPropSetIn, xmlPropSetOut)
{
var xmlLetter = XPSGetRootElement (xmlPropSetIn);
var xmlMemo = XPSCreateRootElement (xmlPropSetOut, "memo");

... Code to fill in the 'memo' from the 'letter' ...
}

Business Processes and Rules: Siebel Enterprise Application Integration Copyright © 2006, Oracle. All rights reserved.