[Foomatic] DTDs: first try

Johannes Meixner jsmeix at suse.de
Wed Feb 4 09:44:30 PST 2004


Hello,

On Jan 31 12:23 Patrick Powell wrote (shortened):
> On Thu, Jan 15, 2004 at 05:18:41PM +0100, Johannes Meixner wrote:
> > I added the following stand-alone DTDs to the CVS:
... 
> This must have been a tremendous amount of work.

In fact it was not much work to make this stand-alone DTDs
(it was much easier than I expected).

Much more work was to find out that with the existing XML files
it is very ugly to make a single nice DTD for the whole database.
This is what I described as the "problems" in my mail.

At the moment the Foomatic database consists of "XML files"
but it is not yet a "XML database with a reasonable DTD".

The difference is:

XML files require only(!) that the data is included in markup
and each markup must have the syntax
  <name>...</name>
and markups can be nested only this way
  <name1>...<name2>...</name2>...</name1>

A XML database with a reasonable DTD has much more requirements.
See for example the "problems" in my mail and see the
"entity reference problem" in
http://www.linuxprinting.org/pipermail/foomatic-devel/2004q1/001820.html

I discovered the "entity reference problem" when I tried to make
a XSL stylesheet to process the existing printer XML files and make
all printer XML files in compliance to a much more strict DTD.

By using XSL stylesheets and a XML database we could change the
XML files to any reasonable output format, in particular XML, HTML
and plain text.
Of course at the moment there are Foomatic tools which do the same.
But doing it via XSL stylesheets is a worldwide known method.

If we had a XML database, then anybody who has the XML database,
the DTD and the XSL stylesheets
- could produce for example HTML or plain text (note that a PPD file
  is plain text) output by using any XML/XSL processor he likes
  (for example I use xsltproc),
- could convert the database into his personal XML format
  (e.g. to integrate the data into an existing XML database),
- could convert the database into flat plain text lines
  (e.g. to import the data into an existing database).

At the moment this is not possible because of the
"entity reference problem".

In particular by using XSL stylesheets we could change the existing
XML files to another XML syntax and create a real
"XML database with a reasonable DTD".

Making such a "XML database with a reasonable DTD" would result
changings in the XML files which let existing tools crash
which operate directly on the existing XML files.

Therefore making a "XML database with a reasonable DTD"
is something for the next major Foomatic version.

Nevertheless:
If it would not matter whether there is &quot; or the plain " in
the XML files, then we could use XSL stylesheets to process the
existing XML files without breaking any existing tools.
I.e. I could make a first step towards a XML database:
I could make XML files which comply to much more strict DTDs
without breaking any existing tools.

Unfortunately I don't have any comment regarding the
"entity reference problem".


Regards,
Johannes Meixner
-- 
SUSE LINUX AG, Maxfeldstrasse 5                 Mail: jsmeix at suse.de
90409 Nuernberg, Germany                    WWW: http://www.suse.de/




More information about the Printing-foomatic mailing list