Querying for a set sequence against an XML Document

M

manojas

What is an appropriate query to do this regular expression like
matching on an XML doc
What I DO NOT want to do is use DOM/SAX and process the tree in the
client side

I need to figure out if a sequence of nodes appear in order.
Given an XML
(1)
<Root>
<Data Tag="A"/>
<Node>
<Data Tag="B"/>
.
.
<Data Tag="C"/>
</Node>
<Root>

In the above document (1) the tags {A,B,C} appears in order,hence the
query returns true.In the case below the tags are not inorder
and {C,B,A} hence the query returns false
(2)
<Root>
<Data Tag="C"/>
<Data Tag="B"/>
<Data Tag="A"/>
<Root>

Like the document shown above the nodes neednt be in the same
hierarchy. Also note that I am interested in
a pattern A*B*C, ie the doc below is fine
(3)
<Root>
<Data Tag="A"/>
<Data Tag="B"/>
<Data Tag="D"/>
<Data Tag="C"/>
<Root>


Thanks in advance
Manoj
 

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
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top