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

Attribute optimization bug #29

Open
rjelliffe opened this issue Jan 10, 2017 · 0 comments
Open

Attribute optimization bug #29

rjelliffe opened this issue Jan 10, 2017 · 0 comments
Labels
bug Description of a bug

Comments

@rjelliffe
Copy link
Member

Ken Holman raised this issue:

(2) Even passing an arbitrary value of "true" for $attributes at
invocation still does not add the attribute pattern to the context
XPath because of the following top-level variable:

<xsl:variable name="context-xpath">
<xsl:if test="$attributes='true' and parent::node() ">@|</xsl:if>
xsl:choose
<xsl:when test="$only-child-elements='true'">
</xsl:when>
<xsl:when test="$visit-text='true'">node()</xsl:when>
xsl:otherwise*|comment()|processing-instruction()</xsl:otherwise>
</xsl:choose>
</xsl:variable>

My understanding is that in XSLT top-level variables are evaluated
assuming the context of the document node of the input
document. This document node has no parent. The "and
parent::node()" expression above will always evaluate to false,
thus never adding "@*|" to the XPath expression. My read of the
above is that in this stylesheet it is impossible to trigger the
inclusion of attributes in the search contexts of the stylesheet
created by Schematron. Why would it have been included and how was it tested?

I have suggested the user hack the above to be:

<xsl:if test="$attributes='true'">@*|</xsl:if>

... and to use "attributes=true" on the command line when invoking
the stylesheet with a fragmented Schematron schema in order to avoid
the auto-detect bug of not looking for attributes in rules of
included Schematron fragments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Description of a bug
Projects
None yet
Development

No branches or pull requests

2 participants