[xsl] Getting information from two disjunt subdivisions of a document.

Subject: [xsl] Getting information from two disjunt subdivisions of a document.
From: <Jeroen.Hellingman@xxxxxxxxxxxx>
Date: Mon, 13 Jan 2003 16:03:12 +0100 (CET)
I have the following xml snippet, describing a work of which page
images are available

<work>
	<contents>
		<div id="ch01" page="p01"><head>First Chapter</head></div>

		...

		<div id="ch09" page="p89"><head>Last Chapter</head></div>
	</contents>
	<pages>
		<page id="p01" />

		...

		<page id="p99" />
	</pages>
</work>

Using Saxon, I want to generate a HTML page for each page element,
containing (among others) the following:

1. A link to the previous and next page (if available)
2. The title of the current chapter (at the top of the page)
	Defined as the first head of the first div (in document order) which
links to the current page; 
	or the head of the last (in document order) div that links to a
preceding page if no div links to this page.
3. Links to the start of the current chapter and the next and previous
chapter.
4. Links to all pages within the current chapter.

My idea is for each page to use xsl:preceding-sibling to search for a
page to which div refers, but have worries
about the efficiency of this. Isn't there a way to select the right
bunch of pages for each chapter in a single 
XPath statement.

Note that the case of a multiple chapters on a single page can occur.

I currently do the same with a Perl script and a non-XML format:
results of that can be seen on 
http://www.bohol.ph/indolence/indo_004.html



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


Current Thread