Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - boolean predicate in variable? >Thread Next - Re: boolean predicate in variable? Re: boolean predicate in variable?To: NULL Date: 5/4/2007 5:29:00 PM Jean-François Michaud wrote: > I was wondering if it was possible to reference a boolean predicate in > a variable. Basically I want to do with the boolean predicate what you > would do with any other variable; I want it to apply to many places > without having to update all those different locations if the > predicate needs to change. > > This is not a full stylesheet, just snippets of the idea > > <xsl:variable name="list-orphans-widows.properties"> > position()=last()-1 or position()=last()-2 or (position()='1' and > position()!=last()) or (position()='2' and position()!=last()) > </xsl:variable> You can't store an XPath expression in a variable and evaluate that XPath expression dynamically. So your variable above is simply containing a result tree fragment with a text node containing some text. XSLT 2.0 allows you to define your own functions and call them, that is the closest I can think of. Besides processor specific extension functions allowing you to evaluate a string with an XPath expression. -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
