I've seen the api qx.xml.* There is only three class. With these classes we can read. What would be the recommended way to edit an xml file using the qooxdoo api?
1 Answers
qooxdoo's qx.xml.* name space is basically a collection of static methods to abstract away some of the browser differences in working with XML documents. You start with one of the qx.xml.Document methods to create a document. What you get back is a native browser document (DOM) object. You then just use the API of this object, e.g. calling .createElement()
to create a DOM element asf. If you then wanted to set an XML name space on the element, you could use qx.xml.Element.createSubElementNS() to do that in a cross-browser fashion. Similar considerations apply to serialization and XPath searches.
So the short answer to your question is: You use the qx.xml.Document class to parse the XML file into a DOM object. Then you use the DOM object's native API to manipulate ("edit") the document tree. For actions that vary across browsers, you resort to qx.xml.* static methods.
You can also look at the unit test class qx.test.Xml, to see more examples on using the API.

- 22,276
- 13
- 61
- 62
-
So the "cross browser" qx.xml.Document.create will create a native xml document, it's kind of wird! I was looking for something more qooxdoo style (more cross browser) – benzen Mar 04 '11 at 16:37
-
1And by the way it would be cool to have a xmlstore like the jsonstore – benzen Mar 04 '11 at 16:38