Salesforce

XML Properties (Magic xpi 4.7)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

XML Properties (Magic xpi 4.7)

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's Properties pane 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.

  • 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. This wildcard is not an actual element. You should ensure that you pass valid content to this placeholder. Magic xpi supports only one xs:any element in each level.

  • The xs:any compound or simple element cannot be used in the mapping as a source value. When the xs:any element is used in the source, the schema should be modified to describe the expected structure instead of the xs:any element.

  • 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.

The Properties pane contains the following properties:

Property

Description

Name

Enter a name for the schema. The name can contain up to 256 characters.

Description

Enter a description for the schema.

XSD File

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 XSD subtype (below) 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 XSD subtype (below) is selected, this field displays the full XML path that leads to the compound element that is mapped to the called flow.

XSD Sub Type

The Source schema's subtype. Select one of the following from the drop-down list:

  • File

  • IFC Model

  • XML Position Forwarding (Source only)

IFC Model

This property is available only when the IFC Model XSD subtype (above) is selected. It lets you select a predefined XSD to use as XML data. This provides an easy way of using the XML Schema Definition (XSD) for any component with a static XML interface. Click to open the Component List, and select the required component. When you use this subtype as a Destination, you can pass parameters to an XML file to configure any component with a static XML interface.

By default, the Destination IFC Models 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 Studio, and then rebuild the project. However, when the Append Data property is set to Yes, the Destination IFC Models will always be loaded to a DOM.

XML Position Forwarding
(Source only)

This property is available only when the XML Position Forwarding XSD subtype (above) is selected. It 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.

Source/Destination Type

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

  • File: If you select file, the File Path property (below) 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.

File Path

If you selected File in the Source/Destination Type property (above), click to use the Expression Editor to create an expression or condition that will locate the file.

Variable

If you selected Variable in the Source/Destination Type property (above), click to open the Variable List. Select a variable and then click Select.

Append Data
(Destination only)

Select one of the following from the drop-down list to append the new mapping to work with existing XML files:

  • No

  • Yes

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

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 one of the following from the drop-down list to determine whether you want to perform this validation:

  • No

  • Yes

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 Yes, make sure that in runtime the XSD file that you set will be located where you defined it.

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

For Source XML files, the XML validation begins and if the XML file is validated, the mapping is executed. If the validation fails, the mapping aborts.

For Destination XML files, the Data Mapper creates the file and then the validation begins. If the validation fails, an error will appear. However, the XML file is not deleted.

Recursion Depth

This property sets the maximum number of recursion instances.

There are instances in which a certain structure is repeated within itself, in other words recursively. To avoid an indefinite loop, 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, element A has child element B and child element B has a child element that refers to element A (the parent). This is helpful for personnel or customer lists where the same information is repeated.

For no recursion, enter 1.

This property is only relevant for elements that are recursive.

Data Format

Click 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.

Streaming Parser
(Source only)

The streaming XML parser allows the Data Mapper to handle large XML documents. Select one of the following from the drop-down list:

  • No

  • Yes

The streaming parser has the following limitations:

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

  • It is not possible to perform XML validation. This property is disabled if the XML Validation property (above) is set to Yes.

  • 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 property is disabled if the XML Position Forwarding XSD subtype (above) is selected.

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 Calculated Value to override the behavior.

By default, this property is selected.

Only Alpha type nodes are affected by this property.

See also: NullifyXMLSourceNonExistentTagValue

XML 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.

Reference
Attachment 
Attachment