EDN Admin
Well-known member
I am having a problem creating a query which will do the following:
Sample XML:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node1<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node2<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node3<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node4<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node5<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
[/code]
<br/>
What I want to be able to do is a recursive query which can populate "node" objects and maintain their hierarchy.
Doing a query against the "Node" element name brings back all "Node" elements. What I would like is for the first query to bring back one item, a query using that item would bring back 3 elements of which 2 would have no "subelements" to continue the
recursive and the one "Node4" would have one element in its recursive query.
Hope this is clear
Lloyd Sheen <hr class="sig Lloyd Sheen
View the full article
Sample XML:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node1<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node2<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node3<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node4<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Node <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Node5<span style="color:Black; "<span style="color:Blue; ><span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Node<span style="color:Blue; >
[/code]
<br/>
What I want to be able to do is a recursive query which can populate "node" objects and maintain their hierarchy.
Doing a query against the "Node" element name brings back all "Node" elements. What I would like is for the first query to bring back one item, a query using that item would bring back 3 elements of which 2 would have no "subelements" to continue the
recursive and the one "Node4" would have one element in its recursive query.
Hope this is clear
Lloyd Sheen <hr class="sig Lloyd Sheen
View the full article