XML catalog

wrobell wrobell at ite.pl
Mon May 27 13:09:25 CEST 2002


On Mon, May 27, 2002 at 12:04:20PM +0200, Artur Frysiak wrote:
> On Mon, May 27, 2002 at 11:52:36AM +0200, wrobell wrote:
> > On Mon, May 27, 2002 at 09:37:15AM +0200, Artur Frysiak wrote:
> > [...]
> > > Place of /etc/xml/catalog ?
> > > I think better place for XML catalog is libxml2-progs because this
> > > package includes /usr/bin/xmlcatalog - tool to manage XML catalogs.
> > > But libxml2 uses this file directly and require it for proper work.
> > Yes, /etc/xml/catalog should be in package, which contains libxml2
> > library, because developers who use libxml2 would use catalog in their
> > applications. Example application is xsltproc from libxslt-progs pacakge.
> 
> Yes, but /usr/bin/xmlcatalog is in libxml2-progs and all packages with
> DTD/xsl stylesheets need to use /usr/bin/xmlcatalog to alter
> /etc/xml/catalog.
> 
> But from other side, you are right.
> My proposal:
> /etc/xml/catalog in libxml2 package.
> All packages with DTDs for XML documents 
> Requires(post): /usr/bin/xmlcatalog
> Requires(postun): /usr/bin/xmlcatalog
OK.

> I looked at docbook-dtd412-xml.spec from -r xmlcatalog. 
> I think this methodology is not good. 
> - not registering DTDs for XML documents in SGML SuperCatalog is not
>   good for openjade/opensp and other SGML apps with XML extensions but
>   without XML catalogs support.
Are there any SGML apps with XML extensions which are used at all?
SGML SuperCatalog needs some dirty hacks to use so I am determined 
to not support it for XML DTDs.

> - direct registering in /etc/xml/catalog is not good for packages
>   upgrades/removals.
No. There is no such problem. xmlcatalog can handle catalog entries removing.
It is another XML Catalog strength over SGML SuperCatalog.

> - registering SystemId by rewriteSystem tag is not correct and don't
>   handle other files from package 
Please note, that rewrite system is not designed for handling other
DTDs which are provided by some packages. For example docbook-dtd412-xml
should register "-//OASIS//DTD XML Exchange Table Model 19990315//EN"
DTD and others too... it is not finished certainly. It would be nice to
have a script which could extract and register all DTDs from catalog
'docbook.cat' which is provided with docbook packages.

Please look at http://xmlsoft.org/catalog.html.
One of the XML Catalog strengths is the rewrite system.  It is designed
to replace URI with another one, so for example xml validator will load
locally installed DTD instead of fetching DTD from net. 

XML Catalog rewrite system gives you ability to put into you document
following doctype specification

<!DOCTYPE book "-//OASIS//DTD DocBook XML V4.1.2//EN" 
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

and use locally installed DTD. This way documents are not tied with
vendor (PLD, RH, Debian, etc.) specific DTD localization.
 
> Please look at xhtml-dtd10-xml.spec for my proposal.
> If you have any questions please ask.

Following line I would redefine to /etc/xml/catalog:
  %define catalog %{_datadir}/sgml/html/xml-dtd-%{v_er}/xmlcatalog-%{v_er}-%{version}-%{release}
and remove this line (/etc/xml/catalog is provided by libxml2 package):
  xmlcatalog --noout --create $RPM_BUILD_ROOT/%{catalog}

Will such registered catalog entries:

  xmlcatalog --noout --add rewriteSystem \
          'http://www.w3.org/TR/xhtml1/DTD/' \
          '/usr/share/sgml/html/xml-dtd-%{v_er}/' \
          $RPM_BUILD_ROOT/%{catalog}

  xmlcatalog --noout -add public \
          "-//W3C//DTD XHTML 1.0 Strict//EN" \
          xhtml1-strict.dtd \
          $RPM_BUILD_ROOT/%{catalog}

handle following doctype specification:

    <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

so DTD will *not* be fetched from Internet?

    wrobell <wrobell at ite.pl>



More information about the pld-devel-en mailing list