how do I query this?

M

Mike Kamermans

hi,

I have the following xml element in a document:

<node name="thisnodename">
<links>
<linkto nodename="somenodename"/>
...
</links>
...
</node>

and I want to, given a variable $nodename, find all nodes that link to
it.
Is there a single xquery that will let me do this? I'm stuck at the fact
that:

"//node/links/linkto[@nodename=$nodename]"

will only give back a /linkto nodeset ... =/

- Mike Kamermans
 
M

Martin Honnen

Mike Kamermans wrote:

"//node/links/linkto[@nodename=$nodename]"

will only give back a /linkto nodeset ... =/

If you are looking for node elements then put the rest into a predicate e.g.
//node[links/linkto[@nodename=$nodename]]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,005
Messages
2,570,264
Members
46,859
Latest member
HeidiAtkin

Latest Threads

Top