|
Re: XUpate exception in september snapshots: msg#00193text.xml.exist
Hi, this is not really an XUpdate error, but an error in the number() function: contrary to the XQuery functions spec, number() does currently not work without an argument. You can rewrite the expression as follows: {number(document('/db/rep1/ids.xml')/ids) + 1} > Hi, I am experiencing a problem with the two september snapshots: I > have a query that also performs an XUptade. Its goal is to generate > unique numbers that I use for putting ids to xml nodes. > I have an ids.xml file that contains something like: <ids>100</ids>. > And here is the request: > xquery version "1.0"; > declare namespace xmldb="http://exist-db.org/xquery/xmldb"; > let $root := xmldb:collection('xmldb:exist:///db/rep1', 'admin', '') > let $id := document('/db/rep1/ids.xml')/ids > let $mods := xmldb:update( > $root, > <xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate"> > <xu:update select="document('/db/rep1/ids.xml')/ids"> > {document('/db/rep1/ids.xml')/ids/number()+1} > </xu:update> > </xu:modifications>) > return <result id="{$id}"/> > I also would like to know if there is a better way to generate unique > ids, I mean something automatic and thread-safe as sequences in SQL? I think this would be a good candidate for an extension function. Wolfgang ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: XQuery question: 00193, Piotr Kaminski |
|---|---|
| Next by Date: | XQuery part good, part bad, todays snapshot: 00193, Amotz Anner |
| Previous by Thread: | XUpate exception in september snapshotsi: 00193, Guillaume Pothier |
| Next by Thread: | XQuery part good, part bad, todays snapshot: 00193, Amotz Anner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |