python client, issue with adding xml files
Hi, The python samples pass an simple xml string to create or add: session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') session.create("database", "<x>Hello World!</x>") but how can I request the server to open a file or a directory? Basically session.create("database", "c:/tmp/myfile.xml") returns the following error message: "database.xml" (Line 1): No text allowed before root element. Thanks in advance for tips Laurent Le Meur
Hi Laurent, if your client and server is placed on the same machine, you may use session.execute("create db /path/to/files") Otherwise, you'll have to read the files via Python and pass them on via create/add. Hope this helps, Christian ___________________________
The python samples pass an simple xml string to create or add:
session = BaseXClient.Session('localhost', 1984, 'admin', 'admin') session.create("database", "<x>Hello World!</x>")
but how can I request the server to open a file or a directory?
Basically
session.create("database", “c:/tmp/myfile.xml")
returns the following error message: "database.xml" (Line 1): No text allowed before root element.
Thanks in advance for tips Laurent Le Meur
participants (2)
-
Christian Grün -
LE MEUR Laurent