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

Re: Stumped: XSL 1.0 recursive template

Subject: Re: Stumped: XSL 1.0 recursive template
From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Nov 2010 15:33:04 -0500
Re:  Stumped: XSL 1.0 recursive template
On Tue, Nov 16, 2010 at 2:09 PM, daniel whitney <dbf.whitney@xxxxxxxxx>
wrote:
> Sorry if this gets posted twice ...
>
> I'm stumped. I cannot figure out why the @desc test in the
> financialTemp template is always evaluating to true, when the values
> being output are different.
> I'm simply trying to remove lines with the same desc attribute value
> in the RECORDSECTION[@colformat='colbody'] elements.

The test is:   $fincodeParam = $nextRecordParam/@desc

This will evaluate to true if the string value of $fincodeParam (the
value of the "desc" attribute of the RECORDSECTION currently being
processed) is equal to the value of the "desc" attribute of ANY
following-sibling RECORDSECTION whose "colformat" attribute has a
value of "colbody".

I think you'll get what you want by putting a "[1]" before "/@desc" in
the above test.

-Brandon :)

>           <xsl:for-each select="//RECORDSECTION[@colformat='colbody'][1]">
>             <xsl:call-template name="financialTemp">
>               <xsl:with-param name="nextRecordParam"
> select="following-sibling::RECORDSECTION[@colformat='colbody']"/>
>               <xsl:with-param name="fincodeParam" select="@desc"/>
>             </xsl:call-template>
>           </xsl:for-each>
>
>   <xsl:template name="financialTemp">
>     <xsl:param name="nextRecordParam"/>
>     <xsl:param name="fincodeParam"/>
>
>     <xsl:if test="$nextRecordParam[1]">
>       <xsl:choose>
>         <xsl:when test="$fincodeParam = $nextRecordParam/@desc">
[...]
>         </xsl:when>
>         <xsl:otherwise>
[...]
>         </xsl:otherwise>
>       </xsl:choose>
>       <xsl:call-template name="financialTemp">
>         <xsl:with-param name="nextRecordParam"
> select="$nextRecordParam[position() &gt; 1]"/>
>         <xsl:with-param name="fincodeParam"
select="$nextRecordParam/@desc"/>
>       </xsl:call-template>
>     </xsl:if>
>   </xsl:template>

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.