Subject: Re: [xsl] Matching attribute with condition in predicate|
From: Михаил Сабуренков <jack.vosmerkin@xxxxxxxxx>
Date: Tue, 22 Dec 2009 18:13:19 +0300
2009/12/22 G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx>: > > Because the "/" at the start of "/root/@condition" is the top of the > _current tree_, not the top of the initial tree. B 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: > B <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.