This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: variable in xpath?
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Steve Renshaw" <renshaw_steve at hotmail dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 11 Apr 2002 19:07:35 +0100
- Subject: Re: [xsl] variable in xpath?
- Organization: Jeni Tennison Consulting Ltd
- References: <F225Gr2FYRPtpKR5oUs000118e5@hotmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Steve,
> with <element> as the context node, how do i select the contents of
> either <a> or <b> using $child from the following fragment?
You need to find the elements and filter them to include only those
(or that one) whose name is the same as the value of $child. You can
filter node sets with a predicate ([]s) and you can find the name of
an element with the name() function. So you need:
*[name() = $child]
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list