delete attribute in flash
maybe I am asking too much...
I want to know also if there is a way to delete attributes.
I ask so many becasue I am writing local XML database engine which both the data structure and data store in the XML file, so that user not only able to edit data but also edit structure.
Now I forsee 2 theorotically workable but pratical problems :
1. I read from other post that the newly added nodes' ID is not reconized by flash (seems that flash didnt add the pointer link in its ID list).
2. If ppl add record / delete record, add node and delete node can do, if they add field, add a attribute to all isnt a problem, but if they want to delete field, it seems I cannot find a way to delete attribute in flash...
I have tried set the value to null / NIL with no success
I have also tried array method such as splice/pop also cant
while I can left the attribute with "" but it is definately a waste of resorces.
Thanks
the id problem work around
I just find a work around for the adding new nodes problem. Maybe all ppl know except me but just in case.
Code:
myXML = new XML();
theNode = myXML.createElement("Test");
theNode.attributes.A1 = "A1";
theNode.attributes.id = "QQ";
myXML.appendChild(theNode);
trace(myXML["QQ"].attributes["A1"]) //undefind
myXML.parseXML(myXML);
trace(myXML["QQ"].attributes["A1"]) //A1
Well, it is surely not a good way to reparse the XML especially if it is a large XML, so if there is better way I would like to know too :)
Thanks