Hi Damon, The processing flow would be like: I have a pipeline to split my incoming xml file into 2 different files. In this pipeline, module xqy file, a step should be included where I insert a particular block of node into the new xmls that I create. So for this block of node, I need to refer an external file/map (inside the same DB). I need to iterate through all the key-value pairs inside the file/map and insert all those key-value pair nodes into the new xmls that I create.
Point why I make the key-value pair as seperate file is that, in future, there might be changes/additions to these kay-value pair. So i need to make sure that the documents that already exist in the DB (after the split operation) will automatically get updated when i change the external key-value file. This scenario i tried by creating an xml with key-value pair. And then xincluded that into the new docs that I created. So whenever i change the key-value in the xml file, the changes has to reflect on the front end application. I tested this and noticed that, the updation is happening. But not proper. i.e: If i had a value for a particular key - initially as : Hello then i change the value for the same key to : World In the front end, the facets displayed Initially: ========= Hello After the change: ================= Hello World Expected After the chage: ======================== World Thanks, On Wed, Nov 21, 2012 at 2:13 PM, Damon Feldman <[email protected]>wrote: > Sri, > > Reading later posts, I suspect you actually want to store lookup > structures in the DB and get them via xquery calls. A map() is a special > structure that is for holding a fast lookup strucutre _in memory_ during > long-running processing, or perhaps caching it in a "server field" (see > MarkLogic docs for server field functions). > > Can you tell us what you need to accomplish so we can help you pick the > right tool for the job? It may also help us tell you which way to use maps. > > Yours, > Damon > > -- > Damon Feldman > Sr. Principal Consultant, MarkLogic > > ------------------------------ > *From:* [email protected] [ > [email protected]] On Behalf Of sini narayanan [ > [email protected]] > *Sent:* Tuesday, November 20, 2012 12:18 PM > *To:* MarkLogic Developer Discussion > *Subject:* [MarkLogic Dev General] Xquery - Maps > > Hi, > > I have a map to be created as below: > > let $map := map:map() > let $key := map:put($map, "1", "hello") > let $key := map:put($map, "2", "world") > return $map > > How do I store this as a file in MarkLogic DB? > What would be the format in which maps are saved ? > > I want to access this map from an xqy module which would pass the key as > input to the map file to get the output. > Please advice. > > Thanks > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
