Salesforce

DbXmlMixedGet (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

DbXmlMixedGet (Magic xpa 4.x)

Fetches a text value from a mixed-content XML element.

Syntax:

DbXmlMixedGet(Source, Path, Element)

Parameters:

Source – A data source of type XML, such as ‘1’DSOURCE

Path – A string. The XML path to the mixed content element, for example: /root /mixed_child. The path can include an instance number in order to specify the instance number of a multi-occurrence element, such as /root/mixed_child[2]

Element – A string. A name of an element inside the mixed-content element. This value is used to specify which text node will be fetched. If the value is empty, the first node will be fetched. If the value is not empty, the node after the specified element will be fetched. If the element does not exist, an empty string will be returned.

Returns:

A string with the value of the text node. If the specified data source is not opened (according to the runtime tree) or the path does not exist, or the element does not exist, Null will be returned. If the text node does not exist, the function returns an empty string.

Note:

The XML data source must be opened in the current task, either by 'main source', link, or 'declare'.

Examples:

The following XML will be used to demonstrate the function's behavior:

<root>

<child>

Text1

<elem1>String</elem1>

<elem2>String</elem2>

Text2

</child>

</root>


To fetch the first text node “Text1” use: DbXmlMixedGet (‘1’DSOURCE, ‘/root/child’, ‘’)

There is no text node between “elem1” and elem2”, therefore:

DbXmlMixedGet ('1'DSOURCE, '/root/child', 'elem1') returns ''

DbXmlMixedGet ('1'DSOURCE, '/root/child', 'elem2') returns 'Text2'

DbXmlMixedGet ('1'DSOURCE, '/root/child', 'elem3') returns NULL

DbXmlMixedGet ('1'DSOURCE, '/root/child_not_exist', '') returns NULL

See also:

DbXmlMixedSet

How Do I Handle Mixed-Content in an XML Document?

The Online and Rich Client Samples projects (program XM18 and RXM18)

Reference
Attachment 
Attachment