Print

Print


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

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

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.

<unittitle>ABC<unitdate>1994-1996</unitdate><unitdate>2003-2006</unitdate></unittitle>

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

1.Multiple lines, unit date children enclosed in parentheses on new
lines.
ABC
(1994-1996)
(2003-2006)

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." 

Thanks!
Jaime Margalotti, University of Delaware

-- 

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