[xml/sgml] How to reference docbookx.dtd via file://?

Michael Smith smith@xml-doc.org
Mon, 29 Nov 2004 19:23:04 +0900


Note that you don't absolutely need to have a DOCTYPE declaration
in your documents at all. There are lots of good reasons for not
including one and you only strictly need it if you have a
"internal subset" in the document (with custom entity definitions
or whatever) -- and even then you are not required to include
either a system ID or a public ID.

In the case of XSLT processing (with xsltproc or whatever), your
XSLT engine does not need to know anything about the external DTD
at all. So if you don't have an internal subset, you can omit the
DOCTYPE completely and everything will work fine.

And for the case of doing validation, you can validate
DOCTYPE-less documents just by explicitly specifying the URI for
the DTD on the command line to your validation engine; e.g.:

  xmllint --noout --postvalid ¥
    --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd

If you want to validate against something other than the standard
DocBook DTD, you can replace the URI with either the remote or
local path to the DTD you want to validate against.

And you don't necessarily need to use update-xmlcatalog to add
custom catalog entries; you can use xmlcatalog directly to create
a custom catalog

  xmlcatalog --create /home/foo/custom-catalog.xml

The add whatever URI rewrites you want to that. Then, put that
catalog into your XML_CATALOG_FILES env variable;

  export XML_CATALOG_FILES="/home/foo/custom-catalog.xml ¥
  /etc/xml/catalog"

Make sure to separate catalogs in XML_CATALOG_FILES with spaces,
not with colons. (Reason for that is, the value can contain URIs
that include protocol-specifiers with colons (e.g., file://)

Hope that helps,

  --Mike

Jeff Chimene <jeffchimene@yahoo.com> writes:

> 
> --- Mark Johnson <mrj@debian.org> wrote:
> 
> > Jeff Chimene wrote:
> >> Hi,
> >> 
> >> Is the answer to simply rewrite the 
> >> SYSTEM identifier in the DOCTYPE declaration?
> > 
> > Yep, that'll work.
> 
> Yes, it did/does. I wound up edting the dbforms DTD to
> reference V4.3 of the docbookx DTD.
> 
> >> <!DOCTYPE article
> >> PUBLIC "-//OASIS//DTD DocBook HTML Forms Module
> >> V1.1//EN" "dbforms.dtd"!>
> 
> I guess I'm surprised that the PUBLIC declaration
> doesn't match a catalog entry. I have to admit that
> I'm quite new to XML.
> 
> > Since you're using XML, it gets even easier: you can
> > ditch the PUBLIC 
> > identifier altogether and simply use a DOCTYPE
> > declaration like:
> > 
> > <!DOCTYPE article SYSTEM "path-to-dtd">
> 
> Yes, that's what I wound up doing. However, it
> requires hardcoding the DTD location - something that
> doesn't seem quite right. To make my life easier,
> should I use update-xmlcatalog to point to the dbforms
> DTD?
> 
> > THe 'file://' prefix is probably optional, depending
> > on what parser 
> > you're using. Try it with/without the file:// part
> > until it works for you.
> 
> xsltproc & XSLT including <OLINK> processing.
> 
> > Hope that helps.
> > 
> > Cheers,
> > Mark
> > 
> > > This seems to force a match on the PUBLIC
> > identifier.
> > > Now, the -nonet switch doesn't produce any errors.
> > > 
> > > Thanks,
> > > jec
> > > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-sgml-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>