Hi,
I've run into an odd difference in the behavior of
cts:element-attribute-value-query() as oppposed to
cts:element-value-query(). (To tell the truth, neither one of them
behaves exactly like I would prefer, but for now I'm just trying to
figure out what is making the difference between them.) Assume the
following four sample documents are in the database:
* <testNode insertDate="10JUN2009" />
* <testNode insertDate="10JUN2009-0849" />
* <testNode>
<insertDate>10JUN2009</insertDate>
</testNode>
* <testNode>
<insertDate>10JUN2009-0849</insertDate>
</testNode>
Wildcard searches are enabled, but pretty much all other settings for
the Documents database are default.
Executing this query:
cts:search(/testNode,
cts:element-value-query(xs:QName("insertDate"), "10JUN2009*"))
returns a single result, as expected:
<testNode>
<insertDate>10JUN2009</insertDate>
</testNode>
On the contrary, executing this query:
cts:search(/testNode,
cts:element-attribute-value-query(xs:QName("testNode"),
xs:QName("insertDate"), "10JUN2009*"))
returns an empty sequence, which is inconsistent with the behavior of
the element-value-query. Further complicating matters, executing an
otherwise identical, case-insensitive version of the above query:
cts:search(/testNode,
cts:element-attribute-value-query(xs:QName("testNode"),
xs:QName("insertDate"), "10jun2009*"))
returns a single result:
<testNode insertDate="10JUN2009" />
which is what I expected the first query to return!
Note that if I remove the trailing wildcard, the case-sensitive and
case-insensitive versions both return the same result, so the
discrepancy seems to exist only for an element-attribute-value-query (or
element-attribute-word-query) that combines case-sensitivity with a
wildcard.
I'd appreciate any ideas you can throw out.
Thanks,
Doug Glidden
Software Engineer
The Boeing Company
[email protected]
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general