Subject: RE: RE: [xsl] help with select From: "Jiang, Peiyun " <Peiyun.Jiang@xxxxxxxxxxxxxx> Date: Thu, 9 Feb 2006 12:27:51 -0500 |
Thanks. <xsl:variable name="author" select="." /> <xsl:when test="count(./footnote|//footnote[@id=$author/@fnref]) = 1"> works. I still wonder if the "." in footnote[@id=./@fnref] is always referring to footnote. Peiyun -------------- Here is the output I want in HTML: K. Lspez-Bujol,<sup>b, [1]</sup> F. Zhang,<sup>a, c, [1]</sup> and S. Ge<sup>a, b, [1]</sup> <sup>a</sup>This is the second affiliation.<br /> <sup>b</sup>This is the second affiliation.<br /> <sup>c</sup>This is affiliation three.<br /> -----Original Message----- From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] Sent: February 9, 2006 12:02 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: RE: [xsl] help with select OK, now we're getting somewhere, how about an example of the output you want? -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: Jiang, Peiyun <Peiyun.Jiang@xxxxxxxxxxxxxx> Sent: Thu, 9 Feb 2006 11:44:58 -0500 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: [xsl] help with select Here is a simplified example: <authors> <author fnref="fn1" affref="aff2" paref="par1"> <sequence>1</sequence> <fname>K.</fname><lname>Lspez-Bujol</lname> <footnote id="fn1">These authors contributed equally to this work.</footnote> </author> <author affref="aff1 aff3" corresponding="yes" fnref="fn1"> <sequence>2</sequence> <fname>F.</fname> <lname>Zhang</lname> </author> <author affref="aff1 aff2" fnref="fn1"> <sequence>3</sequence> <fname>S.</fname> <lname>Ge</lname> </author> <affiliation affid="aff1">This is the second affiliation.</affiliation> <affiliation affid="aff2">This is the second affiliation.</affiliation> <affiliation affid="aff3">This is affiliation three.</affiliation> </authors> Peiyun -----Original Message----- From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] Sent: February 9, 2006 11:34 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] help with select It would help if you posted the XML you are transforming. -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: Jiang, Peiyun <Peiyun.Jiang@xxxxxxxxxxxxxx> Sent: Thu, 9 Feb 2006 11:20:28 -0500 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: [xsl] help with select I'm trying to made the following code work: ./footnote|//footnote[@id=./@fnref] I want to select the child footnote element of author and any footnote that its id attribute matches the fnref attribute of the author. In footnote[@id=./@fnref], is "." referring to author or to footnote? How do you refer author? Thanks. Peiyun <xsl:template match="author"> <!-- something here --> <xsl:choose> <xsl:when test="count(./footnote|//footnote[@id=./@fnref]) = 1"> <xsl:apply-templates select="./footnote|//footnote[@id=./@fnref]"/> </xsl:when> <xsl:when test="count(./footnote|//footnote[@id=./@fnref]) > 1"> <xsl:for-each select="./footnote|//footnote[@id=./@fnref]"> <xsl:choose> <xsl:when test="position() = last()"> <xsl:apply-templates select="." /> </xsl:when> <xsl:when test="position() != last()"> <xsl:apply-templates select="." /> <sup>,<xsl:text> </xsl:text></sup> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:when> </xsl:choose> <!-- some other things here --> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: RE: [xsl] help with select, cknell | Thread | [xsl] Handling CDATA element, Thorsten Scherler |
Re: [xsl] Grouping with keys, Silvia Liberto | Date | Re: [xsl] Translating XHTML or XML , Luana Knoff |
Month |