Save XML

Xopus doesn't automatically save changes when it is deployed on a webserver. Since there are as many methods of saving files from a rich client as Xopus as there are web applications, Xopus is fully configurable to save changes to almost any server side system.

The Xopus API is used to tell Xopus how to save changes to the xml document.

IO.setSaveXMLFunction(mySaveFunction);

When the user saves the document, Xopus will call mySaveFunction with the uri that was used to load the document and the xml document itself.

function mySaveFunction (xmlURI, xmlDocument)
{
...
}

The Xopus API provides a set of utilities to send the xml document to the server using various protocols. To send the changes to the server using http post, HTTPTools can be used.

HTTPTools.postXML("/myapp/save.aspx", xmlDocument, "UTF-8");

This example will post the xml document to a .net application using the utf-8 encoding. On other applications the xmlURI may be used, or sent as a parameter.