Sandesh,
This is a generic question on XQuery. There is no
way to query for a "range" of child nodes as you might
expect. You have to just ask for them individually.
Using BDB XML's dbxml shell program and your test program,
this query would work, assuming you've created an
in-memory container (path is ""), and inserted a document
that looks like your example:
dbxml> query "for $a in collection('')/root/a
return ($a/text()[2],$a/child::tag2,$a/text()[3])"
3 objects returned for eager expression 'for $a in
collection('')/root/a
return ($a/text()[2],$a/child::tag2,$a/text()[3])'
dbxml> print
I need This Content
<tag2>I need this too</tag2>
I need Till here
Regards,
George
Sleepycat Software
sandesh wrote:
Quote:
Hi!
I am struggling to query a part of the node
eg:
I have node
root
a
It starts with
tag1>hello</tag1
I need This Content
tag2>I need this too</tag2
I need Till here
tag3>goodbye</tag3>.
/a
/root
Here I want to get the content which are in between <tag1> and <tag3
( i.e
I need This Content
tag2>I need this too</tag2
I need Till here
) |