|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Storing an XPath fragment in a variable
Jason,
Adding to the last post, here's a technique sometimes useful in XSLT 1.0 for parameterizing the kind of thing you're interested in. At the top of the stylesheet, bind into a global variable all the elements you want of a particular kind: <xsl:variable name="brights" select="//RED | //GREEN | //BLUE"/> Then when you have, say, a bunch of child elements at hand and you only want the members of this set, you can do: <xsl:for-each select="*[count(.|$brights)=count($brights)]"> ...<xsl:for-each> It translates into English as "child elements which, when added to the set of $brights and counted, yield the count of the set of $brights", which is only true for those child elements in the set. In XPath 2.0 there are much easier ways to do this. Cheers, Wendell
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








