Salesforce

XML Handling - Methods (Magic xpi 4.5)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XML Handling - Methods

Double-click or right-click on the component and select Configuration from the context menu, the XML Handling Component Configuration dialog box opens.

The XML Handling Component Configuration dialog box contains the Source Type field. Here, you should select the XML data source that you want to use. The following table describes these sources.

Source Type

Action

File

If you select File as your Source Type, you should enter the full file path of the XML file whose data you want to use. You can click to use the Expression Editor to enter this path.

Variable

If you select Variable as your Source Type, you should click to open the Variables List. Here, you can select the variable that holds the required XML data.

The following methods are used to configure the XML Handling component:

Name

Parameters

Description

Check Exists returns a true value if an XML element or an XML attribute is located by the XML's element path.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Exists

Click to open the Variables List. Select a variable to hold the result of the check.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Count returns the number of occurrences of an XML element or an XML attribute according to its path.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Count

The number of occurrences of a given element in a specified path.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Delete Attribute deletes an XML attribute.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Delete Element deletes an XML element.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Find Element Index returns the index of an XML element that has a value equal to a specified value.

Find By

There are three ways to find an element. Select one of the following ways from the drop-down list:

  • Element Value (default)

  • Attribute Value

  • Child Element Value

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

The attribute name of the multi-occurrence element whose index needs to be found.

Click to open the Expression Editor, and then enter the attribute name.

This parameter is available only if the Find By parameter is set to Attribute Value.

Child Element Name

Click to open the Expression Editor, and then enter the child element name. You should only do this if you want to find the index of a compound element.

This parameter is available only if the Find By parameter is set to Child Element Value.

Value To Be Compared

The value to which the value of the element, attribute, or child element should be compared.

Click to open the Expression Editor, and then enter the required value.

Begin At

The point at which the index starts in the element path.

Element Index

Click to open the Variables List. Select a variable where the element index is returned after it has been found, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Get Alias retrieves the alias associated with a namespace for the root element.

Namespace URI

An alphanumeric value representing a namespace Uniform Resource Identifier (URI).

Click to open the Expression Editor, and then enter the required value. An empty URI is not allowed.

Alias

Returns an alphanumeric string representing the alias associated with the URI. If the URI is considered the default namespace, an empty string is returned. If an error occurs, or there is no matching alias for the URI, a null value is returned.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Get Attribute Value returns the value of an XML element or an XML attribute according to its element path.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Returned Value

The requested attribute's value. If the XML parsing process is successfully completed, the attribute's value is returned. If not, an empty string is returned.

Click to open the Variables List. Select a variable where the value is returned, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Get Element Alpha Value returns the Alpha value of an XML element or an XML attribute according to its element path.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Returned Value

The requested attribute's Alpha value. If the XML parsing process is successfully completed, the attribute's Alpha value is returned. If not, an empty string is returned.

Click to open the Variables List. Select a variable where the Alpha value is returned, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Get Element BLOB Value returns the BLOB value of an XML element or an XML attribute according to its element path.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Returned Value

The requested attribute's BLOB value. If the XML parsing process is successfully completed, the attribute's BLOB value is returned. If not, an empty string is returned.

Click to open the Variables List. Select a variable where the BLOB value is returned, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Get XML Encoding retrieves the encoding of an XML document.

Encoding

Returns an Alpha string that provides the encoding for the XML file.

Click to open the Variables List. Select a variable where the encoding is returned, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Insert Attribute inserts an XML element at a specified location in an XML document or adds an attribute to an existing XML element.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Value To Be Inserted

The value of the XML attribute.

Click to open the Expression Editor. Enter the required value.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Insert Element Alpha inserts an XML element with an Alpha value at a specified location in an XML document.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Value To Be Inserted

The Alpha value of the XML element.

Click to open the Expression Editor. Enter the required Alpha value.

Reference

The name of the referenced element. The new element will be located either before or after that element, depending on the value selected in the Relative Location parameter.

Relative Location

Where the newly inserted element is located, with respect to the referenced element defined in the Reference parameter. Select one of the following locations from the drop-down list:

  • After (default)

  • Before

Auto Convert

Converts the value into a valid XML string. Select one of the following from the drop-down list:

  • Yes (default)

  • No

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Insert Element BLOB inserts an XML element with a BLOB value at a specified location in an XML document.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Value To Be Inserted

The BLOB value of the XML element.

Click to open the Expression Editor. Enter the required Alpha value.

Reference

The name of the referenced element. The new element will be located either before or after that element, depending on the value selected in the Relative Location parameter.

Relative Location

Where the newly inserted element is located, with respect to the referenced element defined in the Reference parameter. Select one of the following locations from the drop-down list:

  • After (default)

  • Before

Auto Convert

Converts the value into a valid XML string. Select one of the following from the drop-down list:

  • Yes (default)

  • No

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Modify Attribute modifies the value of an attribute.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Attribute Name

Attributes are used to specify a single property for an XML element, by using a name/value pair.

Click to open the Expression Editor. Enter the XML attribute's name.

Value To Be Modified

The value of the XML attribute that you want to modify.

Click to open the Expression Editor. Enter the required value.

Create Always

Governs whether an attribute will be created if it does not already exist in the XML.

Select one of the following from the drop-down list:

  • No (default)

  • Yes

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Modify Element Alpha modifies the Alpha value of an XML element.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Value To Be Modified

The Alpha value of the XML element that you want to modify.

Click to open the Expression Editor. Enter the required value.

Create Always

Governs whether an attribute will be created if it does not already exist in the XML.

Select one of the following from the drop-down list:

  • No (default)

  • Yes

Auto Convert

Converts the value into a valid XML string. Select one of the following from the drop-down list:

  • Yes (default)

  • No

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Modify Element BLOB modifies the BLOB value of an XML element.

Element Path

Click to open the Expression Editor. Enter a string representing the XML element path. For more information on using the correct XML element path syntax, click here.

Value To Be Modified

The BLOB value of the XML element that you want to modify.

Click to open the Expression Editor. Enter the required value.

Auto Convert

Converts the value into a valid XML string. Select one of the following from the drop-down list:

  • Yes (default)

  • No

Create Always

Governs whether an attribute will be created if it does not already exist in the XML.

Select one of the following from the drop-down list:

  • No (default)

  • Yes

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Set Namespace associates an alias with a namespace URI for the root element.

Namespace URI

An alphanumeric value representing a namespace Uniform Resource Identifier (URI).

Click to open the Expression Editor, and then enter the required value. An empty URI is not allowed.

Alias

Returns an alphanumeric string representing the alias associated with the URI. If this string is empty, Magic xpi uses the default namespace.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Set XML Encoding sets the encoding of an XML document that was opened for Write access.

Encoding

An Alpha string representing the encoding used for an XML function to add data to the XML document.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Validate returns a list of validation errors. Any changes made to an XML document will not be seen until the XML Handling step is complete.

Schema File URL

The URL or file path (HTTP or local) of a schema file.

Click to open the Expression Editor, and then enter the required URL or file path.

Logical names are not supported for this parameter.

Validation Warnings/Errors

Returns an XML containing validation errors and/or warnings.

Click to open the Variables List. Select a variable where the validation errors and warnings are returned, and then click Select.

Error Code

An XML Handling error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Reference
Attachment 
Attachment