Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@anarchivist
Last active June 15, 2018 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarchivist/04dead482831de09f0091573ea97211e to your computer and use it in GitHub Desktop.
Save anarchivist/04dead482831de09f0091573ea97211e to your computer and use it in GitHub Desktop.
Strip OAC attributes from EAD
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output indent="yes"/><xsl:param name="removeAttributesNamed" select="'|C-ORDER|MAX-C-ORDER|score|cdlpath:parent|cdlpath:grandparent|xmlns:cdlpath|'"/><xsl:template match="node()|@*" name="identity"><xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy></xsl:template><xsl:template match="@*"><xsl:if test= "not(contains($removeAttributesNamed, concat('|', name(), '|') ) ) "><xsl:call-template name="identity"/></xsl:if></xsl:template></xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment