Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Xalan giving TransformerException for a defined variable

From: Anton Triest <anton@-------->
To:
Date: 10/1/2004 3:42:00 PM
David Carlisle wrote:



The variable use looks correct although if you always call it with
<xsl:with-param name="shippedOrder" select="."/>
in your actual code then you could drop th eparam as the current node
is still the current node in the called template, you don;t need to pass
it directly.

and even if you want to call it with some other node in the select, you 
could drop the param

by using apply-templates with a mode instead of call-template:



<xsl:template match="ORDER">
   <xsl:element name="Shipment">
       <xsl:apply-templates select="." mode="generate-containers"/>
   </xsl:element>
</xsl:template>

<xsl:template match="*" mode="generate-containers">

   <xsl:variable name="shippedOrder" select="."/>

   <xsl:variable name="listoftrackingnumbers">

       <xsl:for-each select=".//PACKAGE[generate-id(.) = 
generate-id(key('container-group', TRACKING_NUMBER)[1])]">

           <xsl:sort 
select="count($shippedOrder/ORDER_DETAIL[.//PACKAGE/TRACKING_NUMBER = 
current()/TRACKING_NUMBER])"

               order="ascending" data-type="number"/>

           <xsl:value-of select="concat(TRACKING_NUMBER, '~')"/>

       </xsl:for-each>

   </xsl:variable>

</xsl:template>



Anton


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent