Hi Greet,
 
In the query you have mentioned, I am not sure about the whole string value, 
passed to the cts:element-value-match () query. I will pass only the starting 
character as given below. The value matched in first query should be validated 
using second query.Will it be possible to do dynamically, check the output of 
query 1 in query 2
 
cts:element-value-match(xs:Qname(“prod:Name”), “S*”,()) (:query1:)
and cts:element-value-match(xs:Qname(“group:Name”), “?????”,())  (:query2:)
 
 
Regard,
Mano

Hi Mano,
 
There are a few things that need attention. If your xml contains namespaces, 
you 
will need to include those in the xs:QName’s. You will also need a range index 
on the Name element in the group namespace. You are aware that the 
cts:element-value-match function returns a Boolean, and not an element of any 
kind?
 
Anyhow, what I meant is something like this:
 
cts:element-value-match(xs:Qname(“prod:Name”), “Herbal cream”,())
and cts:element-value-match(xs:Qname(“group:Name”), “Herbal cream”,())
 
You could pass in a cts:document-query to make sure the value match is 
restricted to the Product.xml and Group.xml respectively. Make sure to declare 
the prod and group namespaces.
 
Kind regards,
Geert
 
Van:[email protected] 
[mailto:[email protected]] Namens mano m
Verzonden: maandag 28 februari 2011 15:03
Aan: General MarkLogic Developer Discussion
Onderwerp: Re: [MarkLogic Dev General] cts:query?
 
Hi  Greet,
 
Thanks for your suggestion.
Can you please elobrate your solution with sample?
 
Search will be done on two xml  documents having different namespace
Element range index is created for <name> element in Product.xml .  
Not created for Group.xml.
 
Regards,
Mano
 

________________________________

From:Geert Josten <[email protected]>
To: General MarkLogic Developer Discussion <[email protected]>
Sent: Mon, 28 February, 2011 6:56:09 PM
Subject: Re: [MarkLogic Dev General] cts:query?



Hi Mano,
 
Just call cts:element-value-match twice and don’t use the query parameter in 
this case. This query would have to apply to the same fragment (e.g. document 
in 
your case), and that does not apply here..
 
Kind regards,
Geert
 
Van:[email protected] 
[mailto:[email protected]] Namens mano m
Verzonden: maandag 28 februari 2011 14:21
Aan: [email protected]
Onderwerp: [MarkLogic Dev General] cts:query?
 
Hi
 
 My xmls will be in the format given below. I am searching for the Name field
Product.xml(multiple xml in same format stored in Ml server)
<item>
<id>10202</id>
<Name>Herbal cream</Name>
<group>
<id>i1</id>
<description> cream product</description>
</group>
<method>
            <id>md128</id>
            <description>herbal</description>
</method>
<groupdesc>cream product</groupdesc> (:Indexed based on this group element:)
<item>
 
Group.xml
 
<Group>
    <category id ="A">
        <Name>Herbal cream</Name>
    </category>
    <category id ="B">
…
    </category>
…
</Group>
 
 
I am using cts:element-value-match() query to search in <Name> element in 
Product.xml 

 (created element range index for <Name>  field) .Simultaneously I need to 
verify whether the same name is present in Group.xml another xml. Please 
suggest 
which cts:query() I need to used to check this condition along with 
cts:element-value-match()
 
Let $query :=???
return cts:element-value-match(xs:Qname(“Name”), “Herbal cream”,() , $query)
 
Thanks in advance
 
Regards,
Mano
 
 
________________________________
From: Geert Josten <[email protected]>
To: General MarkLogic Developer Discussion <[email protected]>
Sent: Tue, 1 March, 2011 3:13:29 AM
Subject: Re: [MarkLogic Dev General] cts:query?


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

Reply via email to