Complete XSLT Element Reference
The <xsl:key> element is a top-level element which declares a named key that can be used in the style sheet with the key() function.
Note: A key does not have to be unique!
| Attribute | Value | Description |
|---|---|---|
| name | name | Required. Specifies the name of the key |
| match | pattern | Required. Defines the nodes to which the key will be applied |
| use | expression | Required. The value of the key for each of the nodes |
Suppose you have an XML file called "persons.xml":
You can define a key in an XSL file like this:
To find the person with id="050676", write (in the XSL file):
Complete XSLT Element Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|