in reply to Re: XML and DTD and Twig...
in thread XML and DTD and Twig...

In my case, each file will be one record. That record could belong to any "database" I have. I have defined (for myself) certain fields (e.g. 'name' or 'city') that have predefined meaning and a common layout. I put that layout into a global INI type file that all scripts will access. When a new (and unique) field is added to any database, I stick that into the global file as well. So there is one file (voc.xml) that has every field name and all of it's particular layout definitions.

What I am doing is to write a single display and edit CGI script. It will read in the voc.xml file, and then somehow (automagically) know what to do with the record. This worked just fine before the migration to XML, so I know the process works, I'm just trying to find the "best practice" for the XML world in duplicating it.

It seemed to me that the perfect place to do this was in the DTD. Each database would have a DTD file that contained a list of all of the fields it used, etc. But how do I tie the record I am processing to the DTD that relates to it? The internal DTD info seemed like the perfect location for that as well. But XML::Twig didn't process it correctly, and when I looked, I found out that this was a known problem.

But my philosphical question remains: what's the best practice for linking the data file to the DTD file? I can read the documentation, but so far I haven't really gotten a good feel for what is really being done by those folks who are actually using this.

Lee Crites
lee@critesclan.com