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

Re: key() now has 3 arguments ... right

Subject: Re: key() now has 3 arguments ... right
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 24 Apr 2012 21:53:10 +0100
Re:  key() now has 3 arguments ... right
On 24/04/2012 20:41, ihe onwuka wrote:
key() in an XSLT 2.0 pattern must have exactly two arguments

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="2.0">

<xsl:key name="maindoc" match="person" use="@firstname"/>
<xsl:variable name="doc2" select="/"/>
<xsl:template match="key('maindoc','Sal',$doc2)">
     <xsl:value-of select="@firstname"/>
</xsl:template>

</xsl:stylesheet>

how come?


It's always possible they simply forgot to extend it when key was extended in xpath.


It's not a restriction on functionality just a restriction on syntax since if

<xsl:template match="key('maindoc','Sal',$doc2)">

were allowed it would presumably be the same as

<xsl:template match="key('maindoc','Sal')[ancestor-or-self::node()[. is $doc2]]">

David



--
google plus: https:/profiles.google.com/d.p.carlisle

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.