PDA

View Full Version : Create XML on the fly



pouli
5 Jan 2011, 3:24 AM
Hello to all,

I would like to create an XML on the client side and when the user is ready I will send it over to the server.
The visualization of the XML will be a tree component.
Any changes made there should be reflected to the XML.

I would appreciate some input regarding:

a. the creation of the XML with the help of the EXTJS.
Does it provide something similar to JDOM for example?
What could be the preferred method of doing this?

b. The mapping between the tree and the XML

c. anything else to consider?


Thank you in advance

Condor
5 Jan 2011, 5:27 AM
You are thinking too complex.

1. You need to create an application that can do CRUD operations on a tree (node names, attributes and content).
2. You need to write something that converts the tree data to an XML string (no need to create an XML document). I suggest using a nested XTemplate.
3. You send that string as xmlData in an Ext.Ajax.request.

pouli
5 Jan 2011, 5:38 AM
You are thinking too complex.

1. You need to create an application that can do CRUD operations on a tree (node names, attributes and content).
2. You need to write something that converts the tree data to an XML string (no need to create an XML document). I suggest using a nested XTemplate.
3. You send that string as xmlData in an Ext.Ajax.request.


Hello Condor,

yes indeed. My first thought was not correct.
First I found that there is no easy way to create XML in a cross-browser way.
Thus after I stopped thinking about creating XML on the client things looks clearer.

I have to handle the tree CRUD operations (JSON is good).
The XML and all the rest (XML related) will be handled at the server side.
The client will only know as much as required in order to render the interface.
Thus now everything looks simpler since EXTJS has a solid background how to handle and control the UI components (tress etc) with the help JSON messages from the server.

In order to finalize all the clicks and generated events will be handled by the server who will update the generated XML (legacy).

Thank you once again for your input.

Best regards.