Hans-Jürgen, thanks for the compact example. I reduced it to the following input and query.. XML x.xml: <A/> Query x.xq: let $out := element x { ., <B/> } return $out/* Command: basex -ix.xml x.xq ..and recorded it as a GitHub issue [1]. We’ll let you know when the bug has been fixed. Christian [1] https://github.com/BaseXdb/basex/issues/588 ___________________________ On Mon, Oct 29, 2012 at 10:04 PM, Hans-Juergen Rennau <hrennau@yahoo.de> wrote:
Hello,
I noticed a little bug concerning document order. Consider this input:
=== in.xml ==================================== <section> <title>Some title</title> </section> ============================================
and the following query, which (a) extends the contents of <section> by a <para> element (=> $result) (b) and then makes a simple copy of the intermediate result (=> $copy):
=== problem.xq =============================== let $in := /*
let $result := element {node-name($in)} { $in/*, <para>APPENDED ELEMENT</para> }
let $copy := element {node-name($result)} {$result/*}
return <wrap>{ <result>{$result}</result>, <copy>{$copy}</copy> }</wrap> =============================================
Launching the query basex -i in.xml problem.xq
one gets a result in which the contents of $copy are in the wrong order (<para> comes now before <title>, though it should come last).
Kind regards, Hans-Juergen
The query result: ============================================= <wrap> <result> <section> <title>Some title</title> <para>APPENDED ELEMENT</para> </section> </result> <copy> <section> <para>APPENDED ELEMENT</para> <title>Some title</title> </section> </copy> </wrap> =============================================
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk