This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: variable in xpath?
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 12 Apr 2002 01:03:24 +0200
- Subject: Re: [xsl] variable in xpath?
- References: <F158I9mK6PYzDabigPa00000509@hotmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I will give it a try, but could someone comment on the predicate within
> predicate syntax used here? It is very
> rare - I never saw it beofre
>
> >Try:
> >
> > select="element[*[name()=$child and . = $value]]"
Hi Steve,
sometimes you need complex XPATH expressions and then you maybe have such
constructs. It's nothing bad or so. And it has the same meaning as a single
predicate:
select all <element> [which have a child element [whose name() is the same
as stored in $child and whose concatenation of all descendant text nodes is
the same as stored in $value]]
But as in every programming language: Don't use too many braces and too many
nestings for readability.
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list