docbook-apps

  • 1.  Are HTML chunk targets equivalent to XHTML chunk targets for olinking?

    Posted 02-25-2011 17:40
    Hi. I'm generating webhelp output with Saxon and Xerces and I ran into a
    problem generating targets for olinks. I process my source document twice,
    once to generate the target database and then to produce the actual output.
    When I use the xhtml/chunk.xsl stylesheet to generate targets, the target
    database file includes a doctype declaration and problematic characters.

    I see this has been discussed before and I tried just stripping out the
    doctype declaration as described here:


    docbook-apps@lists.oasis-open.org/msg10288.html">http://www.mail-archive.com/docbook-apps@lists.oasis-open.org/msg10288.html

    That stopped Saxon from complaining about the doctype in the target database
    but then it complained about some of the characters. I think they were
    quotation marks and apostrophes.

    [java] Olink error: could not open target database 'olink-map.xml'.
    [java] Error: unresolved olink: targetdoc/targetptr = 'foo/bar'.
    [java] Error on line 4 column 878 of file:/C:/targets.db:
    [java] Error reported by XML parser: Invalid byte 3 of 3-byte UTF-8
    sequence.

    I decided to try to avoid generating the target database using the XHTML
    stylesheets and use the HTML stylesheet instead. I set up two stylesheets in
    my customization layer. One imports the HTML stylesheet for generating
    targets and the other imports the XHTML stylesheet for generating the actual
    webhelp output. Here are the two stylesheets. I had to strip out the
    <xsl:import> from webhelp.xsl to make this work.

    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="
    http://docbook.sourceforge.net/release/xsl-ns/current/html/chunk.xsl" />
    <xsl:import href="../webhelp-ns/xsl/webhelp.xsl" />
    <xsl:import href="my-webhelp-customizations.xsl" />
    </xsl:stylesheet>

    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="
    http://docbook.sourceforge.net/release/xsl-ns/current/xhtml/chunk.xsl" />
    <xsl:import href="../webhelp-ns/xsl/webhelp.xsl" />
    <xsl:import href="my-webhelp-customizations.xsl" />
    </xsl:stylesheet>

    There should not be any meaningful difference between the chunking and
    styling for the targets and for the actual output, right? I'm wondering
    whether I'm introducing inconsistency between the link targets and the
    actual content that the links will try to point to.

    Thanks.

    Peter Desjardins



  • 2.  Re: [docbook-apps] Are HTML chunk targets equivalent to XHTML chunk targets for olinking?

    Posted 02-25-2011 23:47
    On 02/25/2011 06:39 PM, Peter Desjardins wrote:
    > Hi. I'm generating webhelp output with Saxon and Xerces and I ran into
    > a problem generating targets for olinks. I process my source document
    > twice, once to generate the target database and then to produce the
    > actual output. When I use the xhtml/chunk.xsl stylesheet to generate
    > targets, the target database file includes a doctype declaration and
    > problematic characters.
    In our system, I have the whole olink db production mechanism hidden
    from view. It first generates an ant file for your suite of docs, then
    runs it, generating the olink.dbs. I had to check to how I'd gotten
    around the problem you mention. I just checked and it's not elegant, but
    it does work. In the ant file after generating all the target dbs, I do:

    <replace dir="/home/dcramer/workhead-svn/sdc/branches/8.0/target">
    <include name="target-*.db"/>
    <replacefilter token="<!DOCTYPE div" value=""/>
    <replacefilter token="PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"
    value=""/>
    </replace>

    David