From: Pierrick B. <pie...@fr...> - 2007-10-09 18:18:01
|
Hi, Wolfgang Meier a écrit : > This means that eXist allows dirty reads and that node references are > instable. That's what I've tried to explain but you've done it far better than me :-) However, I want to understand : let $stamp:= doc( "mycollection/timestampFile.xml" )/timestamp/text() Internally $stamp will be a NodeProxy to doc( "mycollection/timestampFile.xml" )/timestamp/text(), right ? Let's call it p1. Then : let $output := process( $stamp ) return $output declare function process( $stamp ) { let $update := updateTimestampFIle( ) return <dateTimeStamp>{$stamp}</dateTimeStamp> } declare function updateTimestampFIle( ) { let $data := <timestamp>{ fn:current-dateTime()}</timestamp> let $ret := xmldb:store( "mycollection", "timestampFile.xml", $data ) return $ret } $ret, then $update will internally be the same NodeProxy, right ? Let's call it p2. I'd expect p1 and p2 to be different (same document, but text node child of an element node, vs. document node) and, hence, I can't understand why the result, which is the serialization of p1 could be related to p2. My analysis is obviously wrong given Andrzej's results but... where ? Is p1 equal to p2 ? How so ? Cheers, p.b. |