[xsl] xsl query to determine image

Subject: [xsl] xsl query to determine image
From: "Sawyer, Larry" <Larry.Sawyer@xxxxxxx>
Date: Fri, 23 May 2003 10:41:39 -0400
I'm trying to write some xsl that will fill in a simple gif image given a
field value from the xml.  I have it working until I try and define which
image will be shown given the severity value (see where I put the comments).
I can't figure out how to define the image to be show given the severity

Please help.

<?xml version="1.0"?>

<xsl:template match="rootElement">
      <title>Curt OLTX</title>
    <body bgcolor="white">
      <table width="300px">

	  <xsl:sort select="site"/>


<xsl:template match="id">
  <xsl:variable name="tmpSite"><xsl:value-of select="site"/></xsl:variable>

    <xsl:when test="contains('DAL', substring($tmpSite,1,3)) or
contains('MKO', substring($tmpSite,1,3)) or contains('MRO',

      <xsl:if test="contains('DAL1',$tmpSite)">
        <tr><td colspan="4" align="center"><b>Dallas</b></td></tr>

      <xsl:if test="contains('MKO1',$tmpSite)">
        <tr><td colspan="4"

      <xsl:if test="contains('MRO1',$tmpSite)">
        <tr><td colspan="4"

<!-- This is the section where I'm having trouble.  Everything within the
comments section is breaking the xsl.  I did something similar for another
report where I defined the table background from the severity, but I can't
figure out how to do it in this report with the image -->

<xsl:template match="id">
  <xsl:param name="severity" />

  <xsl:variable name="unparsed-entity-uri">
      <xsl:when test="severity = 'MINOR'">Image2</xsl:when>
      <xsl:when test="severity = 'CRITICAL'">Image3</xsl:when>
   <td><xsl:value-of select="site"/><br>
	<img src="{unparsed-entity-uri('Image2')}" /> </br></td>   

<!-- End area that is breaking the report -->


<xsl:template match="servletPath"/>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread