Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UI for editing XML files

Status
Not open for further replies.

apertosa

Programmer
Aug 11, 2006
15
US
Hi and thanks for reading.
I have very little XML/Web experience and I have to do a feasibility study on a editor that reads/writes XML files.
The XML files are "fixed" in other words all the elements and attributes are known.
Some of the elements and attributes must be editable and I'm trying to understand how is it possible to use a browser as the user interface editor in order to access the data in the XML file and modify the values.
As I said I have no experience with XML or XSLT so I thought of asking someone competent.
I can be more specific and paste a snipped XML file, but the core of the question is this:
I want to be able to modify some values in an XML file via a user interface, and save the XML file with the new values.
Can I do that using a browser (that is typically used to display an XML file instead)?
What is the route? XML, XSLT, ASP, Javascript, php, CGI....
as you can tell.. I'm confused and looking for the simplest solution.
Thanks!
andrea.
 
I've not tried using it yet but check out Altova's "Authentic" product: There's both desktop and browser editions available.

It would be much appreciated if you could post your feedback on Authentic here, as I'm sure many (including myself!) would benefit from such information.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Hi and thanks for your reply.
I think I didn't explain myself clearly enough.
I am not looking for a user interface to edit XML files (I did try the altova product and it's certainly valid). I'm trying to find out if IE or Firefox browser itself can be used as a UI for loading and editing (saving) XML files.
I suspect that there is a fair amount of javascripting involved in this.
I also suspect that in addition to the java script there needs to be a transformation that maps the XML content into the appropriate User Interface widgets (fields, radio box, option menus etc...). That transformation is XSL. The user interface is XFORM.
I guess that at this point I'm just trying to see if what I described is feasible.
Thanks!
Andrea.

 
Since your XML files are "fixed", you could certainly create a general XSLT file that would convert your xml files into html forms along with the necessary javascript to update the xml files when the user clicks submit. Basically you would be using javascript to dynamically build your html page client-side from the xml files and the xsl file.

You also mentioned ASP and PHP. The approach I described above does all of the work client side. If you wanted to, you could move some of the work server-side using either PHP, Classic ASP, JSP, or ASP.NET. Of these technologies, I would say PHP and Classic ASP have the smallest learning curve.

Now as you've guessed, all of this will take a fair amount of coding. Using a web-enabled tool such as Altova's "Authentic" is certainly an easier approach, and I believe the web version of it does use your browser as the user-interface. But I think if I understood your last post, you would prefer to do it without using a 3rd party tool.

I have never played with XFORM, so I cannot comment on that.


 
Thanks for your answer.
I think I understand what you are suggesting.
There is no need for server side implementation since everything is done on local machines.
I think that I can try to spend some time on:
XSLT - > to transform the XML file into a HTML code with appropriate forms
Javascript - > to process the loading of the XML data into the various fields (upon opening of the XML file) and to save (update) the XML file (or write a completely fresh one) when the user clicks on Save.
Seems easy enough... but for a newbie like me this might be the beginning of long sleepless nights!
Anyway,
thanks again!
Andrea.
 
If the fields are truely fixed, then you may not even need xslt. You could simply create an html page with the fields you care about, and then use javascript to load the xml file, populate the html fields, and then save the data into an xml file. This will involve learning both the XML DOM and the HTML DOM.

You also may want to look into XForms. I skimmed their W3C definition, and they sound useful. Since I have never used XForms, I don't know how well they work in practice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top