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

Re: XSL Trnasfromation - Is it possible to do a bottom

Subject: Re: XSL Trnasfromation - Is it possible to do a bottom up transformation?
From: "Raghu Narayan Koratagere" <raghu.k.n@xxxxxxxxx>
Date: Mon, 19 Nov 2007 16:41:15 +0530
Re:  XSL Trnasfromation - Is it possible to do a bottom
Michael,
Thanks for your response. Yes, recursive function is the answer to my
problem here. I was not aware of this construct as I am new to XSL. I
guess I  shd be able to progress in this direction.

Difference between case 2 and 3 is as below:
Case 2 - get sum of unitprice all the children items divided by quanity
Case 3 - get sum of unitprice of only the first level children items


> <xsl:function name="f:unitPrice" as="xs:decimal">
>   <xsl:param name="item" as="element(orderline)">
>   <xsl:choose>
>     <xsl:when test="$item/itemTypeCode = 1">
>       <xsl:sequence select="$item/netPrice"/>
>     </xsl:when>
>     <xsl:when test="$item/itemTypeCode = 2">
>       <xsl:sequence select="sum(for $c in $item/child::orderline
>                                 return f:unitPrice($c) * $c/quantity)"/>
>     </xsl:when>
>     <xsl:when test="$item/itemTypeCode = 3">
>       <xsl:sequence select="??"/>
>       <!-- I don't understand the difference between this and the previous
> case -->
>     </xsl:when>
>   </xsl:choose>
> </xsl:function>
>
> Michael Kay
> http://www.saxonica.com/

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.