Using xsl:if to set-up dropdown lists?

Subject: Using xsl:if to set-up dropdown lists?
From: Cliodhna Mc Guirk <cliodhna@xxxxxx>
Date: Fri, 30 Jul 1999 15:54:41 +0100
I've got a pretty straight forward problem but I can't
think of a straight forward solution. I want to set an
option field on a drop down list to be selected, depending
on the value of an xml element.

So if I have as input:


I'd like to have as HTML output:

<option selected="1" value="Dr">Dr</option>
John Mooney

So for the xsl I'd have something like:
<xsl:template match="title">
      <SELECT NAME="title">
      <OPTION  VALUE="Mr">Mr
   <OPTION SELECTED="1" VALUE="{../title}"><xsl:value-of select="."


Except in the case above, I'm presuming that the title is not
Mr or Mrs which won't work. Does anyone have any suggestions
on how I could set the attribute on the correct tag?


___ Dublin_______NUA: Internet Strategy & Development_________ New York_____
Tel: +353-1-676-8996            Tel: + 212 358 1775
Fax: +353-1-283-9988                                     Fax: + 212 358 1760
Cliodhna Mc Guirk                                     EMAIL: cliodhna@xxxxxx

 XSL-List info and archive:

Current Thread