[MarkLogic Dev General] Unique Node Reference

Geert Josten Geert.Josten at daidalos.nl
Tue Oct 14 02:26:07 PDT 2008


Deshbir,

One other way to get a unique id for each node is using the XPath function generate-id(), but I wouldn't trust its persistence when the XML is updated, unless someone at MarkLogic could confirm that. I wouldn't bet on it.

I reccon you are best off adding your own ID's. You might be able to write an ML-XQuery that does that for you, with all your content in a single pass.. ;-)

Kind regards,
Geert

> Hello,
>
> 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?
>
> Regards,
> Deshbir
>
>
>
>
>
>
>


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.


> General mailing list
> General at developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>



More information about the General mailing list