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

RE: centralised alphabetical order ...

Subject: RE: centralised alphabetical order ...
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 1 Apr 2004 12:14:33 +0100
xslt alphabetical order
> <!--Create a key to catgeorise titles by first letter-->
> <xsl:key name="cat-by-firstocc" match="document($nsindex/)//link" 
> use="substring(title,1,1)" />
> 
> Xtrans seems to complain about not allowing a variable 
> "$nsindex" in the 
> match statement for the key tag. How do i create a key to 
> group all files in 
> nsindex by first letter of the titles?

Like this:

<xsl:key name="cat-by-firstocc" match="link" use="substring(title,1,1)" />

You don't need to worry that the key is defined against every possible
document; the document to be searched is determined when you call the key()
function.
> 
> Also, i have never created an xsl which only uses imported 
> files before. 
> What do i perform the translation against, an empty xml file?
> 

In XSLT 1.0 there has to be a source document but your stylesheet can ignore
its contents.

In 2.0 you can start the transformation at a named template, which means
there doesn't need to be a source document.

Michael Kay

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.