Business Processes and Rules: Siebel Enterprise Application Integration > Data Mapping Using Scripts > XML Property Set Functions >
XML Element Accessors
These functions provide access to elements represented by property sets. Table 45 presents the parameter for this function. XPSGetTagName()
Retrieves the tag name of an XML element. Syntax
XPSGetTagName (xmlPropSet)
Table 45. Parameter for XPSGetTagName() Method
|
|
xmlPropSet |
The output property set. |
Returns
String. If xmlPropSet is null, XPSGetTagName returns null . XPSSetTagName()
This function sets the tag name of an XML element. Table 46 presents the parameters for this function. Syntax
XPSSetTagName (xmlPropSet, tagName)
Table 46. Parameters for XPSSetTagName() Method
|
|
xmlPropSet |
The property set. |
tagName |
The name you want to supply as the current element name in the XML document. |
Returns
String XPSGetTextValue()
This function returns the text value of an XML element as a string. Table 47 presents the parameters for this function. Syntax
XPSGetTextValue (xmlPropSet [, defaultIfNull [, defaultIfEmpty]])
Table 47. Parameters for XPSGetTextValue() Method
|
|
xmlPropSet |
The output property set. |
defaultIfNull |
Specify a value to override the null default value that results if xmlPropSet is null. |
defaultIfEmpty |
Specify a value to override an empty string ("") contained in xmlPropSet. |
Returns
String or null Usage
If xmlPropSet is null then null is returned. You can use the optional defaultIfNull and defaultIfEmpty arguments to override null and empty string ("") return values. An element's text value is the text between an XML element's start and end tags, excluding child elements. XPSSetTextValue()
This function sets the text value of an XML element. Table 48 presents the parameters for this function. Syntax
XPSSetTextValue (xmlPropSet, text)
Table 48. Parameters for XPSSetTextValue() Method
|
|
xmlPropSet |
The property set. |
text |
A string you want inserted between start and end tags of an XML element. |
Returns
Not applicable Usage
The text argument should be a string. An element's text value is the text between the element's start and end tags, excluding child elements. XPSGetAttribute()
This function retrieves an element's attribute of the given name and returns it as a string. Table 49 presents the parameters for this function. Syntax
XPSGetAttribute (xmlPropSet, name [, defaultIfNull [, defaultIfEmpty]])
Table 49. Parameters for XPSGetAttribute() Method
|
|
xmlPropSet |
The output property set. |
name |
The name you want to supply as the root element name in the XML document. |
defaultIfNull |
Specify a value to override the null default value that results if xmlPropSet is null. |
defaultIfEmpty |
Specify a value to override an empty string ("") contained in xmlPropSet. |
Returns
String Usage
A null value is returned if xmlPropSet is null or the element does not have the named attribute. The optional defaultIfNull and defaultIfEmpty arguments can be used to override null and empty string ("") return values. XPSSetAttribute()
This function sets an element attribute value. Table 50 presents the parameters for this function. Syntax
XPSSetAttribute (xmlPropSet, name, value)
Table 50. Parameters for XPSSetAttribute() Method
|
|
xmlPropSet |
The output property set. |
name |
Attribute name. |
value |
String value you want to supply as the attribute value. |
Returns
String Usage
No action is taken if any of the arguments are null. XPSGetChildCount()
This function returns the number of children of an element. Table 51 presents the parameter for this function. Syntax
XPSGetChildCount(xmlPropSet)
Table 51. Parameter for XPSGetChildCount() Method
|
|
xmlPropSet |
The property set. |
Returns
Number Usage
All children of an element are also elements. XPSGetChild()
This function returns the nth child element as specified by the index. Table 52 presents the parameters for this function. Syntax
XPSGetChild(xmlPropSet, index)
Table 52. Parameters for XPSGetChild() Method
|
|
xmlPropSet |
The property set. |
index |
Number, starting at zero, of child elements of another element in an XML document. |
Returns
Property set Usage
Child elements are specified using a zero-based index. A value of null is returned if the index is invalid. XPSFindChild()
This function returns the first child element with the tagName. Table 53 presents the parameters for this function. Syntax
XPSFindChild (xmlPropSet, tagName)
Table 53. Parameters for XPSFindChild() Method
|
|
xmlPropSet |
The property set. |
tagName |
An XML element tag that signifies the first child element of another XML element. |
Returns
Property set. Usage
A value of null is returned if there is no child with the specified tag name. XPSAddChild()
This function creates a new child element with the tagName and appends it to the list of xmlPropSet's children. Table 54 presents the parameters for this function. Syntax
XPSAddChild (xmlPropSet, tagName [, textValue])
Table 54. Parameters for XPSAddChild() Method
|
|
xmlPropSet |
The property set. |
tagName |
The name you want to give to the new child element. |
textValue |
Optional. Sets the text value of the new element. |
Returns
Property set
|