Subject: Re: [xsl] Creating Forward/Backward HTML links from multi-file XSL processing From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 24 Jan 2004 14:34:08 -0500 |
I am using XSL to translate a set of XML documents into a corresponding set of HTML documents. I am stuck trying to figure out how to create <a > ... </a> links in HTML that display forward and backward pointers through the web pages.
...
Each topic has the following (partial) structure:
<<<<<
<topic>
<!-- Used to link topics together -->
<menu>
<file>overview</file>
<display>overview</display>
<next>overview2</next>
<prior>introduction</prior>
</menu>
<course>Course Name</course>
<section>Overview</section>
<title>Overview</title>
<abstract></abstract>
...
I would prefer to keep the meta information about topic sequence out of each topic file.
Basically, as I understand it, I need to point backward one sibling topic and forward one sibling topic and detect the end cases where there is no forward/backward sibling.
<xsl:if test="preceding-sibling::topic"> <a href="{preceding-sibling::topic[1]/file}.htm"> <xsl:value-of select="preceding-sibling::topic[1]/title"/> </a> </xsl:if>
<xsl:if test="count(key('files',file))>1"> <xsl:message terminate="yes">Duplicate filename!</xsl:message> </xsl:if>
-- Public courses: sign up for one or both soon to reserve your seat! Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22 Hong Kong, China: 2004-05-17 Bremen, Germany: 2004-05-24 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Creating Forward/Backward HTM, Randolph Kahle | Thread | Re: [xsl] Creating Forward/Backward, Randolph Kahle |
RE: [xsl] FW: Linear counting probl, Mischa Sandberg | Date | [xsl] Re: Displaying XSLT XML resu, Dimitre Novatchev |
Month |