0

I'm new to eXist db.I can able to retrieve an xml file from db but how can i store my own XML file into a collection(collection name:test) using AJAX javaScript?

My Sample XML file looks like this

<?xml version='1.0' encoding='utf-8'?> 
 <Configuration>
   <IP>120.6.45.35</IP>
   <Communitystring>public</Communitystring>
   <Template>generic</Template>
 </Configuration>

Please anyone help me?

Please answer my question.

Thanks in advance.

Joe Wicentowski
  • 5,159
  • 16
  • 26
Sowmya
  • 345
  • 1
  • 5
  • 18

1 Answers1

0

You can use eXist RESTful API to add a document to the database. You'll have to issue an HTTP PUT request and send the document as message body. You need to specify content type as application/xml The address should be:

(eXist_host):(port)/exist/rest/(path_to_target_collection)/(file_name)

You can do it in JQuery AJAX or using a plain XmlHttpRequest.

See the eXist developer guide for more information.

toniedzwiedz
  • 17,895
  • 9
  • 86
  • 131