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] HTML links not being created in my indexes


Hey!

Thanks for your feedback. Here's what I found:

- Saxon 8.5 (the latest version) is not supported. You probably knew  
that already. However, here's the error message:

Don't know how to chunk with SAXON 8.5 from Saxonica
Failed to process /Users/hendrik/IdeaProjects/performance/indextest.xml
/Users/hendrik/IdeaProjects/performance/build.xml:121:  
net.sf.saxon.instruct.TerminationException: Processing terminated by  
xsl:message at line 45
     at org.apache.tools.ant.taskdefs.XSLTProcess.process 
(XSLTProcess.java:466)
     [...]

- Saxon 6.5.4
   + bundled with Aelfred, which is not able to validate XML, so I  
had to turn validation off in other parts of my build process. I am  
sure that there is a way to work around Aelfred, but that would have  
meant to spend even more time on this
   + Aelfred seems to have a problem resolving the DTD mods. When  
using an xmlcatalog for the docbook DTD, it produces the following  
errormessage:

java.net.MalformedURLException: no protocol: dbnotnx.mod
     at java.net.URL.<init>(URL.java:567)
     at java.net.URL.<init>(URL.java:464)
     at java.net.URL.<init>(URL.java:413)
     at com.icl.saxon.aelfred.XmlParser.pushURL(XmlParser.java:3614)
     at com.icl.saxon.aelfred.XmlParser.parsePEReference 
(XmlParser.java:1841)
     [...]

Without the xmlcatalog pointing to local file it works just fine.  
This means that, if I want to stick with Aelfred, I cannot use  
xmlcatalogs for resolving DTDs to local files, which means that I  
cannot work offline, which is not what I really wanted... Maybe I  
really have to look into how to make sure I am not using Aelfred...

   +  The XSLT processor that comes with JDK 1.4.2 is able to write  
chunks relative to the output directory specified in the out  
attribute of the xslt Ant task. Saxon does not do that. After some  
searching I find http://www.sagehill.net/docbookxsl/ 
Chunking.html#HtmlOutputDir which tells me that I have to specify a  
base.dir parameter. This indeed works.

So my final Ant target looks something like this:

     <target name="indextest">
         <!-- xmlcatalog for offline working - does unfortunately not  
work with Aelfred -->
         <!-- <xmlcatalog id="commonDTDs">
             <dtd
                 publicId="-//OASIS//DTD DocBook XML V4.4//EN"
                 location="${somewhere in your filesystem}/ 
docbookx.dtd"/>
         </xmlcatalog> -->

         <xslt style="${docbook.xsl}/html/chunk.xsl"  
destdir="indextest" force="true">
             <!-- the following is the name of the factory for Saxon  
8.5, as suggested by the Ant XSLT docs. -->
             <!-- <factory name="net.sf.saxon.TransformerFactoryImpl"/ 
 > -->
             <!-- the following is the name of the factory for Saxon  
6.5. This works! -->
             <factory name="com.icl.saxon.TransformerFactoryImpl"/>
             <!-- you need this following parameter to write the  
output to a different directory. trailing slash is important! -->
             <param name="base.dir" expression="indextest/"/>
             <!-- xmlcatalog does not work with Aelfred -->
             <!-- <xmlcatalog refid="docbookDTD"/> -->
             <!-- finally the XML docbook documents you want to  
process -->
             <include name="indextest.xml"/>
         </xslt>
     </target>

- JDK 1.5 (5.0): When trying to run this with JDK 1.5.0_02-56 on  
MacOSX10.4, you get the following:

javax.xml.transform.TransformerConfigurationException: Could not load  
the translet class 'chunk'.
     at  
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.defineTransle 
tClasses(TemplatesImpl.java:315)
     [...]

The stacktrace gives away the fact that there is a Xalan underneath.  
Well, at least on JDK 1.4.2 it ran - even though it didn't produce  
any links in the indexes. JDK 1.5 does not even give me that... This  
is disappointing. <sarcasm>Aren't they supposed to make things better  
when they move to a higher version...?</sarcasm> Oh, well.

Lastly with Saxon 6.5.4/JDK 1.5 and the steps described above I got a  
really nice index, linked and everything.

Thanks a lot guys!

-hendrik

tagtraum industries incorporated
http://www.tagtraum.com/


On Aug 27, 2005, at 4:09, Mauritz Jeanson wrote:

>> -----Original Message-----
>> From: Hendrik Schreiber
>>
>
>
>> Unfortunately none of the index entries in the generated index are
>> actual functional links to the referenced sections. Blaine Simpson
>> seemed to have had the same problem, but it wasn't solved (http://
>> sourceware.org/ml/docbook/2004-04/msg00027.html).
>>
>> Here's an example:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://
>> www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ ]>
>> <book>
>>      <chapter>
>>          <title>Title</title>
>>          <para>First Para
>>              <indexterm>
>>                  <primary>IndexTerm in first para</primary>
>>              </indexterm>
>>          </para>
>>          <sect1>
>>              <title>
>>                  <indexterm>
>>                      <primary>IndexTerm in sect1 title</primary>
>>                  </indexterm>
>>              </title>
>>              <para>Sect1 para
>>                  <indexterm>
>>                      <primary>IndexTerm in sect1 para</primary>
>>                      <secondary>IndexTerm in sect1 para</secondary>
>>                  </indexterm>
>>              </para>
>>          </sect1>
>>      </chapter>
>>      <index/>
>> </book>
>>
>
>
> When I tested this document with Saxon 6.5.4, I did get one working  
> index
> link (to the chapter title), but the others were missing.
>
> Missing index links is a known issue[1] with at least one version  
> of Xalan
> (you say that you use Java 1.4.2, and it might actually be Xalan  
> behind the
> scenes; I forget the details).
>
> There is another problem: the title element in the sect1 contains only
> whitespace + an indexterm. Although this is valid markup, the  
> processing
> expectations[2] imply that indexterms are not supposed to be  
> rendered in the
> primary flow of the document. An index link points to a title, but  
> in this
> case the title is empty. It works better with some text in there.
>
> [1] http://lists.oasis-open.org/archives/docbook-apps/200406/ 
> msg00238.html.
> [2] http://docbook.org/tdg/en/html/indexterm.html
>
>
> /MJ
>
>
>



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