Use xdmp:random if at all possible, even if it means changing the way things work today. Sooner or later, emulating a sequence will cause serialization headaches. If you would rather store a shorter string, wrap xdmp:random with xdmp:integer-to-hex.
There isn't much information here about what you'll be doing with the versioned information. The most generic answer is DLS: http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/xml/dev_guide/dls.xml If that turns out to be a poor fit, you might have to roll your own versioning to better suit your needs. The biggest question to ask yourself is "how will we query the versioned history?". The answers will drive your document and XML structure. -- Mike On 14 Dec 2011, at 07:58 , Singh, Gurbeer wrote: > Hi, > > We have a new item to implement. Need your guidance for implementing this. > > Currently we have a architecture like this, > > API is developed using asp.net/Jquery > Backend is Sybase > Repository is Marklogic 4.2 > > We have a submission form to submit documents, When user submits a document, > it goes to Sybase Db, generates a UId for document and save a entry in > Sybase, comes back appends the UID in XML and save it to Marklogic repository. > > Why we are using Sybase ? > To generates UID, to maintain history ,so that we can track what all changes > we are doing on every submit of a document. > We have a requirement to remove Sybase and have only ML. > > We figured out how to generate UID in ML, if we want a sequence number, have > a XML and read this XML and increase the count by one and update the XML > file. > Or use xdmp:random() not sure how good is this. > > We want to know how to maintain version of a element in XML. > > Example : > Have a element Location, first time user submit with value Americas,second > time it change it to Asia Pacific. Currently we are overwriting this in ML > and maintaining history in syabe. > > > ~Gurbeer > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions > or views contained herein are not intended to be, and do not constitute, > advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform > and Consumer Protection Act. If you have received this communication in > error, please destroy all electronic and paper copies and notify the sender > immediately. Mistransmission is not intended to waive confidentiality or > privilege. Morgan Stanley reserves the right, to the extent permitted under > applicable law, to monitor electronic communications. This message is subject > to terms available at the following link: > http://www.morganstanley.com/disclaimers. If you cannot access these links, > please notify us by reply message and we will send the contents to you. By > messaging with Morgan Stanley you consent to the foregoing. > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
