slightly convoluted sorry if repost didn't see last one

K

kishjeff

Hi.

This is a slightly convoluted question, but maybe it is obvious..

<convolutedquestion>
I'd like to search a set of xml documents and get the element name and
its id attribute of everything that does not have a <dlg> ancestor.
The hard part for me is I want to skip all documents if they have
<client> elements with less than two <majortab> descendent elements.

So basically I would like to exclude some of the documents from the
results based on their content.. for example the query would skip xml
file 1 below, but include xml file 2:

xml file 1

<big picture>
<client>
<area>
<majortab ... />
<majortab .../>
</area>
</client>
</big picture>


xml file 2

<big picture>
<client>
<area>
<majortab .../>
</area>
</client>
</big picture>

So If I wanted to find element in every file (above just xml file 2)
that had an attribute called "select", I'd do something like this
(except this doesn't fly):

for $doc in collection('c:\myxmldir')
for $b in $doc //clientarea[count(child::tab) > 1]
for $a in $b //*[@select]
return
<Atable>{$a}</Atable>

</convolutedquestion>
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top