|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] An XSL:Choose Issue.
Hi! I'm having an XSLT issue with getting xsl:choose to work in the way I want it to. Any help would be appreciated. I have this XML fragment: <entry date.entered="05.02.2003" id="1.004" type="episode"> <episode date.aired="04.18.2000" id="reprimands" season="1">Reprimands (Episode #01-004)</episode> <body> <paragraph>Aired on 4/18/00, Stardate Unknown. Written and Directed by Starfleet. A discussion between Chief of Operations, Lieutenant Nevok, and Ensign Tyler near the Artifact is witnessed. A strange occurrence causes an equipment malfunction in Science Lab Two, but no explanation is obvious. Lieutenant Nevok is commanded to investigate. <entry.link to.entry="artifact">Artifact</entry.link><entry.link to.entry="balin.tarsis">Balin, Tarsis</entry.link><entry.link to.entry="byjos.chief">Byjos, Chief</entry.link><entry.link to.entry="nevok">Nevok</entry.link><entry.link to.entry="stone.damien">Stone, Damien</entry.link><entry.link to.entry="tyler.wendy">Tyler, Wendy</entry.link> </paragraph> </body> </entry> I run it through this XSL fragment: <xsl:template match="entry.link">
<xsl:choose>
<xsl:when test="position() = 1">
SEE ALSO: <i><a href="#{@to.entry}"><xsl:apply-templates/></a>; </i>
</xsl:when>
<xsl:when test="position() = last">
<i><a href="#{@to.entry}"><xsl:apply-templates/></a>.</i>
</xsl:when>
<xsl:when test="(not(position() = 1)) or (not(position() = last))" >
<i><a href="#{@to.entry}"><xsl:apply-templates/></a>; </i>
</xsl:when>
</xsl:choose>
</xsl:template>What I'm getting is this: <a name="1.004"></a> <b>Reprimands (Episode #01-004)</b> <p>Aired on 4/18/00, Stardate Unknown. Written and Directed by Starfleet. A discussion between Chief of Operations, Lieutenant Nevok, and Ensign Tyler near the Artifact is witnessed. A strange occurrence causes an equipment malfunction in Science Lab Two, but no explanation is obvious. Lieutenant Nevok is commanded to investigate. <i><a href="#artifact">Artifact</a>; </i><i><a href="#balin.tarsis">Balin, Tarsis</a>; </i><i><a href="#byjos.chief">Byjos, Chief</a>; </i><i><a href="#nevok">Nevok</a>; </i><i><a href="#stone.damien">Stone, Damien</a>; </i><i><a href="#tyler.wendy">Tyler, Wendy</a>; </i> </p> What I -want- is this: <a name="1.004"></a> <b>Reprimands (Episode #01-004)</b> <p>Aired on 4/18/00, Stardate Unknown. Written and Directed by Starfleet. A discussion between Chief of Operations, Lieutenant Nevok, and Ensign Tyler near the Artifact is witnessed. A strange occurrence causes an equipment malfunction in Science Lab Two, but no explanation is obvious. Lieutenant Nevok is commanded to investigate. SEE ALSO: <i><a href="#artifact">Artifact</a>; </i><i><a href="#balin.tarsis">Balin, Tarsis</a>; </i><i><a href="#byjos.chief">Byjos, Chief</a>; </i><i><a href="#nevok">Nevok</a>; </i><i><a href="#stone.damien">Stone, Damien</a>; </i><i><a href="#tyler.wendy">Tyler, Wendy</a>. </i> </p> Thanks in advance! --->Ben XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








