It's mad - I don't add a namespace, the source document is a text file without a namespace - and the log shows that I don't add it ... but it appears. No idea why.
MIke On 2 Apr 2012, at 14:52, Christian Grün wrote: > So it seems that the once added namespace is propagated to other > documents? I believe there must be at least one document with the > mentioned namespace in your database; otherwise I can't explain where > it should come from (afaik, the string "http://www.w3.org/1999/xhtml" > isn't hard-coded anywhere in the project)... > > Christian > ___________________________________ > > On Mon, Apr 2, 2012 at 3:40 PM, Mike Hawkes <mikehaw...@me.com> wrote: >> The database contains >> >> <root> >> <auditlog> >> >> ... elements should end up in here ... >> >> </auditlog> >> </root> >> >> >> The initial XML file contains the initial nodes with which to populate the >> XML database (root plus numerous other nodes). The PHP code inserts >> additional nodes as it runs. For every node I add, I create an audit entry >> to allow me to determine who and how the database built over time. >> >> initialdb.xml contains, therefore: >> <root> >> <auditlog/> >> </root> >> >> You're right - ignore 'test' - I meant WYP in the database - as in >> >> drop database WYP >> create database WYP test/initialdb.xml >> >> Apologies for any confusion caused. >> >> It's really weird - I can't get this to fail consistently - but when it >> starts inserting the namespace attribute, it then continues to do so. >> >> Cheers >> Mike >> >> On 2 Apr 2012, at 14:30, Christian Grün wrote: >> >>> Sorry, I still got some questions.. >>> >>>> drop database test >>>> create database test /initialdb.xml >>> >>> The database you're creating seems to be called "test"; what's >>> "initialdb.xml"? >>> >>>> 14:00:00.710 [127.0.0.1:49788] QUERY(4) declare variable >>>> $DB external; insert node <audit >>>> QID='80C18E9A-46DD-4B3E-89E9-967DAFD79A0B' UID='i1' >>>> guid='0EEDDB47-726E-49F8-B1EF-0F73ED848969' >>>> sessionID='48090b7f0e3a62a42a0457a3e88301ca' mode='active' >>>> date='2012-04-02T13:00:00+00:00'/> into doc($DB)/root/auditlog OK >>>> 0.09 ms >>>> 14:00:00.710 [127.0.0.1:49788] QUERY(4) OK 0.05 ms >>>> 14:00:00.710 [127.0.0.1:49788] BIND(4) DB WYP OK >>>> 0.05 ms >>> >>> The log info implies you're having "root" and "auditlog" nodes, and >>> the addressed database is called "WYP", is that right? Could you pass >>> us on the missing snippets? >>> >>> Christian >>> >>> >>> >>>> On 2 Apr 2012, at 14:11, Christian Grün wrote: >>>> >>>>> Hi Mike, >>>>> >>>>> thanks for your report. It would be great if you could provide us with >>>>> a small example that allows us to reproduce the issue (an export of >>>>> your original database with the namespace (which is being added to the >>>>> new node) may suffice). >>>>> >>>>> Best, >>>>> Christian >>>>> ____________________________ >>>>> >>>>> On Mon, Apr 2, 2012 at 2:44 PM, Mike Hawkes <mikehaw...@me.com> wrote: >>>>>> Hi >>>>>> >>>>>> I have a weird problem ... I'm running a query via the PHP interface and >>>>>> run the following query: >>>>>> >>>>>> declare variable $DB external; >>>>>> >>>>>> insert node >>>>>> <audit QID='C54B14ED-C748-4DF0-87F2-91F505BE207B' >>>>>> UID='i1' >>>>>> guid='CC9D4D2B-B380-494B-B0F6-4D72471557B0' >>>>>> sessionID='48090b7f0e3a62a42a0457a3e88301ca' >>>>>> mode='active' >>>>>> date='2012-04-02T12:21:05+00:00'/> >>>>>> into doc($DB)/root/auditlog >>>>>> >>>>>> -- >>>>>> BaseX log shows that it gets the query as-is. >>>>>> >>>>>> When I look at the data within the database by running the XQuery >>>>>> >>>>>> /root/auditlog >>>>>> >>>>>> I find that BaseX has inserted a namespace attribute as follows: >>>>>> >>>>>> <audit xmlns="http://www.w3.org/1999/xhtml" >>>>>> QID="C54B14ED-C748-4DF0-87F2-91F505BE207B" >>>>>> UID="i1" guid="CC9D4D2B-B380-494B-B0F6-4D72471557B0" >>>>>> sessionID="48090b7f0e3a62a42a0457a3e88301ca" mode="active" >>>>>> date="2012-04-02T12:21:05+00:00"/> >>>>>> >>>>>> How do I stop this occurring? It only does it on the audit components, >>>>>> not on anything else inserted by the PHP script. So, if I run two insert >>>>>> node queries, the first will run normally, the audit update causes the >>>>>> xmlns attribute to appear, effectively putting it in a different >>>>>> namespace to the other data inserted by the PHP. >>>>>> >>>>>> The PHP script is as follows: >>>>>> >>>>>> $audit = "declare variable \$DB external; " . >>>>>> "insert node <audit QID='$queryID' UID='$userID' " . >>>>>> "guid='$guid' sessionID='" . session_id() . "' " . >>>>>> "mode='active' " . >>>>>> "date='$dateTime'/> into doc(\$DB)/root/auditlog"; >>>>>> >>>>>> $query = $session->query( $audit ); >>>>>> $query->bind( 'DB', $DB); >>>>>> $query->bind( 'SYSDATA', $SYSDATA ); >>>>>> $query->execute(); >>>>>> $query->close(); >>>>>> >>>>>> >>>>>> Thanks in advance for any suggestions. >>>>>> >>>>>> Mike >>>>>> _______________________________________________ >>>>>> BaseX-Talk mailing list >>>>>> BaseX-Talk@mailman.uni-konstanz.de >>>>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>> >> _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk