Next in thread → Next in month →

Re: [docbook-apps] XSL trouble with generating XHTML from TOC

From
Bob Stayton <>
Date
2004-08-05T08:09:17+00:00
ID
005d01c47ac3$802164a0$6501a8c0@toshiro
Thread
Re: [docbook-apps] XSL trouble with generating XHTML from TOC
You are running into the classic "grouping" 
problem in XSL.  You might check this article as a starting point, or Jeni 
Tennison's book "XSLT and XPath On the Edge" which has a lot about 
grouping.

 

http://www.xml.com/pub/a/2003/11/05/tr.html

 

Bob Stayton
Sagehill Enterprises
DocBook 
Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Frans 
  Englich 

  
To:  
  

  
Sent: Thursday, July 29, 2004 8:21 
  AM

  
Subject: [docbook-apps] XSL trouble with 
  generating XHTML from TOC

  

Hello all,

I have a file called book.xml which via 
  XPointers includes "sect1"s into its
book element. Apart from being a book, 
  the sect1s are used as independent 
articles on a website where each 
  chapter is a category for the 
articles(sect1s). 

I am having 
  trouble generating the website navigation for these articles. I 
want it to 
  be like the "Audio & Video" category and similar, found on 
  
www.download.com, but where the entries are aligned vertically below. 
  

My book have 5 chapters, but when generating a table with one row(tr) 
  and five 
cells(td) each containing a table with a tr encapsulating a td 
  for each sect1 
and the chapter's title(as on download.com but vertical), 
  it gets too wide 
for 1024x768. In other words, I need to do a break where 
  the first "line" 
contains 3 categories, and the one below 2.

I have 
  trouble getting this right with my XSL(attached) -- when the for-each 
loop 
  have iterated over 3 chapters, it needs to "pop out" and start a new 
row. 
  With an ordinary programming language that would have been easy, but I 
  
can't get the template thinking right.

Another problem, probably 
  caused by my incapable HTML skills, is the 
categories gets formatted 
  unevenly because they contains different amounts of 
sect1. I tried to 
  solve this by putting 'valign="top"' in the table but that 
didn't help; 
  still those containing less entries are centered and not on the 
same 
  "rows". One method is to somehow find out what the maximum number of 
  
sect1s that exists in any chapter, and then insert(by looping?) empty 
  cells 
in each category so all categories have the same amount of cells. Or 
  control 
the formatting somehow. Any ideas?

Thanks in 
  advance,

Frans
Next in thread → Next in month →