bug in namespace resolution after inserts

Thursday, 4 February 2010 · 2 messages
CG
Christian Grünin reply to Rares Vernica, 4 Feb 2010, 02:124 Feb 2010 01:48 #
Quoted text · Rares Vernica · 1 line
> I think there might be a bug in namespace resolution after an insert.
This problems seems to be related to another tracked namespace issue; I've added your observation to the following bug entry: https://sourceforge.net/tracker/index.php?func=detail&aid=2941714&group_id=192179&atid=940354 Thanks for the detailed info; expect a bug fix soon, Christian
Quoted text · Rares Vernica · 48 lines
> > I have two xml files: > > doc.xml > > <?xml version="1.0" encoding="UTF-8"?> > <doc xmlns:a="http://a"> > <a:x>1</a:x> > </doc> > > doc2.xml > > <?xml version="1.0" encoding="UTF-8"?> > <r xmlns="http://b" xmlns:a="http://a"> > <a:x>2</a:x> > </r> > > I create database "doc" from "doc.xml". Then, I preform the following > insert query: > > declare namespace a = "http://a"; > declare namespace b = "http://b"; > > insert nodes doc("doc2.xml")/b:r/a:x > into basex:db("doc")/doc > > and the result is: > > <doc xmlns:a="http://a"> > <a:x>1</a:x> > <a:x xmlns="http://b">2</a:x> > </doc> > > but > > basex:db("doc")/doc/a:x > > returns > > <a:x xmlns:a="http://a">1</a:x> > > Cheers, > Rares > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
RV
Rares Vernica4 Feb 2010 02:12 #
Hello, I think there might be a bug in namespace resolution after an insert. I have two xml files: doc.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <doc xmlns:a="http://a">
    <a:x>1</a:x>
  </doc>
doc2.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <r xmlns="http://b" xmlns:a="http://a">
    <a:x>2</a:x>
  </r>
I create database "doc" from "doc.xml". Then, I preform the following insert query:
  declare namespace a = "http://a";
  declare namespace b = "http://b";
insert nodes doc("doc2.xml")/b:r/a:x into basex:db("doc")/doc and the result is:
  <doc xmlns:a="http://a">
    <a:x>1</a:x>
    <a:x xmlns="http://b">2</a:x>
  </doc>
but
  basex:db("doc")/doc/a:x
returns
  <a:x xmlns:a="http://a">1</a:x>
Cheers, Rares

⚡Generated with XQuery