Skip to content

Instantly share code, notes, and snippets.

@CJHArch
Created October 23, 2015 13:32
Show Gist options
  • Save CJHArch/eaaed529f709b641a1de to your computer and use it in GitHub Desktop.
Save CJHArch/eaaed529f709b641a1de to your computer and use it in GitHub Desktop.
XSLT to create csv of all metadata field indexed by Digitool, extracted from the repository_indexing_schema.xml file. NB I removed the namespace from the xml file first.
<?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"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="/">
<xsl:for-each select="silo_schema/fields/field[location/@type='digital_entity']">
<xsl:value-of select="@ui_default_text"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="location/@md_type"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="location/@path"/>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<xsl:for-each select="silo_schema/fields/field/location[@type='md']">
<xsl:value-of select="../@ui_default_text"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="@md_type"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="@path"/>
<xsl:text>&#10;</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