Print

Print


Aaron -

We use this stylesheet to sort by unitid:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink"
    exclude-result-prefixes="marc xlink">
<xsl:output omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="c01">
        <xsl:copy>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates select="c02">
                <xsl:sort select="./did/unitid" data-type="text"/>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

Perhaps you can use it as a guide to craft your own.

Best regards -

Bert

Bertram Lyons, CA
Digital Assets Manager / Folklife Specialist
American Folklife Center
Library of Congress
www.loc.gov/folklife<http://www.loc.gov/folklife>

From: Encoded Archival Description List [mailto:[log in to unmask]] On Behalf Of Cusick, Aaron M
Sent: Wednesday, April 09, 2014 2:40 PM
To: [log in to unmask]
Subject: sorting by unitid

Hello,

I have a container list in a finding aid that I would like to be able to sort ascending by the unitids, which are currently out of order. The basic structure is:

<c01 level="series">
               <c02 level="file">
               <did>
               <unittitle>Title</unittitle>
               <unitid>1</unitid>
               </did>
               </c02>
               ...
</c01>

I am not familiar enough with xslt to make this work on my own. Could anyone assist me by providing a basic stylesheet? Thanks.

Aaron Cusick
Digital Services Section
State Archives of North Carolina
4614 Mail Service Center
Raleigh, N.C. 27699-4614
[log in to unmask]<mailto:[log in to unmask]>
919.807.7347
E-mail correspondence to and from this address may be subject to the North Carolina Public Records Law "NCGS.Ch.132" and may be disclosed to third parties by an authorized state official.