|
Subject: RE: RE: [xsl] How to implement an array From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 12 Feb 2003 16:39:57 -0500 |
<iw:year xmlns:iw="imrransnamespace.org"> <month name="January"/> <month name="February"/> <month name="March"/> <month name="April"/> <month name="May"/> <month name="June"/> <month name="July"/> <month name="August"/> <month name="September"/> <month name="October"/> <month name="November"/> <month name="December"/> </iw:year>
<events> <event date="February 22">Lincoln's Birthday</event> <event date="March 15">Ides of March</event> </events>
<xsl:template match="events">
<xsl:variable name="events" select="."/>
<!-- bind the current node to a variable so we can get it back
after we change context -->
<tr>
<xsl:for-each select="$months">
<xsl:variable name="monthname" select="@name"/>
<td>
<xsl:choose>
<xsl:when
test="not($events/event[@date[contains(.,$monthname)]])">
<xsl:text> </xsl:text><!-- nbsp -->
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="$events/event[@date[contains(.,$monthname)]]"/>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:for-each>
</tr>
</xsl:template>Cheers, Wendell
I am now posed with another challenge. How do I use an external lookup table to define the column headings? E.g. Jan, Feb, Mar,...,Dec. Any pointers would be appreciated.
Imrran
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: RE: [xsl] How to implement an a, Imrran Wahid | Thread | RE: RE: [xsl] How to implement an a, Wendell Piez |
| Re: [xsl] Parsing day out of date f, David Carlisle | Date | RE: RE: [xsl] How to implement an a, Wendell Piez |
| Month |