phax/ph-schematron

Variable defined as an XPath location with a predicate causes a warning

Closed this issue · 2 comments

As I modify my schematron rules to make more use of variable, I've noticed that a variable defined as an XPath location with a predicate causes a warning:
WARN com.helger.schematron.pure.xpath.XPathEvaluationHelper$SaxonEvaluator - Unknown Saxon expression type: net.sf.saxon.expr.FilterExpression

An example of such a variable would be:
<let name="filterVar" value="/xml/car[@owner = 'o1']"/>

There's no problem when referencing this variable, as XPathEvaluationHelper.evaluateAsNodeList works and returns a node list.

Without the predicate [@owner = 'o1'], this would be a SlashExpression.
And as you can't know what the predicate/filter does, I think it would be OK to handle FilterExpression the same way as SlashExpression: map it to NODESET.

I think I'm done modifying my schematron rules, so this should be the last issue on this topic from me 😃

phax commented

Thanks @bertrand-lorentz, as usual very helpful :)
Links to #170 and #173

phax commented

Will be part of the upcoming 8.0.2 release