You might test each unitdate for a following sibling, like so:

<xsl:for-each select="unitdate">
     <xsl:if test="following-sibling::unitdate">
          <xsl:text>, </xsl:text>

Michele C.

Michele R. Combs
[log in to unmask]
Manuscripts Processor
Special Collections Research Center
Syracuse University Library
222 Waverly Avenue
Syracuse, NY 13244
(315) 443-2697

>>> [log in to unmask] 1/25/2007 1:59 PM >>>
The following situation arises routinely in our XML documents, in which

there are sometimes multiple unit dates contained within a unit title 
tag, e.g.


Ideally, we'd like to format this information (in html) in one of two

1.Multiple lines, unit date children enclosed in parentheses on new

2. Single line, unit title followed by a colon, and unit dates followed

by commas
ABC: 1994-1996, 2003-2006

How would you write a generic template or rule in XSLT to ouput these 
cases, taking into account the possibility for both singular and 
multiple unit dates, i.e. in the second example "don't follow a unit 
date by a comma if it is the only unit date." 

Jaime Margalotti, University of Delaware


Jaime L. Margalotti
Assistant Librarian
Special Collections Department 
University of Delaware Library
Newark, DE  19717-5267
[log in to unmask]