Salesforce

XML Properties (Magic xpi 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XML Properties (Magic xpi 3.x)

When you select XML as a Source, you are mapping data from an XML file to a Destination. When you select XML as a Destination, you are creating an XML file. You use the XML Properties dialog box to enter the following information for mapping XML data:

  • Assign an XML Schema Definition (XSD) file. The XSD file defines the tags and schema used in the Source or Destination XML file.

  • Indicate the location of the XML file that you are using for the Source or that you are creating.

Note:

  • Mixed content (mixed="true") in XMLs is not currently supported.

  • By default, the Destination XMLs do not load to a DOM. If you want the Destinations to always load to a DOM, you need to close the Magic xpi Studio, set the XMLDomMapper special setting to N, open the Magic xpi Studio and rebuild the project. However, when the Append Data check box is selected, the Destination XMLs will always be loaded to a DOM.

  • Magic xpi supports the xs:any wildcard in the Data Mapper's Destination XML. The Data Mapper represents this wildcard with a placeholder, which is replaced by any content that is passed to it. You should ensure that you pass valid content to this placeholder. Magic xpi supports only one xs:any element in each level.
    Since version: V3.2

  • Float and double XML data types can handle lexical representation containing an optional E or e, followed by an exponent. For example, 1267.43233E12. However, you should be aware that the 18 character size limitation for numeric types remains unchanged.
    Since version: V3.2 SP2

The XML Source and Destination properties dialog boxes have the following properties:

Property

Description

Name

Enter a name for the schema.

Description

Enter a description for the schema.

XML Position Forwarding
(Source only)

This option enables the XML Source data to start mapping from the saved start position, by calling the flow.

This is valid when this flow is called by others.

Click to open the Schema List dialog box, which displays a list of all Data Mapper steps that call the current Data Mapper (the one that is being configured). Here, select the required Data Mapper step as the calling Data Mapper.

For more information, click here.

Since version: V3

XSD File

This is the path to the XML schema. You have to specify the exact path and file name for the XSD file. Using logical names here is very useful during deployment.

Click to browse to the location of the XSD file you want to use. Once you have set the XSD file, and have mapped a Source to a Destination, you cannot change it. If you try to change it, an information message tells you that it is not possible. When the XML Position Forwarding property (above) is selected, this field is updated and becomes read-only.

Data Source/Destination

Select where the Source information is located, or where to create the Destination file.

  • File: If you select file, a field is available to add the name and location of the XML file with the Source data or the Destination of the file you are creating. Click to open the Expression Editor. Use the Expression Editor to create an expression or condition that will locate the file. This allows you to define a dynamic location for the file. If you want to work with a static location, enter the full path to the file in the field or create a (flow, context, or global) variable that holds the full path to the file and select the variable from the Expression Editor.

  • Variable: Select a variable that contains an XML file with the data you want to use. Only BLOB type variables are available. The XML data must be contained in the BLOB.

When the XML Position Forwarding property (above) is selected, this field is updated and becomes read-only.

XML Root

Select the XML root that you want to map data to/from. This is only available when more than one root element is in the selected XSD file. Magic xpi automatically selects the first root element that it finds. When the XML Position Forwarding property (above) is selected, this field displays the full XML path that leads to the compound element that is mapped to the called flow.

Use Streaming Parser
(Source only)

Select this check box to use a streaming XML parser. This allows the Data Mapper to handle large XML documents.

The streaming parser has the following limitations:

  • The Data Source type can only be a file. This check box is disabled if a BLOB variable is selected in the Data Source property (above).

  • It is not possible to perform XML validation. This check box is disabled if the XML Validation check box (below) is selected.

  • Only single source compound mapping is allowed.

  • The values of elements that are below the mapped compound cannot be used. This restriction applies to mapping and expressions.

  • Single instance filters cannot be used.

  • Node replication is not allowed.

  • This check box is disabled if the XML Position Forwarding property (above) is defined.

Since version: V3.3

XML Validation

During runtime, the Data Mapper validates Source and Destination XMLs against their schemas, and provides an XML output containing all validation errors and warnings. Select this check box if you want to perform this validation. The XML validation output is available in the C.sys.LastErrorInfo system variable, and the C.sys.ErrorDescription variable contains the relevant Source or Destination details. If you select this check box, make sure that in runtime the XSD file that you set will be located where you defined it.

When the XML Position Forwarding property (above) is selected, this field displays the calling step validation settings.

Note:

XML validation is executed prior to the mapping. If the validation fails, the mapping will abort.

Append Data
(Destination only)

Select the check box to append the new mapping to work with existing XML files.

Note:

You need to map at least one compound node when you select the Append Data check box.

Recursion Depth

There are instances in which a certain structure is repeated within itself, in other words recursively. To prevent problems, Magic xpi needs to know the total depth to refer to. This property will determine how many times the structure of the selected XML file repeats. For example, if a parent node in the XML structure contains three children, enter 3 to repeat the structure (the parent and its children) three times. This is helpful for personnel or customer lists where the same information is repeated. For no recursion, enter 1.

XML File Encoding
(Destination only)

Select the language encoding (the language and character set) that is used for the Destination XML file. You can create several Destinations with different language encoding in the same Data Mapper. Click here to see the languages that are supported. See also the Project Data Encoding property in the Project Properties dialog box.

Since version: V3

Always Create Nodes
(Destination only)

By default, Magic xpi creates the mapped Destination nodes in the result XML file.

There is one scenario when the mapped Destination node is not created. This happens when Always Create Nodes is not selected and the mapped Source node is either:

  • An empty value

  • A Null value (when the Destination node does not support Null)

You can use a condition to override the behavior.

By default, this property is selected.

Note:

Only Alpha type nodes are affected by this check box.

See also: NullifyXMLSourceNonExistentTagValue

Since version: V3.1 SP1

This dialog box has the following buttons:

Button

Description

Data Format

Click this button to open the Default Data Format dialog box. Here, you can define the defaults that you want Magic xpi to use when presented with a certain data type. Click here for more information.

OK

Click this button to save your definitions and to exit the dialog box.

Cancel

Click this button to exit the dialog box without saving your changes.

Reference
Attachment 
Attachment