Connecting Tech Pros Worldwide Help | Site Map

slightly convoluted sorry if repost didn't see last one

  #1  
Old October 25th, 2008, 12:25 AM
kishjeff
Guest
 
Posts: n/a
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 <dlgancestor.
The hard part for me is I want to skip all documents if they have
<clientelements with less than two <majortabdescendent 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>
Closed Thread