Monday, 15 August 2011

basex - XQuery to change attribute value and return previous one -



basex - XQuery to change attribute value and return previous one -

i'm trying update attribute value of node , homecoming previous value in 1 query , can't find way it. i'm using basex xml/xquery database.

for i've tried doing this:

/root/elem/properties/property[@id='17']/@format, replace value of node /root/elem/properties/property[@id='17']/@format 'url'

and this:

for $prop in /root/elem/properties/property[@id='17'] allow $format := $prop/@format homecoming (replace value of node $prop/@format 'url', $format)

and multiple other tests lead next error:

list expression: no updating look allowed.

is limitation of basex or not possible in xquery?

xquery update not allow returning results updating query. can utilize basex's proprietary db:output($seq) function that:

for $prop in /root/elem/properties/property[@id='17'] allow $format := $prop/@format homecoming (replace value of node $format 'url', db:output($format))

xquery basex

No comments:

Post a Comment