-- /* Sandy Pittendrigh >--oO0> * [EMAIL PROTECTED] * http://cns.montana.edu/~sandy */
I'm using a fairly recent xml_xindice1.1 from cvs I'm having trouble "ANDing" several fully qualified xpath conditions into one coherent condition. Is the following XPath behavior an xindice feature or a bug?
I have a collection of xml files stored in /db/data. The structure of all said files is identical, varying only by the values associated with various attribute labels, for instance the following XML is a snipped portion of a representative file: ... <XSIL Name="MM_DD_YYYY_DATE"> <Param Name="value">01-01-1994</Param> <XSIL Name="gui"> <Param Name="class" Type="neurosys.PullDownWidget" /> <XSIL Name="menuItems"> <Param Name="item">01_01_2001</Param> <Param Name="item">01_02_2001</Param> <Param Name="item">01_03_2001</Param> </XSIL> </XSIL> </XSIL> ... Further: xindice xpath -l -c /db/data -q 1) "/XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'HAIR_LENGTH']" 2) "/XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'FIXATIVE']" 3) "/XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'DIRECTIONAL_TUNING']" All three of the above xpath statements return values, because all three labels (HAIR_LENGTH, FIXATIVE and DIRECTIONAL_TUNING) exist at the same nested-depth level. So I want to verify what I already know: that HAIR_LENGTH, FIXATIVE and DIRECTIONAL_TUNING exist in each file, at the same nested depth level. Attempt #1: xindice xpath -l -c /db/data -q "/XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'HAIR_LENGTH']/ancestor::* /XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'FIXATIVE']/ancestor::* /XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'DIRECTIONAL_TUNING']" ...returns nothing. Attempt #2: Oddly, if I reduce the XSIL nesting for the second condition by one, and if I reduce the XSIL nesting for the third condition by two, then xindice returns every file in the collection: xindice xpath -l -c /db/data -q "/XSIL/XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'HAIR_LENGTH']/ancestor::* /XSIL/XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'FIXATIVE']/ancestor::* /XSIL/XSIL/XSIL/XSIL/[EMAIL PROTECTED]'DIRECTIONAL_TUNING']" So something is incorrect, either on my part (the way I used xpath) or the way the server interpreted the query. PUNCHLINE: 1) What IS the best way to "AND" several fully qualified xpaths into one condition? 2) Is this behavior a bug, or is xpath supposed to behave this way? Why?