http://docs.basex.org/wiki/XQuery_Update mentions insert attribute. So how can I insert attribute?
$ cat x.xq copy $c := <entry> <title>Transform expression example</title> <author>BaseX Team</author> </entry> modify ( replace value of node $c/author with 'BaseX', replace value of node $c/title with concat('Copy of: ', $c/title), insert node <author>Joey</author> into $c, insert attribute Z {'B'} into $c/title, ) return $c $ basex x.xq Stopped at /tmp/x.xq, 10/10: [XPST0003] Expecting ')', found 'a'.
Attribute is node, so
insert node attribute Z {'B'} into $c/title.
On replace: replace value of node $another/@Y with 'C'.
-- Arto Viitanen
basex-talk@mailman.uni-konstanz.de