throop has asked for the wisdom of the Perl Monks concerning the following question:
Is there a standard way of generating cgi-bin pages to edit data structures that are stored in XML, using a DTD or XMLSchema or similar? Suppose I have a DTD that declares
and an XML structure with the fragment<!ENTITY Inspection (Reviewer)*> <!ATTLIST Inspection InName ID #REQUIRED> <!ENTITY Reviewer> <!ATTLIST Reviewer ReviewerName ID #REQUIRED phoneNo CDATA #REQUIRED>
I want a system that says "Hmmm, there's one reviewer now, but it can be deleted, or another one can be added" and produces the HTML fragment of a table something like<Inspection InName="Build 7"> <Reviewer ReviewerName="George Metesky" phoneNumber="x3-5392" /> </Inspection>
In other words, I want a program that looks at the current XML and the DTD that describes it, and produces HTML forms that are smart about offering to add and delete elements. Similarly, I want to generate HTML with radio-buttons for attributes which the DTD enumerates. And so on.<tr><td> Inspection: </td> <td colspan="2"><input type="text" name="inspection" value="Build 7"></td></tr> <tr><td colspan="2">Reviwers</td> <td><input type="submit" value="Add another Reviewer"> </td></tr> <tr><td> Reviewer: </td> <td><input type="text" name="reviewer1" value="George Metesky"> </td> <td><input type="submit" name="deleteReviewer1" value="Delete this Reviewer"></td></tr>
I'm not hard over on using DTD; I'll learn XMLSchema or whatever if it saves me writing a lot of code.
I spent an afternoon and a morning mostly searching CPAN and didn't find what I was looking for. But maybe these kinds of programs are known by a term of which I'm unaware.
Pointers? Suggestions? or am I approaching the whole problem the wrong way?
Thanks,throop
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Going between XML and CGi by way of DTD
by j1n3l0 (Friar) on Aug 25, 2007 at 20:17 UTC | |
|
Re: Going between XML and CGi by way of DTD
by pajout (Curate) on Aug 25, 2007 at 18:52 UTC | |
|
Re: Going between XML and CGi by way of DTD
by Cody Pendant (Prior) on Aug 26, 2007 at 13:19 UTC | |
by throop (Chaplain) on Aug 26, 2007 at 20:58 UTC | |
by Cody Pendant (Prior) on Aug 26, 2007 at 23:05 UTC | |
by throop (Chaplain) on Aug 27, 2007 at 03:53 UTC | |
by Cody Pendant (Prior) on Aug 27, 2007 at 04:12 UTC | |
| |
|
Re: Going between XML and CGi by way of DTD
by pajout (Curate) on Aug 28, 2007 at 10:35 UTC |