Using the XSL Editor main window

When you open a mapping rule building area using the XSL Editor, the mapping rule building area is displayed in the XSL Editor main window.

In the XSL Editor main window, the left pane shows a hierarchical view of the source DTD that is labeled "Source Schema." The right pane shows a hierarchical view of the target DTD that is labeled "Target Schema."

Creating a mapping rule

Element-to-element mapping

Select and drag an element from the source hierarchy and drop it onto an element in the target hierarchy. An XSL rule is generated and displayed in the Mapping Rule view located at the bottom of the window.

Here is an example of a generated XSL rule:

  <xsl:template match="merchant">
    <xsl:element name="MERCHANT">
    </xsl:element>
  </xsl:template>

Note: Any required but non-existing ancestor relationships are automatically generated.

Attribute-to-attribute mapping

Select and drag an attribute from the source hierarchy and drop it onto an attribute in the target hierarchy. An XSL rule is generated and displayed in the Mapping Rule view located at the bottom of the window.

Here is an example of a generated XSL rule:

  <xsl:attribute name="MEADDR1">
    <xsl:apply-templates select="@mecmail1"/>
  </xsl:attribute>

Note: Any required but non-existing ancestor relationships are automatically generated.

Creating a custom mapping expression

To create a custom mapping expression, first select an element or attribute from the target hierarchy. Then, right-click and select the Create Custom Expression menu. The Create Custom Expression window displays with a list of available Templates and Rule Expressions in two drop-down menus. Complete the custom expression by using the following steps:

  1. Select a template to which the custom expression is to be added.
  2. Select a rule expression to be created (Constant Expression for example).
  3. Type a value in the Value column for each parameter listed in the table, and press Enter to commit the value.
  4. Click OK to complete the creation step; or click Cancel to cancel without creating a rule.

The generated XSL rule is based on the custom expression defined in the rule-configuration file (XSLRuleConfig.xml). You can modify the rule-configuration file and add new rules if needed. To make a rule available for use in the Rule Expressions list, set the Visibility attribute for that rule to "true."

Deleting a mapping rule

To delete a mapping rule:

  1. Select a rule from the Mapping Rule table.
  2. Right-click, and select Delete.

    The rule and all its descendents are deleted.

    Note: The updated mapping rules and generated XSL rules are persisted automatically.

Processing an XML transformation

To process an XML transformation:

  1. Click Tools > Transform to bring up the Process Transform window.
  2. Complete the required fields:
    1. In the Input XML File field, type or browse to the path and name of the source XML data file.
    2. In the XSL Rule File field, type or browse to the path and name of the mapping-rule file to be used for the transformation.

      If a mapping rule building area is open, this field is pre-filled with the mapping-rule file path currently open in the mapping rule building area.

  3. In the Output XML File field, type or browse to a path and name for the new XML data file to be created during the transformation process.

Feedback