XML Functions (LR_XML) > Alphabetical List of Functions > lr_xml_delete


Example: lr_xml_delete XML Functions (LR_XML)

Deletes fragments from an XML string.

int lr_xml_delete( <List of specifications> [, <List of optional specifications> ] [, LAST]);
List of specifications For the following list of required specifications, use the following string format:"Specification=value"
XML: the XML Input String to query
ResultParam: the name of the output parameter containing the XML data after deleting the fragment.
Query: the XML Query on the input string XML.
List of optional specifications For the following list of optional specifications, use the following string format:"Specification=value"
SelectAll: If "yes", all elements matching the query will be processed. If "no", only the first match will be processed. Default is "no". See Multiple Query Matching
NotFound: See Continuing on Error
LAST A marker which indicates the end of the List of optional specifications

The lr_xml_delete function queries the XML input string XML and deletes the fragments of the XML tree that match the Query criteria. You can delete elements by specifying the element name or its attribute in the XML Query. The output parameter ResultParam contains the modified XML string subsequent to deletion,using the source document encoding. The output preserves the XML Character Encoding of the original document, independent of the input encoding. The input encoding uses the client's local encoding.

Note: After deleting the contents of an element, the empty element, e, is signified <e/>. For example, the string result after deleting the element c from the XML string: "<a><b><c></c></b></a>"
since the element b is now empty.

Return Values

See Return Values


See Parameterization