Namespace conflict in XQuery update
While trying to transform an xhtml document I ran into this general case:
copy $ul :=
<ul xmlns="http://www.w3.org/1999/xhtml">
<li>item</li>
<li>item</li>
</ul>
modify
(
rename node $ul as QName("http://www.w3.org/1999/xhtml","ol"),
insert node attribute class {"a"} into $ul
)
return $ulwhich throws an "[XUDY0024] New namespaces conflict with each other." error.
After reading the XQuery update facility recomendation it wasn't clear to me if this is supposed to happen. Do I *have* to use chained copy statements to achieve both renaming a node an inserting an attribute?
Thanks, Alex
Good catch, has been fixed; attributes without namespace are now ignored in the check [1]. I’ve uploaded a new snapsho.
Thanks, Christian
[1] https://github.com/BaseXdb/basex/commit/a587e8c9640f79fd5b5c943356164cea48a0a614 [2] http://files.basex.org/releases/latest/ ___________________________
2013/9/19 alxarch <alxarch at gmail.com>:
Quoted text · alxarch · 30 lines
> While trying to transform an xhtml document I ran into this general case: > > copy $ul := > <ul xmlns="http://www.w3.org/1999/xhtml"> > <li>item</li> > <li>item</li> > </ul> > > modify > ( > rename node $ul as QName("http://www.w3.org/1999/xhtml","ol"), > insert node attribute class {"a"} into $ul > ) > return $ul > > > which throws an "[XUDY0024] New namespaces conflict with each other." error. > > After reading the XQuery update facility recomendation it wasn't clear to me > if this is supposed to happen. Do I *have* to use chained copy statements to > achieve both renaming a node an inserting an attribute? > > Thanks, Alex > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.