After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 57115 - Not chunking using an XSLT customization layer for DocBook stylesheets
Not chunking using an XSLT customization layer for DocBook stylesheets
Status: VERIFIED NOTABUG
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-07-05 15:41 UTC by Dan York
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan York 2001-07-05 15:41:58 UTC
When I use 'xsltproc' with Norman Walsh's DocBook XSL stylesheets (v1.40)
to process a large DocBook XML file, it *correctly* chunks each chapter
and <sect1> into a separate HTML file.  I used something like:

  $ xsltproc /usr/share/docbook-xsl-1.40/html/docbook.xsl myfile.xml

It then generates a bunch of files as I want it to.

However, when I create my own XSLT customization layer that sits on top of
Norm's stylesheets, I get an error that says chunking is not supported.
Here is the command execution:

  [dyork@enchilada html]$ xsltproc --version /usr/share/sgml/e-smith.xsl
../userguide.xml
  Using libxml 20312 and libxslt 1300
  xsltproc was compiled against libxml 20312 and libxslt 1300
  libxslt 1300 was compiled against libxml 20312
  Chunking isn't supported with libxslt
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"   
"http://www.w3.org/TR/REC-html40/loose.dtd">

  [dyork@enchilada html]$ 

Here is what is the beginning of the XSLT customization layer:

  <?xml version='1.0'?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version='1.0'
                xmlns="http://www.w3.org/TR/xhtml1/transitional"
                exclude-result-prefixes="#default">

  <!-- Change this to the path to where you have installed Norman
     Walsh's XSL stylesheets -->
  <xsl:import href="/usr/share/sgml/docbook-xsl-1.40/html/chunk.xsl"/>

Now, if I change the reference to:

  <xsl:import href="/usr/share/sgml/docbook-xsl-1.40/html/docbook.xsl"/>

then 'xsltproc' runs perfectly fine and generates a *single* HTML file
that includes the customizations I have made to the DocBook stylesheets.
So the customization layer works when importing 'docbook.xsl', but not
when importing 'chunk.xsl'.

I have noted this problem as well when using Norm's "Slides" XSL
stylesheets, as they also call 'chunk.xsl'.  Trying to use 'xsltproc' with
the Slides stylesheet also generates the message:

  Chunking isn't supported with libxslt

If there is any more information I can provide, please let me know.

Dan
Comment 1 Daniel Veillard 2001-07-05 16:01:40 UTC
Look at html/chunker.xsl
That's where the error comes from:

--------------------------------------------<xsl:template
name="make-relative-filename">
  <xsl:param name="base.dir" select="'./'"/>
  <xsl:param name="base.name" select="''"/>

  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>

  <xsl:choose>
    <xsl:when test="contains($vendor, 'SAXON')">
      <!-- Saxon doesn't make the chunks relative -->
      <xsl:value-of select="concat($base.dir,$base.name)"/>
    </xsl:when>
    <xsl:when test="contains($vendor, 'Apache')">
      <!-- Xalan doesn't make the chunks relative -->
      <xsl:value-of select="concat($base.dir,$base.name)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:message terminate="yes">
        <xsl:text>Chunking isn't supported with </xsl:text>
        <xsl:value-of select="$vendor"/>
      </xsl:message>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
--------------------------------------------
  The only way to make libxslt work with this code is to
fake being SAxon or Apache. This is pretty bad and Norm promised
to fix this in the next release.

  So this is not a libxslt bug. I have put a workaround
to this in libxslt/functions.c (search for DOCBOOK_XSL_HACK).
You can either:
   - change that part of the code to not check that the
     stylesheet name contains "chunk"
   - rename your file containing the customization layer to
     have "chunk" in its name
If this sounds horrible, yes it is but I don't think I'm guilty
for this :-\

Daniel
Comment 2 Dan York 2001-07-05 16:50:08 UTC
Ugh... a bit of a mess.  Thanks for the tip - I renamed my
stylesheet with "-chunk" in the filename and it worked fine!
Geez...

I'll check Norm's buglist, too, to make sure this is being fixed.

Thanks,
Dan
Comment 3 Daniel Veillard 2001-07-12 20:28:53 UTC
Should be fixed with libxslt-1.0 and the latest docbook XSLT
stylesheets

Daniel
Comment 4 Dan York 2001-07-12 20:33:21 UTC
Yes... all set and working great!  Thanks!
Dan