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

Re: [XSLT 3.0] A more efficient way to xsl:evaluate a

Subject: Re: [XSLT 3.0] A more efficient way to xsl:evaluate a bunch of XPath expressions against an XML document?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 12 Nov 2012 10:29:47 +0000
Re:  [XSLT 3.0] A more efficient way to xsl:evaluate a
Saxon 9.4 isn't quite up-to-date with the latest spec changes here. It effectively assumes context-item=".".

Michael Kay
Saxonica

On 12/11/2012 10:15, Costello, Roger L. wrote:
Hello Phil,

I haven't done this myself, but from my reading
of the spec[1], you should use the context-item
attribute of xsl:evaluate to set the evaluation
context instead of relying on the surrounding
xsl:for-each instruction - as follows:

    <xsl:template match="Document">
        <xsl:variable name="here" select="." />
        <xsl:for-each select="$xpaths//xpath">
                <xsl:evaluate xpath="." context-item="$here" as="xs:boolean" />
        </xsl:for-each>
    </xsl:template>
Yes, I thought that as well. But when I add the context-item attribute I get this error message from SAXON:

Attribute @context-item is not allowed on element <xsl:evaluate>

/Roger

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.