Indention might help:

        <data>
                <slask>
                        <value-of/>
                </slask>
        </data>

If you use just 'value-of[...]' as your expression, it will not match,
because <data> does not have a child <value-of> element.  It does have
a <slask> though.

So, if you want to avoid the // notation:

        selectNodes("slask/value-of[...]");

-bob

On Mon, 13 Aug 2001, Mats Noren wrote:

> Hi,
> I have the following xml snippet:
> 
> <data ID="doSearch">
>       <param name="test"/>
>       <param name="test2"/>
>       <slask><value-of select="$test"/></slask>
> </data>
> 
> In my Java code, I want to lookup any element of the type value-of with
> the attribute select="$test"..
> 
> service.selectNodes("//value-of[@select='$" + paramName + "']");
> 
> where service is the data Element in the above XML
> paramName is the value of the name attribute to the param element.
> 
> I tried the following XPath-expression with xalan in a stylesheet and it
> worked: //value-of[@select='$test']...
> 
> I tried to loose the two slashes at the beginning since the context node
> should be the data element, but I still get an empty list back. 
> Any ideas?
> 
> */regards Mats
> 
> 
> _______________________________________________
> dom4j-dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dom4j-dev
> 


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to