Re: Speeding up loading the XHTML DTD on Linux (Mandriva Cooker x86-32)

Michael Ludwig <[email protected]> Fri, 8 Apr 2011 18:24:42 +0200
Newsgroups gmane.comp.lang.perl.xml
Message-ID <20110408162442.GZ3392@wladimir>
Shlomi Fish schrieb am 06.04.2011 um 10:03 (+0300):
> However, with load_ext_dtd set to 1, it tries to load the DTD from the
> network which takes a long time here. I'm trying to put the XHTML DTDs
> in /etc/xml/catalog , but I don't know what's the best way to do it.

Hi Shlomi,

not sure this is the gist of your question, but one way to set up
catalogues with LibXML2 is to define some environment variables:

#!/bin/bash
XML_CATALOG_FILES=catalog.xml \
XML_DEBUG_CATALOG=1 \
xsltproc $@

You can also use an absolute path, of course.

With catalog.xml containing something like:

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
 <group prefer="public">

  <public
   publicId="-//MiLu//DTD GurkML 0.1//DE"
   uri="catalog/GurkML.dtd"/>

  <public
   publicId="-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
   uri="catalog/xhtml-math11-f.dtd"/>

  <system
   systemId="http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
   uri="catalog/xhtml-math11-f.dtd"/>

  <system
   systemId="GurkML.dtd"
   uri="catalog/GurkML.dtd"/>

  <!-- When you are specifying an xml:base or uri attribute for use on
  a Microsoft Windows system, you must include the drive letter in the
  full URI syntax if you want it to work across processors. A Windows
  URI has this form:

   file:///c:/xml/docbook/

  Note the use of forward slashes, which is standard URI syntax. -->

 </group>
</catalog>

And then I store those DTDs below catalog/.

You can also resolve XSLT programs via a catalogue. And apparently you
can do URL rewriting using <rewriteSystem/>, <rewriteURI/>. And delegate
to other catalogues using <nextCatalog/>.

Hope this helps. Best regards,

Michael
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs