Danae
I'm not too sure I follow you, I think what you are after is a simple save to text file once the user has carried out changes. I am not sure this is possible but someone with more experience might be able to confirm this.
How is the user generating the circle object? I would suggest at this stage (when circle is generated) capture the object and send to database appending an id value to it.
So in the code below which is from
carto:net - Manipulating SVG Documents Using ECMAScript (Javascript) and the DOM where I have added the alert to construct the object, replace the alert with a send to the database, then when you generate the svg with php/asp simply call the DB content for that group and populate the group with the saved data
Again - not sure this is exactly what you are after but might give you some ideas
Code:
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ATTLIST svg xmlns:a3 CDATA #IMPLIED a3:scriptImplementation CDATA #IMPLIED>
<!ATTLIST script a3:scriptImplementation CDATA #IMPLIED>
]>
<?AdobeSVGViewer save="snapshot"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:attrib="http://www.carto.net/attrib" viewBox="-20 -20 400 250" id="cont" width="800" height="500">
<script type="text/ecmascript"><![CDATA[
var svgNS = "http://www.w3.org/2000/svg";
function createRect() {
var newRect = document.createElementNS(svgNS,"rect");
newRect.setAttributeNS(null,"width",Math.random() * 100);
newRect.setAttributeNS(null,"height",Math.random() * 100);
newRect.setAttributeNS(null,"x",Math.random() * 250);
newRect.setAttributeNS(null,"y",Math.random() * 180 + 60);
newRect.setAttributeNS(null,"fill-opacity",Math.random());
var red = Math.round(Math.random() * 255);
var green = Math.round(Math.random() * 255);
var blue = Math.round(Math.random() * 255);
newRect.setAttributeNS(null,"fill","rgb("+ red +","+ green+","+blue+")");
document.getElementById("firstGroup").appendChild(newRect);
alert("<rect x='" + newRect.getAttributeNS(null,"x") + " y='" + newRect.getAttributeNS(null,"y") + "' width='" + newRect.getAttributeNS(null,"width") + "' height='" + newRect.getAttributeNS(null,"height") + "' fill='" + newRect.getAttributeNS(null,"fill") + "' id='userrect1' />");
}
]]></script>
<g id="firstGroup">
<text x="20" y="30" onclick="createRect()" font-size="13px">Click on this text to create a new rectangle.</text>
</g>
</svg>