Created
July 20, 2022 17:55
-
-
Save etoyoda/1eb5c26e9383f840e157496bc6982fc0 to your computer and use it in GitHub Desktop.
XSLT stylesheet to extract Schematron 1.5 embedded in RELAX NG
This file contains 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 | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:s="http://www.ascc.net/xml/schematron" | |
xmlns:rng="http://relaxng.org/ns/structure/1.0" | |
> | |
<xsl:output method="xml" indent="yes" standalone="yes"/> | |
<xsl:template match="/rng:grammar"> | |
<s:schema> | |
<xsl:copy-of select=".//s:ns"/> | |
<s:pattern name="schematron"> | |
<xsl:for-each select=".//s:rule"> | |
<xsl:copy-of select="."/> | |
</xsl:for-each> | |
</s:pattern> | |
</s:schema> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment