Last active
March 30, 2020 14:51
-
-
Save kschlottmann/a35c0dd991ff821e0920e05fd0ed5709 to your computer and use it in GitHub Desktop.
Takes AS ids from an AS-exported EAD and outputs a pipe-separated file compatible with the Harvard Excel DO import plugin
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:output omit-xml-declaration="yes"/> | |
| <xsl:template match="ead:ead"> | |
| <xsl:for-each select="//ead:c[@level='file']"> | |
| <xsl:value-of select="//ead:eadid"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- blank column --> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="substring-after(@id, 'aspace_')"/> | |
| <!-- blank column --> | |
| <xsl:text>|</xsl:text> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="ead:did/ead:unittitle"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- Default value set to true --> | |
| <xsl:text>TRUE</xsl:text> | |
| <xsl:text>|</xsl:text> | |
| <xsl:text>
</xsl:text> | |
| </xsl:for-each> | |
| </xsl:template> | |
| </xsl:stylesheet> |
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" | |
| xmlns:xlink="http://www.w3.org/1999/xlink" | |
| exclude-result-prefixes="xs" | |
| version="2.0"> | |
| <!-- specific version for bob fass --> | |
| <xsl:output omit-xml-declaration="yes"/> | |
| <xsl:template match="ead:ead"> | |
| <xsl:for-each select="//ead:c[@level='file']"> | |
| <xsl:value-of select="//ead:eadid"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- blank column --> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="substring-after(@id, 'aspace_')"/> | |
| <!-- blank column --> | |
| <xsl:text>|</xsl:text> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="ead:did/ead:unittitle/normalize-space()"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- Default value set to true --> | |
| <xsl:text>TRUE</xsl:text> | |
| <xsl:text>|</xsl:text> | |
| <!-- Fass identifier --> | |
| <xsl:value-of select="substring-before(substring-after(ead:scopecontent/ead:p, 'Unique identifier: '), '.')"/> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="ead:did/ead:dao/@xlink:href"/> | |
| <xsl:text>
</xsl:text> | |
| </xsl:for-each> | |
| </xsl:template> | |
| </xsl:stylesheet> |
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:output omit-xml-declaration="yes"/> | |
| <xsl:template match="ead:ead"> | |
| <xsl:for-each select="//ead:c[@level='item']"> | |
| <xsl:value-of select="//ead:eadid"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- blank column --> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="substring-after(@id, 'aspace_')"/> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="ead:did/ead:container[1]/normalize-space()"/> | |
| <xsl:text>; </xsl:text> | |
| <xsl:value-of select="ead:did/ead:container[2]/normalize-space()"/> | |
| <xsl:text>|</xsl:text> | |
| <xsl:value-of select="ead:did/ead:unittitle/normalize-space()"/> | |
| <xsl:text>|</xsl:text> | |
| <!-- Default value set to true --> | |
| <xsl:text>TRUE</xsl:text> | |
| <xsl:text>|</xsl:text> | |
| <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