[MarkLogic Dev General] simple cts:search question
Jacob Meushaw
jmeushaw at gmail.com
Thu Dec 6 08:57:58 PST 2007
Hello All,
I'm stumped on what must be a very simple cts:search question.
I'm trying to identify documents in my database using cts:search which
match a set of parameters. The case I'm stumped on is where I want to
match on both the value of the element as well as one of it's
attributes.
For example a document might contain:
<carList>
<car color="green">M3</car>
<car color="blue">beetle</car>
<car color="yellow">fiat</car>
<car color="red">911</car>
</carList>
I can't seem to figure out how to construct a cts query that matches
both the attribute value and the element value of the same element:
cts:element-query(
xs:QName("carList"),
cts:and-query((
cts:element-attribute-value-query(xs:QName("car"),QName("","color"),"blue"),
cts:element-value-query(xs:QName("car"),"M3")
))
)
This incorrectly matches the example. The M3 is not blue.
Hopefully this makes sense.
Any ideas?
Thanks,
Jake
More information about the General
mailing list