Namespace serialization would be more robust using http://docs.marklogic.com/xdmp:key-from-QName rather than fn:name().
-- Mike On 15 Aug 2013, at 10:59 , "Gary Larsen" <[email protected]> wrote: > Thank you! > > Gary Larsen > Envisn Inc. > 508-259-6465 > > From: [email protected] > [mailto:[email protected]] On Behalf Of Geert Josten > Sent: Thursday, August 15, 2013 10:57 AM > To: MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] list of element name > > Hi Gary, > > Here a more streaming approach: > > let $map := map:map() > let $_ := > for $d in collection() > for $e in $d//*/name() > return map:put($map, $e, $e) > return > map:keys($map) > > keys are unsorted though.. > > Kind regards, > Geert > > Van: [email protected] > [mailto:[email protected]]Namens Gary Larsen > Verzonden: donderdag 15 augustus 2013 16:51 > Aan: 'MarkLogic Developer Discussion' > Onderwerp: Re: [MarkLogic Dev General] list of element name > > Thanks Geert, > > Using a small database, but the distinct-values(collection()//*/name()) > return an expanded tree cache full error. I was hoping that there would be a > list of node names kept somewhere that could be used, but haven’t found any > functions like that. > > Gary > > From: [email protected] > [mailto:[email protected]] On Behalf Of Geert Josten > Sent: Thursday, August 15, 2013 10:27 AM > To: MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] list of element name > > Hi Gary, > > You could do distinct-values(collection()//*/name()), but that will get > pretty slow if your collection becomes larger than, let’s say, 1000 large > docs. If you would be satisfied with an estimate, you could pick 100 docs out > of the collection, or do some kind of cherry picking based on domain > knowledge, and do the distinct on those. > > Kind regards, > Geert > > Van: [email protected] > [mailto:[email protected]]Namens Gary Larsen > Verzonden: donderdag 15 augustus 2013 16:21 > Aan: General MarkLogic Developer Discussion > Onderwerp: [MarkLogic Dev General] list of element name > > Is there a way to get a list of element names that exist in a specific > collection? > > Most of our content is generated by serializing Java beans so the schema is > not documented. > > > > Thanks, > Gary > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
