After searching Google for hours, I'm still stuck with this problem. Hope you guys can help me out.
I am building an application that lets user design their pages for a photo album. It first loads the standard format for each page using an XML. The XML is loaded through an AJAX call using JQuery as in:
$.get('http://www.domain.com/ajaxcall.php', function(responseXML) {
$xmlDoc= $(responseXML);
)}
The XML file is now loaded as an object, and I can perform JQuery methods on it, which reduces the amount of code for me.
Editing from the user side is saved in the $xmlDoc. So when a user drags a photo over the page, the new cordinates are saved as an attribute of that photo. After all the user editing has been done, I want to export the new XML and save it to the server. This is where my problem starts. Since I've loaded the XML as a JQuery object (by using $(responseXML)), I can not export it as an XML file anymore. I've checked this by calling $.isXMLDoc($xmlDoc), which responds with false.
Since it was so easy to convert the XML to an object, I guess there must be a way to do the other way around. Any ideas on this?
XML from original file:
<pages>
<page bgcolor="0099cc" titlecolor="f8f8f8" subtitlecolor="000000">
<title>test</title>
<subtitle></subtitle>
<photo id="458267411204" name="" picture="http://www.domain.com/picture.jpg" height="540" width="720" x="25" y="0">
<creator id="712241204" name=""/>
</photo>
</page>
</pages>