RE: [xsl] help with select

Subject: RE: [xsl] help with select
From: "Jiang, Peiyun " <Peiyun.Jiang@xxxxxxxxxxxxxx>
Date: Thu, 9 Feb 2006 11:44:58 -0500
Here is a simplified example:

<author fnref="fn1" affref="aff2" paref="par1">
  <footnote id="fn1">These authors contributed equally to this
<author affref="aff1 aff3" corresponding="yes" fnref="fn1">
<author affref="aff1 aff2" fnref="fn1">
<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>


-----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:

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?



<xsl:template match="author">
    <!-- something here -->
	     <xsl:when test="count(./footnote|//footnote[@id=./@fnref]) = 1">
	        <xsl:apply-templates select="./footnote|//footnote[@id=./@fnref]"/>

	     <xsl:when test="count(./footnote|//footnote[@id=./@fnref]) > 1">
	        <xsl:for-each select="./footnote|//footnote[@id=./@fnref]">
	               <xsl:when test="position() = last()">
	                  <xsl:apply-templates select="." />
	               <xsl:when test="position() != last()">
	                  <xsl:apply-templates select="." />
	                  <sup>,<xsl:text> </xsl:text></sup>

  <!-- some other things here -->

Current Thread