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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is xsl:if not working?

Status
Not open for further replies.

tburrows

Technical User
Oct 3, 2003
49
US
I am passing a parameter from an asp file to my xsl file. I know the parameter is being passed. Below is my stylesheet. For some reason it is not getting past the line <xsl:if test=&quot;book_id='$param1'&quot;> If I take out this line it works fine and outputs all the records. I am passing the parameter to output only the records that match. I know the parameter is being passed in. Any thoughts would be appreciated.

Tom



<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;<xsl:eek:utput method=&quot;html&quot;/>
<xsl:param name=&quot;param1&quot;/>
<xsl:template match=&quot;/&quot;>

<html>
<body>
<br/><xsl:value-of select=&quot;$param1&quot;/>
<xsl:for-each select=&quot;/datatable/jmmain_nmmain_jfacilty_archrg&quot;>

<xsl:if test=&quot;book_id='$param1'&quot;>

<table cellpadding=&quot;1&quot; width=&quot;85%&quot;>
<xsl:if test=&quot;book_id=book_id[not(.=preceding::book_id)]&quot;>
<tr>
<th width=&quot;15%&quot; align=&quot;right&quot;>Inmate:</th>
<td colspan=&quot;4&quot;><xsl:value-of select=&quot;concat(last,suffix,',',first,middle)&quot;/></td>
</tr>
<tr>
<th align=&quot;right&quot;>Age:</th><td colspan=&quot;4&quot;><xsl:value-of select=&quot;age&quot;/></td>
</tr>
<tr>
<th align=&quot;right&quot;>Race/Sex:</th><td colspan=&quot;4&quot;><xsl:value-of select=&quot;concat(race,'/',sex)&quot;/></td>
</tr>
<tr>
<th align=&quot;right&quot;>Booking Date:</th><td colspan=&quot;4&quot;><xsl:value-of select=&quot;bookdate&quot;/></td>
</tr>
<tr>
<th align=&quot;right&quot;>Booking Number:</th><td colspan=&quot;4&quot;><xsl:value-of select=&quot;book_id&quot;/></td>
</tr>
<tr>
<th width=&quot;15%&quot;>Cause Number</th>
<th width=&quot;10%&quot;>Fel/Misd</th>
<th>Charge</th>
<th width=&quot;10%&quot;>Bond Amount</th>
<th width=&quot;10%&quot;>Bond Type</th>
</tr>
</xsl:if>
<xsl:call-template name=&quot;booknumber&quot;/>
</table>

</xsl:if>

</xsl:for-each>
<xsl:value-of select=&quot;book_id&quot;/>
</body>
</html>
</xsl:template>

<xsl:template name=&quot;booknumber&quot;>
<tr>
<td width=&quot;15%&quot;><xsl:value-of select=&quot;docketno&quot;/>&#xA0;</td>
<td width=&quot;10%&quot;><xsl:value-of select=&quot;fel_misd&quot;/>&#xA0;</td>
<td><xsl:value-of select=&quot;chrgdesc&quot;/>&#xA0;</td>
<td width=&quot;10%&quot;><xsl:value-of select=&quot;bondamt&quot;/>&#xA0;</td>
<td width=&quot;10%&quot;><xsl:value-of select=&quot;bondtype&quot;/>&#xA0;</td>
</tr>
</xsl:template>

</xsl:stylesheet>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top