Salesforce

DbXmlMixedSet (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DbXmlMixedSet (Magic xpa 3.x)

Sets a text value into a mixed-content XML element.

Syntax:

DbXmlMixedSet(Source, Path, Element, Value)

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 added or replaced. If the value is empty, the first node will be added or replaced. If the value is not empty, the node after the specified element will be added or replaced. If the element does not exist, an empty string will be returned.

Value – A string (Alpha/Unicode/Blob). The value of the text node that the function will add. If there is already a text node defined, the value will be modified (replaced).

Returns:

A logical. Returns True if the text node was added or replaced successfully. Otherwise, it returns False. The function will return false if the XML data source is opened in read mode.

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 replace the first text node of the /root/child, use:

DbXmlMixedSet ('1'DSOURCE, '/root/child', '','UpdatedText1')

To add a text node after elem1 of the /root/child, use:

DbXmlMixedSet ('1'DSOURCE, '/root/child', 'elem1','UpdatedText2')

See also:

DbXmlMixedGet

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

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

Reference
Attachment 
Attachment