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

Jeff Chimene jeffchimene@yahoo.com
Tue, 30 Nov 2004 08:53:54 -0800 (PST)


Hi Mark,

Thank-you for the detailed reply!

--- Michael Smith <smith@xml-doc.org> wrote:

> 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.

I also use the XEmacs psgml mode.

> 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.

Agreed. However, I'd have to remove it from the
document before the XSLT phase?

> 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.:

Agreed. However, validating in real time is important
to me.

>   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.

Which works in XEmacs and xsltproc.
 
> 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

OK, I'll use that instead. The Debian docs seem to
deprecate xml-catalog; which is why I mentioned that
instead of update-xmlcatalog.

>   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

Yes, it does! I do have one final question: shouldn't
dbforms.dtd be in an xml catalog? I'm not an expert on
this, but it seems to exist only in the SGML catalog,
not the corresponding XML catalog.

Cheers,
jec

> 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!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com