OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: DOCBOOK-APPS: libxslt/xsltproc and XML catalogs (was Re: website dtdnewbie)


>>>>> "-" == Bob Stayton <bobs@caldera.com> writes:

[...]

>> Could you post the customization layer you are using?  I take it
>> you are using the `--nonet' option to xsltproc to specifically
>> *prevent* it from loading any files from the net?

-> Oops, my turn to admit a mistake.  I didn't use --nonet, so I was
-> getting network resolution without catalog usage.  Duh.

-> But now I remember how I did it before.  I don't think you can
-> resolve <xsl:import> hrefs with an SGML catalog, only with an XML
-> catalog.  

[...]

Ah!  I thought that might be the case.  I was resisting moving to XML
catalogs because other tools I use (like PSGML in Emacs) don't appear
to grok XML catalogs as yet.  

Does it make sense to make SYSTEM -> SYSTEM id mapping work with
<xsl:import> in the SGML catalog case?  i.e. would it be worth
spending time contributing a patch for libxslt to Daniel V. to fix
<xsl:import> resolution for SGML catalogs, or would it better to spend
the time fixing PSGML for Emacs to read XML catalogs? (or would it be
simple enough to do both?)

(By the way, if Daniel is listening in on this mailing list, a
suggestion might be to change the `--catalogs' option for xsltproc to
`--sgml-catalogs' to avoid user confusion, because it seems to imply
enabling of *all* catalog processing not just SGML.  It also seems to
imply that XML catalogs set in the environment variable
XML_CATALOG_FILES are *not* read if `--catalogs' is not supplied,
which is *not* the case, they *are* always read, AFAICT).

-> A uri-to-uri mapping like you want but inside an XML catalog looks
-> like this:

 <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML
 Catalog V1.0//EN"
 "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
 <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
 prefer="public">

 <uri
 name="http://docbook.sourceforge.net/release/xsl/snapshot/html/docbook.xsl"
 uri="file:///home/docadmin/docbook-xsl-1.45/html/docbook.xsl"/>

 </catalog>

-> This catalog works with --nonet to resolve the an import href to a
-> local file.

Excellent, yes that works, thank you Bob!  Actually, I think I can go
one better.  ;-) I can replace:

<uri
 name="http://docbook.sourceforge.net/release/xsl/snapshot/html/docbook.xsl"
 uri="file:///home/alex/packages/share/sgml/docbook-xsl-1.46-experimental/html/docbook.xsl"/>

<uri
 name="http://docbook.sourceforge.net/release/xsl/snapshot/fo/docbook.xsl"
 uri="file:///home/alex/packages/share/sgml/docbook-xsl-1.46-experimental/html/fo/docbook.xsl"/>

with:

<rewriteSystem
systemIdStartString="http://docbook.sourceforge.net/release/xsl/snapshot/" rewritePrefix="file:///home/alex/packages/share/sgml/docbook-xsl-1.46-experimental/"/>

and it works!  (it resolves the first part of the URI and then uses
the remaining [unmatched] suffix from the original URI, so no need to
write multiple URIs for files in the same hierarchy).

libxslt/xsltproc rocks!  It's rapidly becoming my favourite xsl
processor, it's fast and it supports almost all of the newer standards
out-of-the-box.  Thank you, Daniel!

Alex


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC