What specs in a DTD do you see as being particular problems?

I'd settle for a restricted subset - either demanding that DTD/Schema conform to some limitations or having the code ignore the problematic parts of the DTD.

Here's the background: the customer said "Write a set of CGI scripts in support of performing code inspections. Some of the information that you'll need is already sitting in a read-only 'wild' XML file (i.e. no DTD or equiv). Store the information you gather into another XML file. Periodically, that XML file will be checked into a configuration management system." The customer supplied an XML fragment (annotated) as a rough spec of what he had in mind. There are existing scripts in the system that offer futher guidance. They work, but they are old and somewhat crufty (eg, they generated ill-formed HTML that loads, nonetheless.)

I generated a few scripts that did part of the job - essentially an editor for a CodeInspection. I wrote subroutines producing HTML to add/deleted sub-entities from entities ("Add or a delete a Reviewer", "Add or delete a line-which-exemplifies-a-bug.") I initially cobbled together a bastardized HoH to store the meta-data about the variables. Realized that was silly—why make up a formalism for storing meta-data when DTD/Schema/RelaxNG all do that already? So I stored the meta-data in a .dtd.

I've already written a few small functions that look at the DTD and which generate the code for for editing/adding/deleting attributes and indentured entities. As I was doing the work, I thought "Wait, somebody's probably done this already." So I went searching in CPAN and asking here.

Since I haven't found anything, I'm willing to believe that nobody's done this–or at least not released it. But I don't understand your warning that it would be generally impossible to do.

thanks
throop


In reply to Re^2: Going between XML and Cgi by way of DTD by throop
in thread 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.