Subject: Re: [xsl] Conditional processing by matching elements From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx> Date: Wed, 26 Dec 2001 19:16:55 +0200 |
I'm trying to match SERVICED from the SecondStruct structure with that of the FirstStruct structure and print out messageOne if the SERVSTAT="Y". If there is no matching SERVICEID in FirstStruct, print out messageTwo. For example, my output could look like this:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="kStat" match="Structure[@StructId='FirstStruct']/Row" use="@SERVICEID"/> <xsl:template match="root"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Structure"/> <xsl:template match="Structure[@StructId='SecondStruct']"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Row"> <xsl:value-of select="@SERVICEID"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="key('kStat', @SERVICEID)/@SERVSTAT = 'Y'">On</xsl:when> <xsl:otherwise>Off</xsl:otherwise> </xsl:choose> <xsl:text>
</xsl:text> </xsl:template> </xsl:stylesheet>
-- Oleg Tkachenko Multiconn International, Israel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Conditional processing by mat, Haque, Suraiya | Thread | [xsl] text::trim(), Srinivasan Guruswami |
[xsl] Same name Elements in more th, Mike Ferrando | Date | Re: [xsl] Same name Elements in mor, Oleg Tkachenko |
Month |