[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xalan-dev
Subject:    How to process a list of non-elements
From:       "Chris P. McCabe" <chris_mccabe () choicehotels ! com>
Date:       2000-03-14 0:42:43
[Download RAW message or body]

I think there must be a better way to do what I need to do:

Lets say I have an xml element that looks like this:
<date month="5" day="20"/>

and in my stylesheet I want to create an HTML drop down list with all
the days of the month, with the day specified in the date element
selected.  To do this I could repeat the following for each of the 31
days in a month:

<xsl:choose>
   <xsl:when test="@day = 1">
      <option value="1" selected="selected"/>
   </xsl:when>
   <xsl:otherwise>
      <option value="1"/>
   </xsl:otherwise>
</xsl:choose>

Or I could create a template and call it 31 times with the day number
and the number to select as parameters, but this would be just about as
bad.
Is there a better (less verbose) way?

Chris

--
Chris P. McCabe  602-953-4416
Choice Hotels International  chris_mccabe@choicehotels.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic