W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2006

RE: Recursive replacement

From: Martin Probst <martin@x-hive.com>
Date: Mon, 30 Jan 2006 19:37:59 +0100
To: Novak <novak@ispras.ru>
Cc: "'David Carlisle'" <davidc@nag.co.uk>, www-ql@w3.org
Message-Id: <1138646279.7862.39.camel@localhost.localdomain>

> document: <root><a/><b><c/></b></root>
> 
> 1) 
> query insert doc("test.xml)//c into doc("test.xml)//a
> 
> result: <root><a><c/></a><b/></root>
> 
> 2)
> query for $i in doc("test.xml)//root/* do insert doc("test.xml)//c into $i
> 
> result: implementation-dependent
> 
> Am I right?

I don't think inserting a node that is currently in the tree moves it
away. The spec refers to the way it's done within element constructors.
Why should "insert" move something around anyways?

In both cases each of the target elements gets a <c/> inserted, but
those are always copies of the original nodes.

Martin
Received on Monday, 30 January 2006 18:38:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:44 UTC