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

RE: using position() and last() with join

Subject: RE: using position() and last() with join
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 29 May 2008 17:21:23 +0100
RE:  using position() and last() with join
You haven't shown us what $lessonFile is, but my guess is that it's a
singleton document node. If that's true, then position() and last() are both
1, so position()!=last() is false.

Did you want the newlines between the things copied by the xsl:copy-of,

Michael Kay

> -----Original Message-----
> From: Terry Ofner [mailto:tofner@xxxxxxxxxxx] 
> Sent: 29 May 2008 17:03
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  using position() and last() with join
> I am attempting to insert a return (&#10;) after each element 
> but the last of a node set generated by a join. I am building 
> a table  in which one or more lesson names will be pulled 
> into the right-hand cell of each row. The join works fine.
> Here is the part of the stylesheet in question:
>   <xsl:for-each-group select="current-group()/SS" 
> group-by="."> <!--left-hand cell text selected from main xml 
> document-->
>             <Cell aid:table="cell" aid:crows="1" aid:ccols="1"  
> aid:ccolwidth="342.5">
>                <xsl:copy-of select="node()"/>
>            </Cell>
> <!--right-hand cell; nodes from $lessonFile-->
>           <Cell aid:table="cell" aid:crows="1" aid:ccols="1"  
> aid:ccolwidth="197.">
>                <xsl:variable name="skillNumber" 
> select="current-group ()/../@skill"/>
>                    <xsl:for-each select="$lessonFile">
>                      <xsl:copy-of 
> select="key('lessonName_by_num', $skillNumber)/child::node()" />
> <!--the if statement below does nothing here or directly 
> above the copy-of line-->
>                      <xsl:if test="position() != last()"> 
> <xsl:text>&#10;</xsl:text> </xsl:if>
>           </xsl:for-each>
>        </Cell>
>               </xsl:for-each-group>
> Thanks in advance for any suggestions.
> Terry Ofner

Current Thread


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.
First Name
Last Name
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.