Closed jimetevenard closed 3 years ago
See https://www.w3.org/TR/xslt20/#document
Note:
One effect of these rules is that unless XML entities or xml:base are used, and provided that the base URI of the stylesheet module is known, document("") refers to the document node of the containing stylesheet module (the definitive rules are in [RFC3986]). The XML resource containing the stylesheet module is processed exactly as if it were any other XML document, for example there is no special recognition of xsl:text elements, and no special treatment of comments and processing instructions.
iso_schematron_skeleton_for_saxon.xsl attempts to access itself.
This looks not possible when XSLT is accessed as a resource from a Jar. - Issue #7 is similar.
<xsl:template name="outputLocalizedMessage">
<xsl:param name="number" />
<xsl:choose>
<xsl:when test="string-length( $langCode ) = 0 or $langCode = 'default'" >
<xsl:value-of select='document("")//xhtml:p[@id=concat("sch-message-", $number)]/text()' />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="localizationDocumentFilename" >
<xsl:value-of select="concat('sch-messages-', $langCode, '.xhtml')" />
</xsl:variable>
<xsl:variable name="theLocalizedMessage" >
<xsl:value-of select=
'document( $localizationDocumentFilename, /)//xhtml:p[@id=concat("sch-message-", $number, "-", $langCode)]/text()' />
</xsl:variable>
<xsl:choose>
<!-- if we found any external message with that id, use it -->
<xsl:when test=" string-length($theLocalizedMessage) > 0">
<xsl:value-of select="$theLocalizedMessage" />
</xsl:when>
<xsl:otherwise>
<!-- otherwise use the default strings -->
<xsl:value-of select='document("")//xhtml:p[@id=concat("sch-message-", $number)]/text()' />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
This is very minor (and strongly linked to Skeleton) This has no influence on the compilation result, only on it's messaging
Probably wontfix
NB : Skeleton implementation is now deprecated. See README at https://github.com/Schematron/schematron
Fix iso_schematron_skeleton_for_saxon.xsl to access sch-message-*
litterals via a global xsl:variable
or xsl:param
, and not with document("")//xhtml:p[@id=concat("sch-message-", $number)]/text()
.
Pretty easy since the iso_schematron_skeleton_for_saxon.xsl is duplicated here
implement #15 and migrate to the newer SchXslt Schematron implementation
Fix this warning (at plugin init)