[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: AW: intra document link

Subject: Re: AW: intra document link
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 08:51:38 -0500
html intra document link
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".

But
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:

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

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">
      <h3>
        <a name="{generate-id(.)}">
          <xsl:value-of select="iese.Chapter:heading"/>
        </a>
      </h3>
      <!--rest of chapter processing-->
    </xsl:for-each>

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.           http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness   http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.