Subject: Re: [xsl] Adding Variables From: Deirdre Saoirse Moen <deirdre@xxxxxxxxxxx> Date: Mon, 16 Aug 2004 13:59:22 -0700 |
What I've never quite understood is how to wrap this into a conditional.
The problem with this code is that you get a copy of the nodes in somevalue1.
If you want the variable to hold references to the actual nodes,
a conditional assignment is difficult to achieve in XSLT 1.0. It becomes
easy in 2.0:
<xsl:variable name="n" select="if (COND) then //a/b/c else 20"/>
In 1.0 you can sometimes solve the problem with
<xsl:variable name="n" select="//a/b/c[COND] | //a/b/d[not(COND)]"/>
-- _Deirdre web: http://deirdre.net blog: http://deirdre.org/blog/ Story "A Sword Called Rhonda" in anthology _Turn the Other Chick_ Now available for preorder: http://www.amazon.com/exec/obidos/ASIN/0743488571/deirdrswebpages/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Adding Variables, Andrew Welch | Thread | RE: [xsl] Problems generating w-cir, Andrew Welch |
Re: [xsl] Grouping and counting val, Wendell Piez | Date | [xsl] namespace prefix weirdness, Bruce D'Arcus |
Month |