[MarkLogic Dev General] Unique Node Reference

Deshbir deshbir.dugal at comprotechnologies.com
Mon Oct 13 22:58:32 PDT 2008


We are building a client application (XCC) that provides the ability to edit any element/node of document stored in Mark Logic server. The application displays the document (in HTML) and the end-user should be able to select any node and update it. For this purpose the client application needs a way of uniquely identifying a node (of a Mark Logic document) - this identifier can then used to update the node via a 'xdmp:node-replace". 

We could think of the following options:

1. Use the Node Xpath (i.e. doc(".....xml")/xx/yy[i]/zz) as the identifier for the node. This is obviously not a good idea as multiple users would editing the same document and the 
Node Xpath would change.

2. Add our own "ID" attribute (UUID generated) to every node in the document. This ID can then be used in an XPATH expression to safely locate the correct node for updating. This option should work, however requires us to re-process all our existing documents (for adding the ID attribute).

Is there a another way to do this? Does Mark Logic provide a unique ID for a node?


More information about the General mailing list