[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Xalan giving TransformerException for a defined v

Subject: Re: Xalan giving TransformerException for a defined variable
From: "Brian J. Coan" <brianc@xxxxxxxxxxxxxx>
Date: Mon, 04 Oct 2004 12:39:16 -0700
babycenter 415
Anton, David and Marty,
 Thanks for you suggestions.  i rewrote the XSL per Anton below,
still got the Exception.  There must be something about the Xalan release
that is unhappy about a param/variable in an xsl:sort select expression.
per Marty's suggestion, i'm going to drop the variable entirely, can get
away with it in this template and hopefully in others similarly written.

Thanks again,
...bjc

Anton Triest wrote:

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


-- Brian J. Coan Software Developer BabyCenter, Inc. (415) 344-7606 direct (415) 537-0909 fax brianc@xxxxxxxxxxxxxx

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.