[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] Display order issue
Subject: RE: [xsl] Display order issue From: "Joseph Tan" <Joseph.Tan@xxxxxxxxxxxxxxxxxx> Date: Tue, 14 Oct 2003 10:53:02 -0500 |
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: [xsl] 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Display order issue, Michael Kay | Thread | [xsl] topological sort, Bill Keese |
RE: [xsl] badly need xsl help(prob , Benjamin Farrow | Date | [xsl] resetting a variable, Aananth.S |
Month |