Hello,
The logic of this template is two-fold
1. To suppress the display of box numbers and column headings when the box
number has appeared previously but
2. to display the box number and column heading at the beginning of each
new c01 even if it has previously been displayed with an earlier component
in the dsc.
To do one or the other seemed simple but to do both appeared complex when
this stylesheet was first written about 3 years ago (a lifetime in this
environment).
The problem is the limitation of the preceding axis.
If one only wanted to achieve goal number one, there are several options.
when="container[@type='box'][.=preceding::container[@type='box']]"
or more directly
when="container[@type='box']=preceding::container[@type='box']"
But neither of these satisfies goal number 2. And so the rather verbose
solution in the cookbook stylesheets was developed using the
preceding-sibling axis.
What was not apparent was a way to use a simpler syntax by intersecting the
ancestor::c01 axis and the preceding::container axis. This will be possible
in XSLT 2 and may already have been implemented in Saxon but I did not want
to limit users to an application-specific extension.
Michael Kay finally broke the ice with this solution for XSLT 1.0 that does
both and which I have incorporated into the next generation of the EAD
Cookbook stylesheets, to wit,
when="container[@type='box']=preceding::container[@type='box'][generate-id(a
ncestor::c01)=generate-id(current()/ancestor::c01)]"
One word of caution. If one wishes to use a stylesheet to automatically
control the display of column headings and container numbers in this sort of
way, there are limitations to the ability of an algorithm to predict what
you need in an absolute way. Some institutions seems to have very much
simpler finding aids than others and can use this approach but I have
certainly met a number of archivists with more complex listings that seem to
require some modification or explicit encoding in the source document. One
example is for component lists where box numbers do not follow in numerical
order as in the case where additions to the materials are housed at the end
of the box number sequence but are described in the finding aid where they
fit intellectually. This may cause a sequence of box numbers that reads-
1, 2, 5, 3, 7, 3, etc. Prediction based on previous display may not be what
one needs.
Michael
-----Original Message-----
From: Rick Silterra [mailto:[log in to unmask]]
Sent: Sunday, July 21, 2002 6:04 PM
To: [log in to unmask]
Subject: XPath deconstruction
Deconstructing EAD style sheets,
Looking at the cookbooks style sheets, I am trying to understand some
of the XPaths.
For example:
When deciding to display a box number or not, we want to know if it has
changed from
the preceding sibling, so we use logic like this:
<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])">
<xsl:call-template name="showbox-C02-box" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="hidebox-C02-box" />
"If not (the preceeding c02 node has a did child, which has a container
child whose type is box and value = box number)
then show the box number,
otherwise hide the box"
But the second condition, where we have the "//" (any descendant), I
don't quite get,
"If the preceeding C02 has any did child at any level with a matching
container type box value" --
Is it possible for this expression to be true for some "did" 's, but
they don't immediately
preceed this one, so we should show the box number anyway?
I "express" my thanks in advance,
Rick
---
Rick Silterra
Implementation Technical Consultant
Endeavor Information Systems, Inc.
2200 E. Devon Ave. Suite 382
Des Plaines, IL, USA 60018-4505
Voice: (847) 296-2200 x2625
Fax: (847) 296-5636
Toll Free: (800) 762-6300 x2625
Email: [log in to unmask]
Any opinions expressed in this message are those only
of the sender and not of Endeavor Information Systems, Inc.
|