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

Creating index headers

Subject: Creating index headers
From: Manne Miettinen <manne.miettinen@xxxxxx>
Date: 29 Jan 2002 10:49:36 +0200
manne miettinen
Hi there,

I have a glossary of scientific terms in xml that contains entries like this:

  <entry type='n'>
	<term>A term</term>
	<treq>Finnish translation equivalen</treq>
	<def>Definition(s) of the term</def>
	... some other fields omitted
  </entry>

I would like to create html-version of the glossary where all the entries would
be sorted alphabetically using the content of term-element as sort key. For each
new beginning letter I would like to produce a header and anchor like this:

<h2>A</h2>
<a name=a"/>

<dl>
<dt type="term">A term</dt>
<dt type="treq">Finnish translation equivalent</dt> 
<dd>Definitions of the term</dd>

<h2>B</h2>
...

My first cut at the problem was creating a variable for each letter in the 
alphabet, like this

<xsl:variable name="a" select="/glossary/entry[substring(term,1,1)='a']|entry[substring(term, 1,1)='A']"/>
<xsl:variable name="b" select="/glossary/entry[substring(term,1,1)='b']|entry[substring(term, 1,1)='B']"/>

However the glossary contains also numbers and symbols (, +, &alpha;, &beta; etc
that I would like to lump under a common heading of "Numbers and symbols". 

Any suggestions?

-- 
Manne MIETTINEN			         manne.miettinen@xxxxxx
CSC - Scientific Computing Ltd.		+358 9  457 2517 (Tel)
PO BOX 405				+358 50 381 9510 (GSM)
FIN 02101 Espoo, FINLAND		+358 9  457 2302 (Fax)				 

 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.