This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variable in xpath?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]