tags:

views:

65

answers:

3

I'm writing an app that, at its heart, uses a hierarchical tree of nodes

in XML, it looks like this:

<node>
   <name>Node1</name>
   <Attribute1>Something</Attribute1>
   <Attribute2>SomethingElse</Attribute2>
   <child>Node2</child>
   <child>Node4</child>
   <child>Node7</child>
</node>

And so on (all child elements must refer to an existing node, though the node inquestion doesnt have to precede the first reference to it)

For a simple structure like this is there a simple tool to generate a html page that will allow a user to enter Nodes and dynamically update a server-side xml file?

Im basically writing a tool that will use such a file, but the people who's job it is to create the file arent especially techno-literate, so creating the XML by hand is a no-no.

I could hand-crank one fairly quickly, but if I can get a tool to do it, even better (especially as the format may change in future)....

A: 

I am pretty sure there is nothing that will do that for you automagically and you'll need to write that bit yourself.

Your options are to create a web based interface to do it, using HTML POST and writing the output to a file or database (then reloading it on submission) or something more advance with Javascript (e.g. that could do it dynamically with AJAX).

You can't do it in HTML alone - either way you'd need something to handle outputting the existing data and accepting HTTP POST requests, but you don't mention what language or platform you are using to write this. Being clear on that will help people suggest appropriate solutions.

You might want to rethink the XML structure ... Elements called "attribute{anything}" are ill advised (as are elements named in the convention foo1, foo2, (etc)). The whole <child>Node2</child> thing doesn't seem like a good way to go either. I suggest posting an actual example of the XML in question.

From what you've said, it sounds like there is no specific need for it to be in XML at all. Not that XML is bad (it isn't) but if putting it in an SQL database is a valid option and you have one of those anyway (e.g. your using a LAMP stack) then that's something to consider.

Iain Collins
A: 

Would an XML editor like http://www.oxygenxml.com/ suffice? I don't know of any html web ones unless you write one yourself and use AJAX to send the data. At least an XML editor can generate a form that you can use to create and edit XML documents. Microsoft do infopath as well - which is actually designed more for questionaires but might do what you need, if the non-tech people would prefer something more office like.

Matt Smith
A: 

Xopus is a browser based XML editor that you could use for this. It is designed for the non techno-literate people out there.

Disclaimer: I work at Xopus.

Laurens - Xopus