Re: AW: [xsl] intra document link

Subject: Re: AW: [xsl] intra document link
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 08:51:38 -0500
At 2004-02-19 09:32 +0100, Nikolas Nehmer wrote:
Ohhhh, my mistake! Read, think, do not the other way arround ;-)


But where to put those 2 fragments in my XSL? When I put them together in 1
XSL file they will be processed together and so displayed together.

From your original post I was under the impression you were creating a very large HTML file with a table of contents at the top and the chapter processing down in the body.

I used ellipses ("...") to indicate "all the rest of your processing goes in here".

what I want to do is to display only the TOC together with the other
book informtion and when you click the link I want to display the
Chapter information.

Right ... but on the same HTML page or different HTML pages? The technique I described is for the same HTML page, because your subject line of your post reads "intra document link" ... if your subject line had read "inter document link" then I would have thought about multiple HTML pages ... but the English language is very difficult at times so it is entirely possible that this nuance was not noticed when you typed your message subject.

So, if it really is "intra document link" then I'm supposing your table of contents is at the top of your resulting HTML file and you process it generating the href= attributes as I indicated before:

    <xsl:for-each select="b:Book/b:chapters/iese.Chapter:Chapter">
        <a href="{generate-id(.)}">
          <xsl:value-of select="iese.Chapter:heading"/>

Then, your HTML page continues down with whatever preamble you have until you get to the chapter contents and as you process each chapter you place the name= anchors in the HTML page in the titles as I've shown below with <h3> elements (I hope the following is legible and isn't corrupted by your mail reader):

    <!--Body processing-->
    <xsl:for-each select="b:Book/b:chapters/iese.Chapter:Chapter">
        <a name="{generate-id(.)}">
          <xsl:value-of select="iese.Chapter:heading"/>
      <!--rest of chapter processing-->

Producing one very large HTML file with intra-document links.

I hope this helps.

........................... Ken

Public courses: upcoming world tour of hands-on XSL training events
Each week:    Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
Washington, DC: 2004-03-15            San Francisco, CA: 2004-03-22
Hong Kong: 2004-05-17    Germany: 2004-05-24    England: 2004-06-07
World-wide on-site corporate, government & user group XML training!

G. Ken Holman                  mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. 
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness

XSL-List info and archive:

Current Thread