I am working on search where content is available in multiple languages. I have 
found that the position of the "xml:lang" attribute in the root of the document 
is affecting the search results.

For example, if I have two documents, each in Spanish, but with the xml:lang 
attribute in different positions, querying for an attribute value that is 
before the xml:lang attribute is always treated as an "English" value.

Documents:

<doc xml:lang="spa" type="article" uri="/article/1">
    <content/>
</doc>

<doc type="article" xml:lang="spa" uri="/article/2">
    <content/>
</doc>

Query:

cts:search(/doc,
    cts:element-attribute-value-query(xs:QName("doc"), xs:QName("type"), 
"article", "lang=spa")
)

This query will return only the first document.

If I omit "lang=spa" from the query then only the second document is returned.

cts:search(/doc,
    cts:element-attribute-value-query(xs:QName("doc"), xs:QName("type"), 
"article")
)

So a few questions:
Has anyone else run into this before?
Is this the expected behavior?
Is attribute order important for other attributes, or just xml:lang?

Thanks,

-Dan Smith


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to