xsl-list
[Top] [All Lists]

Re: [xsl] Matching attribute with condition in predicate

2009-12-22 10:14:20
2009/12/22 G. Ken Holman <gkholman(_at_)cranesoftwrights(_dot_)com>:

Because the "/" at the start of "/root/@condition" is the top of the
_current tree_, not the top of the initial tree.  Thus it is at the top of
the tree with the attribute because it is in the predicate tested when the
attribute is the current node.

You want a global variable something like:
 <xsl:variable name="orig" select="/"/>

... and then in your predicate @attr[$orig/root/@condition='ru'] in order to
switch to the original tree from your temporary tree.

Thanks for quick reply.
Now I see why it's not working, but I can't use variables in
template/@match, can I ?
So I can't figure out how to get original tree there, and it seems
that I have to use choose/when/otherwise.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>