Created
June 9, 2020 15:11
-
-
Save kschlottmann/e04d4a0848934359bda8a88776c32d83 to your computer and use it in GitHub Desktop.
Get box/folder/title/date and publish status from an AS EAD (from a given series, only c-level data)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ead="urn:isbn:1-931666-22-9" | |
exclude-result-prefixes="xs " version="2.0"> | |
<xsl:template match="c"> | |
<xsl:text>Title|Date|Box|Folder|Publish Status </xsl:text> | |
<xsl:apply-templates select="//c[@level = 'file']"/> | |
</xsl:template> | |
<xsl:template match="c[@level = 'file']"> | |
<xsl:for-each select="."> | |
<xsl:value-of select="did/unittitle/normalize-space(.)"/> | |
<xsl:text>|</xsl:text> | |
<xsl:value-of select="did/unitdate/normalize-space(.)"/> | |
<xsl:text>|</xsl:text> | |
<xsl:value-of select="did/container[@type='box']/normalize-space(.)"/> | |
<xsl:text>|</xsl:text> | |
<xsl:value-of select="did/container[@type='folder']/normalize-space(.)"/> | |
<xsl:text>|</xsl:text> | |
<xsl:choose> | |
<xsl:when test=".[@audience]"> | |
<xsl:text>FALSE</xsl:text> | |
<xsl:text>|</xsl:text> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:text>TRUE</xsl:text> | |
<xsl:text>|</xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:text> </xsl:text> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment