Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Extend API with process-foreign #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions trunk/schematron/code/iso_schematron_skeleton_for_saxon.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1915,18 +1915,7 @@ which require a preprocess.
<xsl:template match="schold:*" priority="-2" />

<xsl:template match="*" priority="-3">
<xsl:choose>
<xsl:when test=" $allow-foreign = 'false' ">
<xsl:message>
<xsl:call-template name="outputLocalizedMessage" ><xsl:with-param name="number">39a</xsl:with-param></xsl:call-template>
<xsl:value-of select="name(.)"/>
<xsl:call-template name="outputLocalizedMessage" ><xsl:with-param name="number">39b</xsl:with-param></xsl:call-template>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="process-foreign"/>
</xsl:template>

<xsl:template match="iso:*" mode="text" priority="-2" />
Expand Down Expand Up @@ -2146,6 +2135,21 @@ which require a preprocess.
<axsl:text> </axsl:text>
</xsl:template>

<xsl:template name="process-foreign">
<xsl:choose>
<xsl:when test=" $allow-foreign = 'false' ">
<xsl:message>
<xsl:call-template name="outputLocalizedMessage" ><xsl:with-param name="number">39a</xsl:with-param></xsl:call-template>
<xsl:value-of select="name(.)"/>
<xsl:call-template name="outputLocalizedMessage" ><xsl:with-param name="number">39b</xsl:with-param></xsl:call-template>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!-- default output action: the simplest customization is to just override this -->
<xsl:template name="process-message">
<xsl:param name="pattern" />
Expand Down
26 changes: 15 additions & 11 deletions trunk/schematron/code/iso_schematron_skeleton_for_xslt1.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1596,17 +1596,7 @@ THE SOFTWARE.
<xsl:template match="sch:*" priority="-2" />

<xsl:template match="*" priority="-3">
<xsl:choose>
<xsl:when test=" $allow-foreign = 'false' ">
<xsl:message>
<xsl:text>Warning: unrecognized element </xsl:text>
<xsl:value-of select="name(.)"/>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="process-foreign"/>
</xsl:template>

<xsl:template match="iso:*" mode="text" priority="-2" />
Expand Down Expand Up @@ -1834,6 +1824,20 @@ THE SOFTWARE.
<axsl:text> </axsl:text>
</xsl:template>

<xsl:template name="process-foreign">
<xsl:choose>
<xsl:when test=" $allow-foreign = 'false' ">
<xsl:message>
<xsl:text>Warning: unrecognized element </xsl:text>
<xsl:value-of select="name(.)"/>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!-- default output action: the simplest customization is to just override this -->
<xsl:template name="process-message">
<xsl:param name="pattern" />
Expand Down