XQuery Update delete attributes
Hi all, can’t figure it out. Is there any way in XQuery Update, to delete a specific attribute from any node? Thanks for help. Best regards Günter
Quoted text · Günter Dunz-Wolff · 3 lines
On 27.09.2020 14:48, Günter Dunz-Wolff wrote: > Hi all, > can’t figure it out. Is there any way in XQuery Update, to delete a specific attribute from any node?
Doesn't
delete node //@foo
delete all "foo" attributes?
Or
. update delete node descendant-or-self::*/@foo
?
Question to Christian: why does
. update delete node descendant-or-self::*/@class
work for me but
/ update delete node descendant-or-self::*/@class
gives an error unexpect end of query.
Quoted text · Martin Honnen · 12 lines
> > > Question to Christian: why does > > . update delete node descendant-or-self::*/@class > > work for me but > > / update delete node descendant-or-self::*/@class > > gives an error unexpect end of query. >
OK, / update is ambigious, it has to be
(/) update delete node //@class
to make sure the update is not seen as a child node selection of update elements to the root node /.
Hi Martin, delete node //@foo did the job. Thanks.
Written for BaseX 9.4. BaseX may have changed since: please check the current documentation.