RE: [xsl] Dropdown

Subject: RE: [xsl] Dropdown
From: "Martinez, Brian" <brian.martinez@xxxxxxxx>
Date: Tue, 22 Oct 2002 11:50:26 -0600
> From: Juan Carlos Gonzalez [mailto:jcgonz@xxxxxxxxx]
> Sent: Tuesday, October 22, 2002 11:37 AM
> Subject: [xsl] Dropdown
> 
> 
> Hi:
> 
> I'm trying to create a drop down list box dynamically,
> but I'm getting an error message cause the "select"
> tag is not being closed within the "if" tag. I have
> tried replacing the < and > sign with the &lt; and
> &gt; but it's still not working. Any ideas? 
> 
> <xsl:if test="some condition">
>   <select name="cat">
> </xsl:if>
> 
> ...the folowing template will create the options tag
> amoung other things ...
> 
> <xsl:apply-templates select="cat"/>
> 
> <xsl:if test="some condition">
>   </select>
> </xsl:if>

That isn't valid XSLT.  The select element must be closed within the scope
of the first xsl:if element.  Assuming that you have a template or templates
to create the options for the drop-down, your XSLT should probably look
like:

<xsl:if test="some condition">
  <select name="cat">
    <xsl:apply-templates select="cat"/>
  </select>
</xsl:if>

cheers,
b.

| brian martinez                              brian.martinez@xxxxxxxx |
| senior gui programmer                                  303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

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


Current Thread