I really don't see a problem with using your existing stylesheet. You
basically just program in an attribute value that triggers the
stylesheet to display the XML in a different way.
If I were going to do something like this, I would place the attribute
value at the component level above which you wanted to sort so that you
can perform a test at that level before the component level that you
want to sort becomes the "context" node.
<c01 level="series" altrender="alphasort">
<did><unittitle>Incoming correspondence</unittitle></did>
<c02 level="file"><did><unittitle>Zalesky, Avis</unittitle></did></c02>
<c02 level="file"><did><unittitle>Smith, John</unittitle></did></c02>
<c02 level="file"><did><unittitle>Jones, Richard</unittitle></did></c02>
...
</c01>
The XSL code would vary depending on how it is constructed. For
example, when processing the <cxx> levels, your stylesheet could "test"
for whether the parent node indicates that it should be alpha sorted:
<xsl:template match="c02|c03|c04|c05|c06|c07|c08|c09|c10|c11|c12">
<xsl:choose>
<xsl:when test="parent::*[@altrender='alphasort']">
<!-- sort these -->
</xsl:when>
<xsl:otherwise>
<!-- display at usual -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
This type of code has the advantage of allowing you to sort any child
components by placing this attribute value at the parent component level.
Mark Carlson
Computer Support Analyst
Special Collections Division
University of Washington Libraries
BOX 352900
Seattle, WA, 98195
(206) 543-1929
http://staff.washington.edu/carlsonm/
Jennie A. Levine wrote:
> We have several collections for which it makes sense to sort the dsc
> items alphabetically by text in the <unittitle>. At present, our
> materials display reflecting a physical arrangement, which is reflected
> in how we code our <c0x>.
>
> Because we have a system that automatically generates an XML EAD file
> from a database, all of our EADs are essentially coded the same. We're
> looking for a solution that would allow us to display the finding aids
> based on an attribute somewhere in the XML (ideally at the <c01
> level="series"> and <c02 level=subseries">) that would indicate how to
> display each series within a finding aid.
>
> Our programmer is running into a roadblock with the XSL based on how we
> code the <dsc type="in-depth"> I thought I would see if anyone else has
> been successful in either a) having two or more style sheets that they
> could potentially use to display the same XML in different ways and/or
> b) displaying <dsc> c0s based based on an alphabetical (i.e.
> non-linear/physical) premise.
>
> Examples would be lovely, and I can provide more information about how
> we code now, if people are interested. What I understand from the
> programmer is that because we depend on the structure of the EAD to let
> <c03> inherit information from <c02> and <c01>, rather than repeating
> certain information at each level, it could make the XSL cumbersome and
> bear-like. He is not entirely sure it's NOT possible, but I said I would
> look around for examples while he worked on it.
>
> Jennie
>
|