Tony, You might try the functx functions functx:distinct-deep or functx:distinct-nodes.
The functx library ships with Mark Logic server 4.1+ in two flavors, either with comments (easier to read) or without (slightly faster). We don't support it (it's open source) but it does have lots of useful goodies. import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-doc-2007-01.xqy"; or import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy"; The excellent Priscilla Walmsley wrote most of these functions. She has fantastic documentation at http://www.xqueryfunctions.com/xq/ -m On Feb 16, 2010, at 8:10 AM, Tony Mariella wrote: > Is there a way to use fn:distinct-nodes or fn:distinct-values to > return a set of distinct node that are part of the results xml ? > Example: > > <results> > <item> > <addr>24 Short Rd</addr> > <city>Baltimore</city> > <state>MD</state> > <testVal/> > </item> > <item> > <addr>24 Short Rd</addr> > <city>Baltimore</city> > <state>MD</state> > <testVal/> > </item> > <item> > <addr>24 Short Rd</addr> > <city>Baltimore</city> > <state>MD</state> > <testVal/> > </item> > <item> > <addr>24 Short Rd</addr> > <city>Baltimore</city> > <state>MD</state> > <testVal>TEST1</testVal> > </item> > </results> > The highlighted xml is what I would want returned. > Or if all the items are identical, only return a single item. > This is a query result so I would not know the results in advance. > > Tony Mariella > Raytheon Company > > > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
