Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - how do I query this?

 
Thread Tools Search this Thread
Old 09-16-2006, 02:54 PM   #1
Default how do I query this?


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


Mike Kamermans
  Reply With Quote
Old 09-16-2006, 02:58 PM   #2
Martin Honnen
 
Posts: n/a
Default Re: how do I query this?



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]]

--

Martin Honnen
http://JavaScript.FAQTs.com/
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump