<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>I was wondering if someone can help me with a xquery issue I am having.</DIV>
<DIV> </DIV>
<DIV>What I am trying to do is create a web page that will allow a user to enter information about what they are looking for in a xml document and return to them the xml document if it matches their criteria. I thought I had it all working till I hit an issue with missing repeatable complex types.</DIV>
<DIV> </DIV>
<DIV>Example of xml and xquery that works.</DIV>
<DIV> </DIV>
<DIV><book></DIV>
<DIV> <title>Data on the web</title></DIV>
<DIV> <author>Dan Suciu</author></DIV>
<DIV> <section></DIV>
<DIV> <title>Introduction</title></DIV>
<DIV> <figure></DIV>
<DIV> <title>Traditional</title></DIV>
<DIV> <image source="csarch.gih"/></DIV>
<DIV> </figure></DIV>
<DIV> <figure></DIV>
<DIV> <title>Examples</title></DIV>
<DIV> <image source="example.gif"/></DIV>
<DIV> </figure></DIV>
<DIV> </section></DIV>
<DIV> <section></DIV>
<DIV> <title>Syntax</title></DIV>
<DIV> </section></DIV>
<DIV></book></DIV>
<DIV> </DIV>
<DIV>for $book in /book</DIV>
<DIV>for $section in $book/section</DIV>
<DIV>for $figure in $section/figure</DIV>
<DIV>where ($book/author='Dan Suciu' and (($figure/title='Examples' and $section/title='Syntax) or ($figure/title='Examples' and <A href="mailto:$figure/image/@source='example.gif'">$figure/image/@source='example.gif'</A>)))</DIV>
<DIV>return $book</DIV>
<DIV> </DIV>
<DIV>Since the xml matches the where at </DIV>
<DIV><figure></DIV>
<DIV> <title>Examples</title></DIV>
<DIV> <image source="example.gif"/></DIV>
<DIV></figure></DIV>
<DIV>it returns me the enitre document like I want.</DIV>
<DIV> </DIV>
<DIV>Example that breaks my xquery.</DIV>
<DIV> </DIV>
<DIV><book></DIV>
<DIV> <title>Data on the web</title></DIV>
<DIV> <author>Dan Suciu</author></DIV>
<DIV> <section></DIV>
<DIV> <title>Introduction</title></DIV>
<DIV> </section></DIV>
<DIV> <section></DIV>
<DIV> <title>Syntax</title></DIV>
<DIV> </section></DIV>
<DIV></book></DIV>
<DIV> </DIV>
<DIV>for $book in /book</DIV>
<DIV>for $section in $book/section</DIV>
<DIV>for $figure in $section/figure</DIV>
<DIV>where ($book/author='Dan Suciu' and (($figure/title='Examples' or $section/title='Syntax) or ($figure/title='Examples' and <A href="mailto:$figure/image/@source='example.gif'">$figure/image/@source='example.gif'</A>)))</DIV>
<DIV>return $book</DIV>
<DIV> </DIV>
<DIV>This will always return nothing because there is no /book/section/figure in the xml.</DIV>
<DIV> </DIV>
<DIV>I believe once "outer for" is implemented I will be able to do </DIV>
<DIV> </DIV>
<DIV>for $book in /book</DIV>
<DIV>for $section in $book/section</DIV>
<DIV>outer for $figure in $section/figure</DIV>
<DIV>where ($book/author='Dan Suciu' and (($figure/title='Examples' or $section/title='Syntax) or ($figure/title='Examples' and <A href="mailto:$figure/image/@source='example.gif'">$figure/image/@source='example.gif'</A>)))</DIV>
<DIV>return $book</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Anyone have any ideas how I could get this to work?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></td></tr></table><br>