[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] conditional display of content


Subject: [xsl] conditional display of content
From: "Ganesh Babu N" <nbabuganesh@xxxxxxxxx>
Date: Tue, 27 May 2008 10:51:31 +0530

Dear All,

This is the XML file:

<pbl:cast xml:id="dea0000038">
.....
......
<pbl:castmember xml:id="dea0000042">
<db:person xml:id="dea0000043">
<db:personname>Katherine Alexander</db:personname> </db:person>
<pbl:role xml:id="dea0000044"> <db:personname>LINDA</db:personname>
</pbl:role>
</pbl:castmember>
......
.......
</pbl:cast>
......
.....
.....
.....
<pbl:speaker xml:id="dea0000111"><pbl:roleref
xlink:role="http://docbook.org/xlink/role/olink"
xlink:href="9780141182742_DeathSalesman_001_INC.xml#dea0000044"/></pbl:speaker>
......
....
.....
<pbl:speaker xml:id="dea0000111"><pbl:roleref
xlink:role="http://docbook.org/xlink/role/olink"
xlink:href="9780141182742_DeathSalesman_001_INC.xml#dea0000044"/></pbl:speaker>


My requirement is to display the corresponding the role/personname in
the speaker tag. The condition is id and href should match.

<xsl:template match="pbl:roleref>
      <xsl:if test="substring-after(@href),#) =
//pbl:castmember/pbl:role/@xml:id">
            <xsl:value-of select="//pbl:castmember/pbl:role/personname"/>
      </xsl:if>
</xsl:template>


I am not getting the output. Please let me know where I am going wrong.

Regards,
N. Ganesh Babu


Current Thread
Keywords
xml