lee_crites has asked for the wisdom of the Perl Monks concerning the following question:
Y'all;
I am building a database of sorts using XML as the layout. Each record is a separate XML file. There is a single perl script (being called as cgi) that will access the record(s) in the database. On my linux system I am making links to this one script, and so the name is the "key" to the record(s) selected.
The "real" script (myxmldb.cgi) will show ALL records. But all of the "other" scripts will only show "their" records. So one of them (goober.cgi -> myxmldb.cgi) will show the ones with "goober" in the predefined "process-created" tag. Adding more stuff to the mixture, there is a "goober.xml" file that is an ini-file in xml format. Each database, then, can have it's own unique layout, all being accessed by the same script.
My plan was that when I wrote out the database record, I was going to update the built-in DTD information to match it's layout. But the XML::Twig process doesn't handle the DTD well enough. So I created a few more predefined tags to hold the list of fields, etc. All of this was so if I called the "main" script (myxmldb.cgi) that it could (easily) show ALL of the records, irrespective of the layout.
So with that (obtuse) description of where I am and what I'm trying to do, let me ask this:
Is it better to keep the DTD type information internal to the XML file, or as a separate file? I'm interested in how hard it is to keep them up-to-date if they are separate as opposed to how easy is it when they're together. And then how that works with the fact that XML::Twig doesn't handle the DTD.
In other words, how do y'all handle this?
I am working on my first XML project. The reference project I'm using as a base had the DTD information included in the XML files, so that's how I started off. I've got 27 years of programming experience, so I'm not afraid to tackle something bad|ugly to take care of things. I'm just interested in the feelings from this forum in this area. I have the luxury ot going either way at this point.
Thanks to the perlmonks group. I stumbled on this site via some of the on-line docu for XML::Twig -- which, btw, I am finding quite usable! (thanks!!) From what I've seen so far, this is a great site!
Lee
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML and DTD and Twig...
by Velaki (Chaplain) on Sep 30, 2004 at 14:32 UTC | |
|
Re: XML and DTD and Twig...
by mirod (Canon) on Sep 30, 2004 at 11:58 UTC | |
by lee_crites (Scribe) on Nov 12, 2004 at 20:30 UTC | |
by mirod (Canon) on Nov 14, 2004 at 00:11 UTC | |
|
Re: XML and DTD and Twig...
by graff (Chancellor) on Sep 30, 2004 at 12:57 UTC | |
by lee_crites (Scribe) on Nov 12, 2004 at 20:47 UTC | |
|
Re: XML and DTD and Twig...
by pg (Canon) on Sep 30, 2004 at 04:09 UTC | |
|
Re: XML and DTD and Twig...
by Maxim (Sexton) on Sep 30, 2004 at 10:45 UTC | |
by SmilingBuddha (Acolyte) on Sep 30, 2004 at 11:03 UTC |