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:
|
|
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:
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
|