...
Table of Contents | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Syntax
Code Block | ||||
---|---|---|---|---|
| ||||
<xslt key="string" [source="xpath"]> <property name="string" (value="literal" | expression="xpath")/>* <feature name="string" value="true| false" />* <resource location="string" key="string"/>* </xslt> |
...
...
UI Configuration
The parameters available for configuring the XSLT mediator are as follows.
Parameter Name | Description | |||||
---|---|---|---|---|---|---|
Key Type | You can select one of the following options.
| |||||
Key | This specifies the registry key to refer the XSLT to. This supports static and dynamic keys. | |||||
Source | This determines the element to which the given XSLT transformation should be applied via an XPath expression. If the source element is not specified, the XSLT transformation is applied to the first child of the SOAP body.
| |||||
Properties of the XSLT mediator | This section is used to inject properties set in the mediation flow to the XSLT script as XSLT parameters. These are referred from the XSLT in transformation using the Parameters relating to the properties are as follows.
| |||||
Features of the XSLT mediator | This section is used to specify features to be enabled/disabled in the XSLT transformation. For example, adding the Parameters relating to the features are as follows.
| |||||
Resources of the XSLT mediator | This section is used to import external XSLT scripts to the main XSLT scripts defined in the XSLT mediator. The XSLT scripts to be imported are first added as resources in the registry. Parameters relating to the resources are as follows.
|
Info | ||
---|---|---|
| ||
You can also configure the Mediator using XML. Click switch to source view in the Mediator window. |
...
Code Block | ||
---|---|---|
| ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="PARAM_NAME"></xsl:param> <xsl:template match="/"> <orders xmlns="http://services.samples"> <xsl:attribute name="id"> <xsl:value-of select="$PARAM_NAME"> </xsl:value-of></xsl:attribute> </orders> </xsl:template> </xsl:stylesheet> |
Example 3 - Adding XSLT imports as resources
...
Code Block |
---|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="//people/person" name="FILL_PPL"> <client> <firstname> <xsl:value-of select="firstname"> </xsl:value-of></firstname> <lastname> <xsl:value-of select="lastname"> </xsl:value-of></lastname> <age> <xsl:value-of select="age"> </xsl:value-of></age> <country> <xsl:value-of select="country"> </xsl:value-of></country> </client> </xsl:template> </xsl:stylesheet> |
xslt2.xslt
Code Block |
---|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:includeimport href="xslt1.xslt" /> <xsl:template match="/"> <clients> <xsl:for-each select="//people/person"> <xsl:call-template name="FILL_PPL"> ></xsl:call-template> </xsl:call-template></xsl:for-each> </clients> </xsl:template> </xsl:include></xsl:stylesheet> |
<xsl:include href="xslt1.xslt"> element indicates that the xslt1.xslt
is included in xslt2.xslt
.
...