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

RE: FW: Dealing with mixed content

Subject: RE: FW: Dealing with mixed content
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 16 Feb 2005 13:24:03 -0000
RE:  FW: Dealing with mixed content
> Being new to XSLT I'm a little unsure of exactly what the 
> pattern in the
> 'use' attribute value in the xsl:key element is doing.

If you want to index all employees by their works number, you do

<xsl:key name="k" match="employee" use="works-number"/>

and then to find an employee with works number 517541 you do

key('k', '517541')

The use attribute can be any XPath expression, so if you want to index
employees on the number of events they have in their promotion history, you
can do

<xsl:key name="k" match="employee" use="count(promotion-history/event)"/>

and then

key('k', 3)

will find all employees with three such events.

Michael Kay
http://www.saxonica.com/

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.