Brethern

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

<!ENTITY Inspection (Reviewer)*> <!ATTLIST Inspection InName ID #REQUIRED> <!ENTITY Reviewer> <!ATTLIST Reviewer ReviewerName ID #REQUIRED phoneNo CDATA #REQUIRED>
and an XML structure with the fragment
<Inspection InName="Build 7"> <Reviewer ReviewerName="George Metesky" phoneNumber="x3-5392" /> </Inspection>
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
<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>
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.

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


In reply to Going between XML and CGi by way of DTD by throop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.