This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] DocBookXSL XHTML chunking does not produce hyperlinksin index page.


Hi Bob,

I unfortunately rely upon Xalan-2 used through the ANT xslt task and cannot easily switch over to Saxon. Therefore I'd really appreciate the further investigation you announced to get Xalan to generate the links in the index.

Thanks for the great work you do for us all.

Regards,
Gisbert Amm

Lee Gwun Wai wrote:
Ok, I can rule out Xalan-2 then.

And it works!!!! I have finally managed to get an index page, with
hyperlinks, with Saxon 6.5.3. Thank you! Thank you!

I know where I was going wrong previously. I am using Ant to generate the
output via the xslt task. What happened was that I set a nested factory tag
inside the xslt task, and pointed it to net.sf.saxon.TransformerFactoryImpl,
which points to the correct class in Saxon 7.9.1

So, when I tried with Saxon 6.5.3, with which I should change it to
com.icl.saxon.TransformerFactoryImpl, but I didn't. I ran it under quiet
mode, and I didn't notice anything wrong.

Once I updated the factory tag to the correct classname, I got an index page
with working hyperlinks!

Btw, the Ant xslt task, with XMLCatalogs works very well in Ant 1.6, without
the need to create a catalogManager.properties. I saw quite a few links that
recommends calling the XSLT Processor via the java task, but the xslt task
seems to be more suited to the task.

Thank you Bob, really appreciate your help.

8)
Gwun Wai

-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Monday, June 07, 2004 4:16 PM
To: gwunwai@pacific.net.sg; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] DocBookXSL XHTML chunking does not produce
hyperlinks in index page.


Well, I can confirm that Xalan 2.5.1 does not generate the links in the index. I think that will require further investigation. And as I said, Saxon 7 is not supported by the stylesheets.

I think your best bet is to get Saxon 6.5.3 working.  That processor is
known to generate index links with the stock Docbook 1.65 stylesheets
without your having to modify anything.

You said you tried, Saxon 6.5.3. In what way didn't it work for you?

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- From: "Lee Gwun Wai" <gwunwai@pacific.net.sg> To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org> Sent: Monday, June 07, 2004 1:21 AM Subject: RE: [docbook-apps] DocBookXSL XHTML chunking does not produce hyperlinks in index page.



Thanks Bob,

That is what I'm trying to achieve as well. But somehow it's just refusing
to work.

Anyway, I tried Saxon 6.5.3, and it didn't work as well.

Next, I copied the entire chunk of

   <xsl:template match="indexterm" mode="index-primary">
...
           <xsl:value-of select="primary"/>
           <xsl:for-each select="$refs[generate-id() =
generate-id(key('primary-section', concat($key, &#34; &#34;,
generate-id((ancestor-or-self::set
|ancestor-or-self::book                      |ancestor-or-self::part
|ancestor-or-self::reference
|ancestor-or-self::partintro

|ancestor-or-self::chapter


|ancestor-or-self::appendix

|ancestor-or-self::preface


|ancestor-or-self::article                      |ancestor-or-self::section
|ancestor-or-self::sect1                      |ancestor-or-self::sect2
|ancestor-or-self::sect3                      |ancestor-or-self::sect4
|ancestor-or-self::sect5                      |ancestor-or-self::refentry
|ancestor-or-self::refsect1

|ancestor-or-self::refsect2


|ancestor-or-self::refsect3
|ancestor-or-self::simplesect
|ancestor-or-self::bibliography
|ancestor-or-self::glossary                      |ancestor-or-self::index
|ancestor-or-self::webpage)[last()])))[count(ancestor::node()|$scope) =
count(ancestor::node())][1])]">
...

</xsl:template>

and put it in my own customization layer, and I added some <xsl:text>
inside, and what happens is that processing did not enter the
<xsl:for-each>.

I tried to output the value of the variables ref and key before primary,

and


what I got was "Section One" for both. I am still trying to figure out a
good way to debug that <xsl:for-each> to understand what it's doing.

Do I need to include any jars for the generate-id function? I suspect it's
an exslt function. But I have no idea what I have missing, as I don't get
any errors while generating the output.

Perhaps I need to define something in my source XML?

Thanks!
Gwun Wai

-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Monday, June 07, 2004 2:36 PM
To: gwunwai@pacific.net.sg; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] DocBookXSL XHTML chunking does not produce
hyperlinks in index page.


Well, Saxon 7.9.1 is not compatible with the DocBook XSL stylesheets. Try version 6.5.3.

Regarding no <a> tag being output by the template <xsl:template
match="indexterm" mode="index-primary">:
The stylesheet does not make the indexterm the hot link. Rather, it

appends


the section title that contains the indexterm and makes that the hotlink.
The <xsl:for-each> that follows handles that. See my book's index for an
example of what it should look like:

http://www.sagehill.net/docbookxsl/bookindex.html

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- From: "Lee Gwun Wai" <gwunwai@pacific.net.sg> To: <docbook-apps@lists.oasis-open.org> Sent: Sunday, June 06, 2004 9:53 PM Subject: RE: [docbook-apps] DocBookXSL XHTML chunking does not produce hyperlinks in index page.



Hello again,

I did some testing, and downloaded Saxon 7.9.1, and used Saxon instead

of


Xalan for the transformation, but still, I get a HTML index page with no
hyperlinks.

I traced the processing in the stylesheets, and found that it reaches
xhtml\autoidx.xsl, and this chunk of code:

...
<xsl:template match="indexterm" mode="index-primary">
 <xsl:param name="scope" select="."/>

<xsl:variable name="key"

select="normalize-space(concat(primary/@sortas,


primary[not(@sortas)]))"/>
 <xsl:variable name="refs" select="key('primary',
$key)[count(ancestor::node()|$scope) = count(ancestor::node())]"/>
 <dt>
   <xsl:value-of select="primary"/>
...

The code here clearly outputs the value of the primary tag, but without

any


<a> tag, so I'm quite curious how it will be added in later. Perhaps by
html2xhtml.xsl? But I checked the same autoidx.xsl, but from the html
folder, and it's exactly the same, ie, no anchor tag introduced.

Perhaps somebody can enlighten me on this, because it doesn't make sense

to


me, at least for now.

Thanks in advance,
Gwun Wai

-----Original Message-----
From: Lee Gwun Wai [mailto:gwunwai@pacific.net.sg]
Sent: Sunday, June 06, 2004 1:32 AM
To: docbook-apps@lists.oasis-open.org
Subject: RE: [docbook-apps] DocBookXSL XHTML chunking does not produce
hyperlinks in index page.


Hello,


Thanks for the quick response, but no luck, it didn't work. I got the

same


output, with the index terms on the index page, but no hyperlinks.

I also tried with the latest version of the DocBook XSL stylesheets,

which


I

believe is 1.65.1, but I got the same result.

I think I installed Xalan correctly, for this is my output when I do a

java org.apache.xalan.xslt.EnvironmentCheck

#---- BEGIN writeEnvironmentReport($Revision: 1.26 $): Useful stuff
found: ----
version.DOM.draftlevel=2.0fd
java.class.path=.
version.JAXP=1.1 or higher
java.ext.dirs=E:\j2sdk1.4.2_02\jre\lib\ext
#---- BEGIN Listing XML-related jars in:
foundclasses.sun.boot.class.path ----
xalan.jar-path=E:\j2sdk1.4.2_02\jre\lib\endorsed\xalan.jar
#----- END Listing XML-related jars in:
foundclasses.sun.boot.class.path -----
version.xerces2=not-present
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.6.0
version.xalan1=not-present
version.ant=not-present
java.version=1.4.2_02
version.DOM=2.0
version.crimson=present-unknown-version


sun.boot.class.path=E:\j2sdk1.4.2_02\jre\lib\endorsed\xalan.jar;E:\j2sdk1.4.

2_02\jre\lib\rt.jar;E:\j2sdk1.4.2_02\jre\lib\i18n


...jar;E:\j2sdk1.4.2_02\jre\lib\sunrsasign.jar;E:\j2sdk1.4.2_02\jre\lib\jsse
.

j

ar;E:\j2sdk1.4.2_02\jre\lib\jce.jar;E:\j2sdk1.4.2
_02\jre\lib\charsets.jar;E:\j2sdk1.4.2_02\jre\classes
version.SAX=2.0
version.xalan2x=Xalan Java 2.6.0
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.

Or is something else missing?

-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Saturday, June 05, 2004 11:41 PM
To: gwunwai@pacific.net.sg; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] DocBookXSL XHTML chunking does not produce
hyperlinks in index page.


Yes, the index entries should link back to the HTML pages. I suspect

the


problem is the with (old) Xalan that is bundled with Java 1.4.  This
reference tells you how to use a newer Xalan:



http://www.sagehill.net/docbookxsl/InstallingAProcessor.html#InstallXalan


Let me know if that doesn't help.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- From: "Lee Gwun Wai" <gwunwai@pacific.net.sg> To: <docbook-apps@lists.oasis-open.org> Sent: Saturday, June 05, 2004 8:17 AM Subject: [docbook-apps] DocBookXSL XHTML chunking does not produce hyperlinks in index page.



Hello,

I need some help with the generation of index page.

I am able to get an index page (ix01.html), for xhtml chunked pages.

But


I

was expecting the index page to contain the hyperlink back to the

actual


place in the content where the indexterms are. I can see that in the

page


where the indexterms were defined, an anchor was created, but the

missing


part is the hyperlink, which is sort of lame for a HTML index page.

I tried the fo stylesheets, with FOP, and in the output PDF, I got the

index


page, with the terms and their page numbers, but nothing happens when

I


click on the terms.

I've been searching the net, and it seemed that hyperlinks will be
automatically generated, but it didn't work for me. Is there something

that


I am doing wrong?

This is something similar,
http://sources.redhat.com/ml/docbook/2004-04/msg00025.html, but the

thread


sort of just died off, without the solution.

I am using DocBook XSL 1.64.1, with Xalan that is bundled with JDK

1.4,


and

I don't have any customization layers.

Thanks in advance!
Gwun Wai

My source:
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>

<book>
   <bookinfo>
       <title>My First DocBook</title>
   </bookinfo>
   <chapter>
       <title>The First Chapter</title>
       <para>The quick brown fox jumps over the lazy dog.</para>
       <section>
           <indexterm><primary>Section One</primary></indexterm>
           <title>The First Section</title>
           <para>This is Section 1</para>
       </section>
   </chapter>
   <index/>
</book>


To unsubscribe from this list, send a post to

docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.





To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.


To unsubscribe from this list, send a post to

docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.








To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.



To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.

To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]