Hi Ashwini, I may be mistaken, but I believe that distinct-nodes returns results based on node identity, which is not what you are looking for. It sounds like you are searching for functx:distinct-deep. http://www.xqueryfunctions.com/xq/functx_distinct-deep.html
A copy of the xqueryfunctions is distributed with MarkLogic Server 4.1. You can include that by adding the following import: import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy"; Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of Ashwini > Sent: woensdag 25 november 2009 14:48 > To: [email protected] > Subject: [MarkLogic Dev General] distinct nodes > > Hi All, > > how to find out distinct nodes in marklogic4.1-2. > > here i am providing sample xml data > > let $input:=<Actor> > > <Person> > <Name> > <CurrentName> > <Given>John</Given> > <Family>Doe</Family> > </CurrentName> > <DisplayName>John C. Doe, M.D.</DisplayName> > </Name> > </Person> > > <Person> > <Name> > <CurrentName> > <Given>John</Given> > <Family>Doe</Family> > </CurrentName> > <DisplayName>John C. Doe, M.D.</DisplayName> > </Name> > </Person> > > <Person> > <Name> > <CurrentName> > <Given>John</Given> > <Family>Doe</Family> > </CurrentName> > <DisplayName>John C. Doe, M.D.</DisplayName> > </Name> > </Person> > > <Person> > <Name> > <CurrentName> > <Given>mike</Given> > <Family>julies</Family> > </CurrentName> > <DisplayName>mike C. julies, M.D.</DisplayName> > </Name> > </Person> > > </Actor> > > i want to get the output of distinct persons. > required output should be like this . > return "<Actor> > <Person> > <Name> > <CurrentName> > <Given>John</Given> > <Family>Doe</Family> > </CurrentName> > <DisplayName>John C. Doe, M.D.</DisplayName> > </Name> > </Person> > > <Person> > <Name> > <CurrentName> > <Given>mike</Given> > <Family>julies</Family> > </CurrentName> > <DisplayName>mike C. julies, M.D.</DisplayName> > </Name> > </Person> > > </Actor>" > > how i can find distinct nodes(Not distinct values) > > > > Thank you . > > > Regards, > Ashwini > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
