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] | [List Home]

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

Hi Peter,
I don't recommend mixing HTML and XHTML stylesheets because of potential namespace problems. For example, a <xreftext> element in the target data could be populated with a title that includes HTML elements such as <i> or <span> from styling in inline element in the title.  When you generate the target data using the HTML stylesheets, those inline HTML elements are not in a namespace.  But when you process your document with the XHTML stylesheets, all the output is in the XHTML namespace *except* those HTML elements from the target data, which will acquire a xmlns="" attribute to indicate their null namespace.  I'm not sure what webhelp will think of this mixing of namespaced and non-namespaced HTML elements.
It is possible to get the XHTML stylesheet working with olinks.  I'm curious about the "Invalid byte" error, which sounds like an encoding mismatch somewhere.
Bob Stayton
Sagehill Enterprises
----- Original Message -----
Sent: Friday, February 25, 2011 9:39 AM
Subject: [docbook-apps] Are HTML chunk targets equivalent to XHTML chunk targets for olinking?

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:


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 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" />

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.


Peter Desjardins

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