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

RE: Elements and functions available

Subject: RE: Elements and functions available
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 22 Oct 2008 10:48:51 +0100
RE:  Elements and functions available
> Out of interest, can someone comment on the cost of calling 
> these functions?  I imagine element-available() is very 
> cheap, but I'm wondering about function-available() with user 
> created extensions...

Performance is always processor-dependent. If the argument to
function-available is a literal, then Saxon is going to optimize away
something like

if (function-available('f:x')) then f:x() else ()

at compile time either to a call on f:x() or to ().

On the other hand, with a run-time argument, function-available() in Saxon
is probably very expensive. Much the same applies to element-available,
since Saxon does allow user-written extension elements.

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

> 
> Given a transform that makes use of many custom extensions, 
> is it reasonable to do:
> 
> <xsl:choose>
>    <xsl:when test="function-available( )">
>      normal execution
>    </
>    <xsl:otherwise>
>      test execution
> 
> ...to allow you to run the transform away from the host application?
> Or would all the calls to function-available() adversely 
> affect normal running of the transform?
> 
> The alternative (and good practice anway I think) is to move 
> all of the calls to extensions into one or maybe two physical 
> stylesheets, and then you can use an alternative primary 
> stylesheet that imports a different stylesheet where the 
> calls to the extensions have been replaced with sample values....
> 
> Either way, I'm just wondering if I should try to avoid lots of
> function-available() calls?
> 
> 
> 
> 2008/10/22 Jesper Tverskov <jesper@xxxxxxxxxxx>:
> > I have tested the little used XSLT functions element-available() and
> > function-available() and made a stylesheet that can create a report 
> > for most XSLT processors, testing also for EXSLT extensions 
> and Saxon 
> > extensions.
> >
> > I have made 8 reports available and a summary, "Elements 
> and functions 
> > available in XSLT processors", 
> > http://www.xmlplease.com/elements-functions.
> >
> > Feel free to suggest improvements.
> >
> > Best regards,
> > Jesper Tverskov
> >
> > http://www.xmlplease.com
> >
> >
> 
> 
> 
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/

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.