[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] .[predicate] vs self::node()[predicate]- Xalan 2.7

Subject: [xsl] .[predicate] vs self::node()[predicate]- Xalan 2.7
From: Raimund Kammering <raimund.kammering@xxxxxxx>
Date: Wed, 17 Apr 2013 11:12:37 +0200


I have a stylesheet which works correct if I use:


but I get an warning/error from the transformer saying:

'..[predicate]' or '.[predicate]' is illegal syntax.  Use
'self::node()[predicate]' instead.
And this spams the (tomcat) log files that way that they get unusable!
Therefore I would like to get rid of this
warning/error message. BUT if I do as recommended and use
'self::node()[predicate], the transformation results
in no match?!

The transformer I use is Xalan Java 2.7.0. Is there an easy way to suppress
the warning/error, or to change the
statement to be legal (while producing the same matches).

Code looks something like this:

<xsl:template match="entry/sum">
  <xsl:for-each select=".[starts-with(name,'tdown')]">

(and YES I should/could change the template match condition to be
match="entry" and the for-each to be
select="sum[starts-with(name,'tdown')]", but this would break a lot other
surrounding logic, which I don't want
to touch!)

Any help would be appreciated!


Current Thread