Skip to end of metadata
Go to start of metadata

The XSLT solution has 2 templates. Refer to the XSLT Templating Javadocs while reading these configurations. Note how the JavaBean data is accessed via the "smooks-bean" Xalan extension.

The 1st XSLT template is for transforming the Tracking Numbers on the request and is very simple. It is implemented as a "Templatelet" and inlined in the Resource Targeting configuration i.e. not specified in a dedicated .xsl file (see the XSLT Resource Targeting Configurations):

	<xsl:value-of select="smooks-bean:select('trackingNumber')" />

The 2nd XSLT template is for transforming the Tracking Histories on the response:

<xsl:stylesheet xmlns:xsl=""

	<!-- Root template  -->
	<xsl:template match="*">
			<xsl:call-template name="outputTrackingNumber"/>

	<xsl:variable name="trackingNumberCount" select="smooks-bean:select('history.trackingNumbers.length')"/>
	<!-- Recursively called template for outputting the trackingNumber elements -->
	<xsl:template name="outputTrackingNumber">
		<xsl:param name="i" select="0"/>

		<xsl:if test="$i &lt; $trackingNumberCount">
					<xsl:variable name="ognl" select="concat('history.trackingNumbers[', $i, '].shipperID')" />
					<xsl:value-of select="smooks-bean:select($ognl)" />
					<xsl:variable name="ognl" select="concat('history.trackingNumbers[', $i, '].shipmentNumber')" />
					<xsl:value-of select="smooks-bean:select($ognl)" />
			<xsl:call-template name="outputTrackingNumber">
				<xsl:with-param name="i" select="$i + 1"/>


  • No labels