From: Wolfgang M. <wol...@gm...> - 2005-12-13 21:56:59
|
If you don't wrap the constructed nodes into a containing node, they should be returned in exactly the same order in which they were created. A sequence constructor should also preserve the order of its items, i.e. (<p>hello</p>, <h1>hello again</h1>) should return <p>, then <h1>. As Michael already explained, if parts of that sequence come from an xpath selection on an existing document, the corresponding items will be in document order when they are added to the output sequence. So if you add $nodes to the above sequence, the items in $nodes will be added in the same order as they were in the original document. Unfortunately, your function is too complex to see what's going on. Maybe you could comment out parts of it and check the resulting output to see where the order is changed. Wolfgang On 12/13/05, Michael Beddow <mbe...@mb...> wrote: > Jonas Lundberg wrote: > > > Unless I wrap them in a containing node, like below, > > the nodes may emerge in any order, on the web page. > > It thus seems like the containing node contains the order of the nodes. > > > <div> > > <p>hello</p> > > <h1>hello again</h1> > > <p>goodbye</p> > > </div> > > Not sure about the rest, but that bit of things is simple enough. Once yo= u > wrap a set of nodes in a parent element, the XML document order rules app= ly > to those nodes and any conformant app must keep them in that document ord= er. > Take away the wrapper and the order of "floating" nodes becomes > implementation dependent (except that if they were derived from an exisit= ing > document rather than created on the fly, they should still be in document > order unless you have explicitly sorted them). The latest XQuery CR hasn'= t > helped a lot by floating the possibility of an alternative, > implementation-defined, order that can be maintained instead of document > order, but that's another matter. > > Michael Beddow > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |