Consider the following xml:
<Record>
<Author>
<FirstName>David</FirstName>
<LastName>Raj</LastName>
</Author>
<Author>
<FirstName>Sim</FirstName>
<LastName>Son</LastName>
</Author>
<Editor>
<FirstName>Sandy</FirstName>
<LastName>John<LastName>
</Editor>
</Record>
In present I use element-query to get the values from <Author>.
<constraint name="Author">
<element-query ns="" name="Author" />
{$OPTIONS}
</constraint>
I don't want to search or get the values of <LastName> element, but need only the value of <FirstName> of Author element alone. Is it possible to create nested-constraint for this??
If possible could anyone elaborate it??
Thanks.
Sofi:
You supply the criteria for the contained element in the query, not in the constraint.
In this case, you would create two constraints: an element-query constraint on the ContentOwnerType and a value constraint on the Description. Then, in the query, the element-constraint-query for ContentOwnerType should contain the value-constraint-query on the Description.
Here's the documentation for element-constraint-query:
http://docs.marklogic.com/guide/search-dev/structured-query#id_64263
As an alternative, you can define a field that includes ContentOwnerType and excludes Code:
http://docs.marklogic.com/guide/admin/fields#id_78911
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With