Skip to content

Commit

Permalink
Switch merge to use XSLT 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Aug 24, 2023
1 parent 9a4a0ff commit b70c69c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions xsl/schematron-merge.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<xsl:stylesheet
exclude-result-prefixes="saxon xs"
version="2.0"
version="3.0"
xmlns:saxon="http://saxon.sf.net/"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
Expand Down Expand Up @@ -63,16 +63,14 @@
<xsl:copy-of select="$namespaces"/>
<!-- xsl:copy-of select="@*" is the standard way of copying all attributes. -->
<xsl:copy-of select="@*"/>
<xsl:for-each select="collection($path)">
<!-- xsl:copy-of copies nodes and all their descendants -->
<xsl:apply-templates select="document(document-uri(.))/schematron-output/node()" mode="schematron-output"/>
</xsl:for-each>
<xsl:merge>
<xsl:merge-source for-each-item="collection($path)" select="schematron-output/failed-assert">
<xsl:merge-key select="@location" order="ascending"/>
</xsl:merge-source>
<xsl:merge-action>
<xsl:sequence select="current-merge-group()"/>
</xsl:merge-action>
</xsl:merge>
</xsl:element>
</xsl:template>

<xsl:template match="node()|@*" mode="schematron-output">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="schematron-output"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

0 comments on commit b70c69c

Please sign in to comment.