Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying value of an attribute based on anothers value

Status
Not open for further replies.

jatkinson

Technical User
Nov 14, 2001
406
GB
I have a number of elements in an xml doc that look like the following:

<PRACTICE FIELDNAME=&quot;*****&quot; FIELDVALUE=&quot;******&quot;></PRACTICE>

In a cell in my stylesheet I want to be able to display the fieldvalue of a certain practice element only if the fieldvalue of another element is equal to a certain value.

I've tried the following based on adding bits of code I've learnt already, but this doesn't work. Any ideas please?

<xsl:for-each select=&quot;CLIENTCONNECT/MATTER/PRACTICE&quot;>
<xsl:if test=&quot;@FIELDNAME[. $eq$ '*********']&quot;>
<xsl:choose>
<xsl:when test = &quot;@FIELDVALUE[.$eq$ '*********']&quot;>
<td bgcolor=&quot;#999999&quot;> <div align=&quot;center&quot;><font size=&quot;3&quot; face=&quot;Arial, Helvetica, sans-serif&quot;>
<xsl:for-each select=&quot;CLIENTCONNECT/MATTER/PRACTICE&quot;> <xsl:if test=&quot;@FIELDNAME[. $eq$ '************']&quot;>
<xsl:value-of select=&quot;@FIELDVALUE&quot;/>
</xsl:if>
</xsl:for-each></font></div></td>
</xsl:when>
<xsl:eek:therwise>
<td></td>
</xsl:eek:therwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top