You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Chris P. McCabe" <ch...@choicehotels.com> on 2000/03/14 01:42:43 UTC

How to process a list of non-elements

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