Subject: Re: [xsl] Display order issue From: Mukul Gandhi <mukulgw3@xxxxxxxxx> Date: Wed, 8 Oct 2003 18:23:28 -0700 (PDT) |
Hi Joseph, I guess the following XSL is needed -- <xsl:for-each select="B1"> <xsl:value-of select="." /> <xsl:value-of select="following-sibling::B2[1]" /> ( <xsl:value-of select="following-sibling::B3[1]" /> ), <xsl:value-of select="following-sibling::B2[2]" /> ( <xsl:value-of select="following-sibling::B3[2]" /> ) </xsl:for-each> Regards, Mukul --- Joseph Tan <Joseph.Tan@xxxxxxxxxxxxxxxxxx> wrote: > Current display: > American journal of cardiology > MDConsult (Full-Text), Elsevier (Full-Text) > > Desired display: > American journal of cardiology > Elsevier (Full-Text), MDConsult (Full-Text) > > XML input: > <B1>American journal of cardiology</B1> > <B2>MDConsult</B2> > <B2>Elsevier</B2> > <B3>http://home.mdconsult.com</B3> > <B3>http://www.sciencedirect.com</B3> > <B7>2</B7> > <B7>1</B7> > > Note: The first occurance of B2 is related to the > first occurance of B3 > (which is the URL for the text "Full-Text") and B7 > (the priority display > order). The second occurance of B2 is related > second occurance or B3 > and B7...etc. > > XSL Code: > <xsl:for-each select="$items[name()='B2']"> > <xsl:variable name="pos" select="position()"/> > <xsl:variable name="url" > select="following-sibling::B3[$pos]"/> > <xsl:value-of select="."/> > <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> > > Any ideas how to solve this? > > Thanks in advance! > > Joseph > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com 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 | RE: [xsl] Display order issue, Joseph Tan |
Re: [xsl] looping problem, <xsl: fo, Mukul Gandhi | Date | [xsl] topological sort, Bill Keese |
Month |