[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Display order issue
I moved xsl:variable within xsl:for-each and it works. I'm still very new at these. Thanks a lot for the explanation, Michael. Joseph >>> mhk@xxxxxxxxx Monday, October 13, 2003 11:54:06 AM >>> > -----Original Message----- > From: Joseph Tan [mailto:Joseph.Tan@xxxxxxxxxxxxxxxxxx] > Sent: 13 October 2003 17:20 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; mhk@xxxxxxxxx > Subject: RE: Display order issue > > > GREAT! This works. I manage to get the display order I want > but I have problem getting the URL (B3) to link correctly. > > Please take a look at this and let me know what I did wrongly. > > <xsl:variable name="url" select="../B3[number(current())]"/> > <xsl:for-each select="B7"> > <xsl:value-of select="../B2[number(current())]"/> > <xsl:text> (</xsl:text><a href="{$url}">Full-Text</a> > <xsl:text>)</xsl:text> > <xsl:if test="position()!=last()"> > <xsl:text>, </xsl:text> > </xsl:if> > </xsl:for-each> > Another case where I regret posting code. Do try to understand how it works before you use it or extend it. If you don't understand it, please ask for an explanation. The xsl:for-each over the B7 elements sets the context node to each B7 element in turn, it then selects the B2 element whose position is equal to the content of that B7 element. Why do you imagine that selecting a B3 element outside this for-each is going to do anything useful? Michael Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|