Dear Leo and Michael,
$session->execute('OPEN myDB; EXPORT path/to/export.xml;CLOSE myDB;')
Command is not clear to me and where I'll place my xquery ?
But the second one is perfect and its working with xquery.
Thanks for the reply.
Best Regards Nafiz
-----Original Message----- From: Leo Wörteler [mailto:lw@basex.org] Sent: Thursday, February 02, 2012 4:36 PM Cc: Nafiz Al Naharul Islam Grameenphone IT Ltd.; basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] export xml using xquery in php
Hi Nafiz,
Am 02.02.2012 11:13, schrieb Michael Seiferle:
I guess you could use the built in EXPORT command.
$session->execute('OPEN myDB; EXPORT path/to/export.xml;CLOSE myDB;')
[...]
Another (again untested :-)) approach might be:
file_put_contents( $filename, $session->execute('XQUERY doc("myDB")') );
one should remark that the first approach would store the XML file on the machine the *BaseX instance* is running on, the second one uses the machine where the *web server* is running. So if these are different in your setup, only one of the snippets will work as expected.
Hope that helps, cheers, Leo
The information contained in this email and any attachment(s) to this email are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient and have received this email and/or its attachment(s) in error, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this email and/or its attachment(s) is strictly prohibited. Please notify the sender immediately and delete this email and any attachments.
WARNING: Computer viruses can be transmitted via email. Although GPIT has taken reasonable precautions to ensure no viruses are present in this email and/or its attachment(s), GPIT does not guarantee that this email and/or its attachments are secure or error-free. The recipient should check this email and any attachment(s) for the presence of viruses. GPIT shall accept no liability whatsoever for any loss or damage arising from the use of this email and/or its attachment(s).