Subject: Re: variable in xpath?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 11 Apr 2002 19:07:35 +0100
|
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
|