Please enable JavaScript to view this site.

Altova MapForce 2020 Professional Edition

This example illustrates how to import custom XSLT 1.0 functions into MapForce. The files needed for this example are available in the <Documents>\Altova\MapForce2020\MapForceExamples\ directory.

 

Name-splitter.xslt. This XSLT file defines a named template called "tokenize" with a single parameter "string". The template works through an input string and separates capitalized characters with a space for each occurrence.

cust-xslt1

Name-splitter.xml (the source XML instance file to be processed)

Customers.xsd (the source XML schema)

CompletePO.xsd (the target XML schema)

 

 

To add a custom XSLT function:

1.Select XSLT as transformation language (see Selecting a Transformation Language).

2.Click the Add/Remove Libraries button, in the lower area of the Libraries window. Alternatively, on the Tools menu, click Options, and then select Libraries.

3.Click Add, and browse for the XSL, or XSLT file, that contains the named template you want to act as a function, in this case Name-splitter.xslt.

dlg_import_xslt

4.Click OK. The XSLT file name appears in the Libraries window, along with the functions defined as named templates (in this example, Name-splitter with the tokenize function).

libraries_window_custom_xslt

 

To use the XSLT function in your mapping:

1.Drag the tokenize function into the Mapping window and map the items as show below.

map_xslt_name_splitter

2.Click the XSLT tab to see the generated XSLT code.

cust-xslt3a

Note:As soon as a named template is used in a mapping, the XSLT file containing the named template is included in the generated XSLT code (xsl:include href...), and is called using the command xsl:call-template.

 

3.Click the Output tab to see the result of the mapping.

cust-xslt4a

 

To remove custom XSLT libraries from MapForce:

1.Click the Add/Remove Libraries button, in the lower area of the Libraries window.

2.Click the XSLT library to be deleted, and then click Delete.

© 2019 Altova GmbH