Here is a simplified example:
<authors>
<author fnref="fn1" affref="aff2" paref="par1">
<sequence>1</sequence>
<fname>K.</fname><lname>López-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(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com]
Sent: February 9, 2006 11:34 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] help with select
It would help if you posted the XML you are transforming.
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: Jiang, Peiyun <Peiyun(_dot_)Jiang(_at_)nrc-cnrc(_dot_)gc(_dot_)ca>
Sent: Thu, 9 Feb 2006 11:20:28 -0500
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] help with select
I'm trying to made the following code work:
./footnote|//footnote[(_at_)id=(_dot_)/@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[(_at_)id=(_dot_)/@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[(_at_)id=(_dot_)/@fnref]) = 1">
<xsl:apply-templates
select="./footnote|//footnote[(_at_)id=(_dot_)/@fnref]"/>
</xsl:when>
<xsl:when
test="count(./footnote|//footnote[(_at_)id=(_dot_)/@fnref]) > 1">
<xsl:for-each
select="./footnote|//footnote[(_at_)id=(_dot_)/@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>
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--