Skip to content

Instantly share code, notes, and snippets.

@etoyoda
Created April 19, 2013 15:23
Show Gist options
  • Save etoyoda/5421069 to your computer and use it in GitHub Desktop.
Save etoyoda/5421069 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
>
<xsl:output method="xml"/>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="iso:include">
<xsl:processing-instruction name="DSDL_INCLUDE_START">
<xsl:value-of select="@href" />
</xsl:processing-instruction>
<xsl:apply-templates select="document(@href)"/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy>
<xsl:value-of select="text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment