Salesforce

XMLDelete (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XMLDelete (Magic xpa 2.x)

Deletes an XML element or attribute.

Syntax:

XMLDelete (generation, device, element path, attribute name)

Parameters:

generation – A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on.

device – A number that represents the sequence number of the I/O device entry in the current task.

element path – A string representing the XML element path. The XML element path syntax is:
/element name[[index]] [/element name[[index]]…]

where:

element name is the name of an XML element. You can assign an alias that is separated from the element name by a colon symbol (:), for example, al1:My_Element.

index is the index of a specified occurrence of an element that has multiple occurrences. The index value must be greater than 0. Negative values are invalid.

attribute name – The name of an XML attribute. If you are inserting an XML attribute, you must specify the attribute name. If you are inserting an XML element, leave this parameter blank.

Returns:

A numeric value. 0 is returned when the XML element or attribute path is deleted. When this function fails, Magic xpa returns one of the following error codes:

-1 – Invalid I/O file

-2 – Inserted element or attribute alias is not defined

-3 – The I/O file not opened in Write mode

-4 – Element path not found

-11 – Invalid path, non-valid index

-20 – Invalid XML file (XML parsing failed)

For a full list of error codes, see XML Error Codes.

Exceptions:

This function is not supported for Rich Client tasks.

Example:

XML Delete Examples

See also:

XML Namespaces

XML Error Codes

How Do I Retrieve / Update / Insert Data According to a Certain Path in an XML Document?

The Online and Rich Client Samples projects (program XM12 and RXM12)

Reference
Attachment 
Attachment