Hi there
Thanks for the reply! That's true, but I thought you were to send an absolute path to the XML file, as is the case when using the basexclient from the terminal? Could you direct me to the documentation of the Session object in the Perl client? I cannot find it (and I find a lot of Java examples).
I'll try to push the contents of the file directly now, I'll get back to you.
Thanks
Bram
-----Oorspronkelijk bericht----- Van: Christian Grün [mailto:christian.gruen@gmail.com] Verzonden: dinsdag 4 oktober 2016 12:37 Aan: Bram Vanroy bram.vanroy1@student.kuleuven.be CC: BaseX basex-talk@mailman.uni-konstanz.de Onderwerp: Re: [basex-talk] Content is not allowed in prolog
Hi Bram,
I guess I should spend more time with your code, but it seems you are not sending the (required) file contents, but only the file name?
Cheers, Christian
On Tue, Oct 4, 2016 at 12:29 PM, Bram Vanroy bram.vanroy1@student.kuleuven.be wrote:
Hi all
This error has been handled with a lot, but always concerns CSV. I am dealing with simple XML. I am writing a Perl script that first generates a XML file, and then imports it into a BaseX database. Unfortunately, I get the error message:
“…” (Line 1): Content is not allowed in prolog. At /BaseXClient.pm line 126
I have tried many things and have been debugging with perl, but as far as I can see the created files are valid XML. The error implies that a connection to the BaseX server is established. Something’s wrong with the XML file but I do not know what and how to prevent it. I added the script on pastebin as to not waste space in this email. [1]
The XML is created in the sub createXml. That routine returns the path to the created file, which on line 24 is imported into BaseX. Or at least, that is the goal. But that’s where the error occurs. I attached example XML output. The script as well as the output and input are in UTF8.
Thank you in advance
Kind regards
Bram Vanroy