in reply to Re: Going between XML and CGi by way of DTD
in thread Going between XML and CGi by way of DTD
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Going between XML and Cgi by way of DTD
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 | |
by pajout (Curate) on Aug 27, 2007 at 15:31 UTC |