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