View Single Post
  #2 (permalink)  
Old Oct 3rd, 2006, 06:54
svk2006 svk2006 is offline
New Member
Join Date: Oct 2006
Location: Pune, India
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [HELP] XSL silly question

Hello,
please try following xsl for your problem....

<?xml version="1.0"?>
<xsl:stylesheet xmlnssl="
http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="segment">
<P>
Segment matched<xsl:value-of select="@Id"/>
<xsl:for-each select="type">
<xsl:if test=".='Green' and @Id='A01'"><br>
Value of A02 when A01 is Green:</br>
<xsl:for-each select="../type">
<xsl:choose>
<xsl:when test="@Id='A02'">
<xsl:value-of select="."/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</P>
</xsl:template></xsl:stylesheet>


Does this solve your problem?
Regards,
Reply With Quote