Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: boolean predicate in variable? [Thread Next] Re: boolean predicate in variable?To: NULL Date: 5/7/2007 9:47:00 AM On May 4, 8:28 am, Martin Honnen <mahotr...@yahoo.de> wrote: > Jean-Fran=E7ois 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=3D"list-orphans-widows.properties"> > > position()=3Dlast()-1 or position()=3Dlast()-2 or (position()=3D'1'= and > > position()!=3Dlast()) or (position()=3D'2' and position()!=3Dlast()) > > </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/ Right on, thanks for the answer Martin. I created a function to allow for equivalent logic. Regards Jean-Francois Michaud | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
