Tanya,
Your stylesheet can be greatly simplified if two conditions exist: you
have assigned a level attribute for each component and you are willing to
have the display of each level of component (series, subseries, and file)
appear in a consistent way irrespective of its parentage.
You ask, "what does that last part mean?" Your example below suggests
that like most of us you use indention to show hierarchy. However, the
hierarchy is not always consistent, that is, in the example below some
containers (I assume you mean files) are the level below a series and
sometimes the level below a subseries. If the appearance of the example
below persists through the mail, you will notice that the first two
containers are indented two columns but the third and fourth by three
columns. If you are willing to have all the series, all the subseries and
all the files intended the same amount, you can rewrite your stylesheet so
that your templates match the level attributes and not the components
levels. But as I say, you need to have encoded the level attributes in your
EAD documents and you need to have a sufficiently flat arrangement of the
collection so that you have unique level values to differentiate all
descriptive levels.
Subgroup 1
Series I
container
Series II
container
Series III
Subseries 1
container
Subseries 2
container
Subgroup 2
Michael
-----Original Message-----
From: Tanya Elder [mailto:[log in to unmask]]
Sent: Tuesday, July 30, 2002 9:59 AM
To: [log in to unmask]
Subject: Creating a c04 level in a stylesheet
Hello,
I tried to send this message yesterday, but for some reason, it did not
make it to the listserv. Apologies for any duplications, if any.
I am somewhat new to stylesheet creation, though I have recently taken the
SAA stylesheet course at Pratt (thanks to Kris and Michael for last week's
class!) Now that I'm back at work, we have run into a probelm between a
newly created finding aid and a stylesheet that does not go beyond the c03
level. My colleague is using the following in her finding aid:
Subgroup 1
Series I
container
Series II
container
Series III
Subseries 1
container
Subseries 2
container
Subgroup 2
We attempted to create a EAD using the above, but our stylesheet (as stated
above), does not go beyond the c03 level, nor do we have a subgroup
declared. I believe I can update a copy of an existing stylesheet with your
help and advice. Our stylesheet is based on a variation of NYU's. Please
find the coding below.
Thanks,
Tanya Elder
Archivist (NHPRC)
Center for Jewish History
15 W. 16th Street
New York, NY 10011
(212) 294-8301 x1013
[log in to unmask]
<!-- dsc totally rewritten by lmyrick -->
<xsl:template name="dsc">
<xsl:for-each select="ead/archdesc/dsc">
<h3><a name="a23">
<xsl:apply-templates select="head"/>
</a></h3>
<p style="margin-left: 25 pt"><i>
<xsl:apply-templates select="p"/>
</i></p>
</xsl:for-each>
<!--INNA's edit: added <xsl:text> to make links to series work - 12/14/2001-
->
<xsl:for-each select="ead/archdesc/dsc/c01">
<table cellpadding="5" border="0">
<a><xsl:attribute name="name">series<xsl:number/>
</xsl:attribute><xsl:text> </xsl:text>
</a>
<tr><td colspan="4"><p class="h2"><b><xsl:apply-templates
select="did/unittitle"/></b>
<!-- added 2001/11/06 -->
<xsl:for-each select="did/physdesc">  <xsl:apply-templates />
</xsl:for-each>
</p></td></tr>
<tr><td colspan="4"><p class="seriesabstract"><xsl:apply-templates
select="did/abstract"/></p></td></tr>
<!-- added 2001/11/06 -->
<xsl:if test="./child::arrangement">
<tr><td colspan="4"><p class="h2scopecontent"><b>Arrangement: </b></p>
<xsl:for-each select="arrangement/p">
<p class="seriesscope"><xsl:apply-templates/></p>
</xsl:for-each>
</td></tr>
</xsl:if>
<!--switched around scopecontent and arrangement -Inna, 5/13/2002-->
<xsl:if test="./child::scopecontent">
<tr><td colspan="4"><p class="h2scopecontent"><b>Scope and Content: </b></p>
<xsl:for-each select="scopecontent/p">
<p class="seriesscope"><xsl:apply-templates/></p>
</xsl:for-each>
</td></tr>
</xsl:if>
<hr/>
<xsl:variable name="subseriestitle">
<xsl:value-of select="c02/did/unittitle"/>
</xsl:variable>
<xsl:for-each select="c02">
<xsl:choose>
<xsl:when test="contains($subseriestitle, 'Subseries')">
<tr><td colspan="4"><p class="h3subseries"><b><xsl:apply-templates
select="did/unittitle"/></b></p></td></tr>
</xsl:when>
<xsl:otherwise>
<xsl:if test="@level='recordgrp'">
<tr><td colspan="4"><p class="h3subseries"><b><xsl:apply-templates
select="did/unittitle"/></b></p></td></tr>
</xsl:if>
<!-- added for Inna 0809 -->
<!--<xsl:if test="@level='file'">
<tr><td colspan="4"><p class="file"><b><xsl:apply-templates
select="did/unittitle"/></b></p></td></tr>
</xsl:if>-->
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="scopecontent">
<tr><td colspan="4"><p class="h2scopecontent"><b>Scope and Content: </b></p>
<xsl:for-each select="p">
<p class="seriesscope"><xsl:apply-templates/></p>
</xsl:for-each>
</td></tr>
</xsl:for-each>
<xsl:for-each select="did/container">
<xsl:variable name="box-number" select="self::container[@type='box']"/>
<xsl:choose>
<xsl:when test="@type='box'">
<xsl:choose>
<xsl:when test="not(../../preceding-sibling::c02/did[container[@type='box']
=$box-number]
or ../../preceding-sibling::c02//did[container[@type='box']=$box-number])
or ../preceding-sibling::c02//did[container[@type='volume']]">
<xsl:if test="./following-sibling::container[@type='folder']">
<xsl:copy-of select="$box-and-folder-heading"/>
</xsl:if>
<xsl:if test="./following-sibling::container[@type='volume']">
<xsl:copy-of select="$box-and-volume-heading"/>
</xsl:if>
<xsl:if test= "not(./following-sibling::container[@type='folder']
or ./following-sibling::container[@type='volume'])">
<xsl:copy-of select="$box-heading"/>
</xsl:if>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='box']/text()"/></td><td width="10%"
valign="top"><xsl:apply-templates select="following-sibling::container/text
()"/></td>
<td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td>
<td width="30%" valign="top"><xsl:apply-templates select="following-
sibling::unitdate/text()"/></td></tr>
</xsl:when>
<xsl:otherwise>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='box']/text()"/></td><td width="10%"
valign="top"><xsl:apply-templates select="following-sibling::container/text
()"/></td><td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td><td width="30%" valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@type='folder'">
<!--<td><xsl:apply-templates/></td>-->
</xsl:when>
<!--<xsl:when test="@type='volume'">
<td><xsl:apply-templates/></td>
</xsl:when>-->
<xsl:when test="@type='volume'">
<xsl:variable name="volume-number" select="self::container
[@type='volume']"/>
<xsl:choose>
<xsl:when test="not(../../preceding-sibling::c02/did[container
[@type='volume']=$volume-number]
or ../../preceding-sibling::c02//did[container[@type='volume']=$volume-
number])">
<xsl:copy-of select="$volume-heading"/>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='volume']/text()"/></td><td width="10%"
valign="top"></td><td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td><td width="30%" valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:when>
<xsl:otherwise>
<!-- do nothing -->
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@type='reel'">
<xsl:copy-of select="$reel-heading"/>
<tr><td valign="top"><xsl:apply-templates select="self::container
[@type='reel']/text()"/></td><td><xsl:apply-templates select="following-
sibling::unittitle"/></td></tr>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="c03/did/container">
<xsl:variable name="box-number" select="self::container[@type='box']"/>
<xsl:choose>
<xsl:when test="@type='box'">
<xsl:choose>
<xsl:when test="not(../../preceding-sibling::c03/did[container[@type='box']
=$box-number]
or ../../preceding-sibling::c03//did[container[@type='box']=$box-number])
or ../../preceding-sibling::c03/did[container[@type='volume']]">
<xsl:if test="./following-sibling::container[@type='folder']">
<xsl:copy-of select="$box-and-folder-heading"/>
</xsl:if>
<xsl:if test= "not(./following-sibling::container[@type='folder'])">
<xsl:copy-of select="$box-heading"/>
</xsl:if>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='box']/text()"/></td><td width="10%"
valign="top"><xsl:apply-templates select="following-sibling::container
[@type='folder']/text()"/></td>
<td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td><td width="30%" valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:when>
<xsl:otherwise>
<!-- replicate this above -->
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='box']/text()"/></td><td width="10%"
valign="top"><xsl:apply-templates select="following-sibling::container
[@type='folder']/text()"/></td>
<td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td>
<td width="30%" valign="top"><xsl:apply-templates select="following-
sibling::unitdate/text()"/></td></tr>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@type='folder'">
<!--<td><xsl:apply-templates select="."/></td>-->
</xsl:when>
<xsl:when test="@type='volume'">
<xsl:variable name="volume-number" select="self::container
[@type='volume']"/>
<xsl:choose>
<xsl:when test="not(../../preceding-sibling::c03/did[container
[@type='volume']=$volume-number]
or ../../preceding-sibling::c03//did[container[@type='volume']=$volume-
number])">
<xsl:copy-of select="$volume-heading"/>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='volume']/text()"/></td><td width="10%"
valign="top"></td><td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td><td width="30%" valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:when>
<xsl:otherwise>
<tr><td width="10%" valign="top"><xsl:apply-templates
select="self::container[@type='volume']/text()"/></td><td width="10%"
valign="top"></td><td width="50%"><xsl:apply-templates select="following-
sibling::unittitle"/></td><td width="30%" valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!--Inna's edit 01/14/2002-->
<xsl:when test="@type='reel'">
<xsl:copy-of select="$reel-heading"/>
<tr><td valign="top"><xsl:apply-templates select="self::container
[@type='reel']/text()"/></td><td><xsl:apply-templates select="following-
sibling::unittitle"/></td><td valign="top"><xsl:apply-templates
select="following-sibling::unitdate/text()"/></td></tr>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="unittitle">
<!--<xsl:apply-templates/>-->
</xsl:for-each>
<xsl:for-each select="unitdate">
<!--<xsl:apply-templates/>-->
</xsl:for-each>
|