We use two specialty DTDs in the Docs Project, "rpm-info.dtd" and "entities.dtd". Using SGML, these DTDs define the elements and attributes allowed in an XML file which subscribes to them.
When you declare a document type using an XML DTD, you must provide a URI for that DTD, either using the SYSTEM or PUBLIC type. A SYSTEM type declaration is always a file local to your system, and that's the kind we've made use of for our "rpm-info" and "entities" specialty files in the Docs Project. A typical DTD in one of our "rpm-info.xml" files might look like this:
<!DOCTYPE rpm-info SYSTEM "../../docs-common/packaging/rpm-info.dtd">
But what happens when docs-common is located somewhere different on another contributor's system? This can now happen since we have different module targets for CVS, such as "release-notes" or "release-notes-devel" or "release-notes-devel-dir".
Enter the PUBLIC type declaration. The PUBLIC type is used for a DTD that's available, well, publicly. :-) Things like DocBook XML use PUBLIC DTDs because you can find the DTD on the web in several locations, including:
http://www.docbook.org/xml/4.4/docbookx.dtd http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
A PUBLIC DTD always has a "formal public identifier" (FPI) that sets that DTD apart from all others, but allows the same DTD to be published in many different places without any confusion. For instance, the DocBook XML 4.4 is always:
"-//OASIS//DTD DocBook XML 4.4//EN"
...no matter whether it's published at www.docbook.org, www.oasis-open.org, or available locally on your Fedora system in your /usr/share/sgml/docbook/xml-dtd-4.4-1.0-30.1/ folder. It's perfectly permissible to make your own FPIs as long as you don't use another DTD's FPI. (And of course you should play nice and not make it hard for people to tell it's yours.)
I've recently made the following FPIs for our rpm-info and entities DTD files:
"-//Fedora//DTD Docs RPM-INFO V1.0//EN" "-//Fedora//DTD Docs ENTITIES V1.0//EN"
I'm also publishing them at the following URLs, respectively:
http://docs.fedoraproject.org/dtds/rpm-info.dtd http://docs.fedoraproject.org/dtds/entities.dtd
This means that all our rpm-info and entities documents can start using those URIs to avoid pesky validation errors when your docs-common/ directory ends up in a different place than it was when the rpm-info or entities XML was first written. If you have an XML-aware editor that's net-savvy, it will automatically retrieve the DTD over the network and validate using it.
Fly! Dope! Rad! Awesome!
On Sun, 2007-04-29 at 17:36 -0400, Paul W. Frields wrote:
This means that all our rpm-info and entities documents can start using those URIs to avoid pesky validation errors when your docs-common/ directory ends up in a different place than it was when the rpm-info or entities XML was first written. If you have an XML-aware editor that's net-savvy, it will automatically retrieve the DTD over the network and validate using it.
It also means we don't have to be waiting constantly to hit e.g. oasis-open.org, which is a very popular PUBLIC DTD source, so can be a bit, her, pounded on at times.
- Karsten
On Tue, 2007-05-01 at 06:35 -0700, Karsten Wade wrote:
Fly! Dope! Rad! Awesome!
On Sun, 2007-04-29 at 17:36 -0400, Paul W. Frields wrote:
This means that all our rpm-info and entities documents can start using those URIs to avoid pesky validation errors when your docs-common/ directory ends up in a different place than it was when the rpm-info or entities XML was first written. If you have an XML-aware editor that's net-savvy, it will automatically retrieve the DTD over the network and validate using it.
It also means we don't have to be waiting constantly to hit e.g. oasis-open.org, which is a very popular PUBLIC DTD source, so can be a bit, her, pounded on at times.
Well, let me be clear that these FPI's are *only* for the DTDs for our "rpm-info.xml" and "doc-entities.xml" documents. DTDs for DocBook XML should still come from one of the canonical locations at oasis-open.org or docbook.org. (I usually use docbook.org, but that's just me.)
If you're on a system with the "docbook-dtds" package installed, your system resolves entities through your local SGML catalog (in /etc/sgml) before trying to hit the network, anyway.
On Tue, 2007-05-01 at 10:56 -0400, Paul W. Frields wrote:
On Tue, 2007-05-01 at 06:35 -0700, Karsten Wade wrote:
Fly! Dope! Rad! Awesome!
On Sun, 2007-04-29 at 17:36 -0400, Paul W. Frields wrote:
This means that all our rpm-info and entities documents can start using those URIs to avoid pesky validation errors when your docs-common/ directory ends up in a different place than it was when the rpm-info or entities XML was first written. If you have an XML-aware editor that's net-savvy, it will automatically retrieve the DTD over the network and validate using it.
It also means we don't have to be waiting constantly to hit e.g. oasis-open.org, which is a very popular PUBLIC DTD source, so can be a bit, her, pounded on at times.
Well, let me be clear that these FPI's are *only* for the DTDs for our "rpm-info.xml" and "doc-entities.xml" documents. DTDs for DocBook XML should still come from one of the canonical locations at oasis-open.org or docbook.org. (I usually use docbook.org, but that's just me.)
If you're on a system with the "docbook-dtds" package installed, your system resolves entities through your local SGML catalog (in /etc/sgml) before trying to hit the network, anyway.
Sorry to reply to myself, but perhaps it would be interesting SomeDay(tm) to enter these things in /etc/sgml...
docs@lists.stg.fedoraproject.org