Subject: [xsl] Saxon extension functions From: Michel Hendriksen <michel.hendriksen@xxxxxxxxx> Date: Fri, 10 Dec 2010 13:38:30 +0100 |
Hi all, New topic. I made an extension function which is working in SaxonB. When porting this to SaxonHE, where it is not supported, I get an error that a matching function cant be found. This is expected. But I'm testing for support of this and that seems to pass. So how do I test for existing support? See my code below. <xslt:template name="seed"> <!-- Works with SaxonB only! --> <xslt:choose> <xslt:when test="function-available('date:new') and function-available('date:get-time')" xmlns:date="java:java.util.Date"> <xslt:variable name="date" select="date:new()"/> <xslt:value-of select="date:get-time($date)"/> </xslt:when> <xslt:otherwise> <!-- NOT random at all.....to be replaced by something else --> <xslt:variable name="time" select="current-time()" /> <xslt:value-of select="seconds-from-time($time) + 60 * minutes-from-time($time) + 3600 * hours-from-time($time)"/> </xslt:otherwise> </xslt:choose> </xslt:template> Error Error at xslt:variable on line 64 column 52 of selector.xsl: XPST0017 XPath syntax error at char 0 on line 64 in {date:new()}: Cannot find a matching 0-argument function named {java:java.util.Date}new(). Note that direct calls to Java methods are not available under Saxon-HE Error at xslt:value-of on line 65 column 50 of selector.xsl: XPST0017 XPath syntax error at char 0 on line 65 in {date:get-time($date)}: Cannot find a matching 1-argument function named {java:java.util.Date}get-time(). Note that direct calls to Java methods are not available under Saxon-HE line 64/65 are <xslt:variable name="date" select="date:new()"/> <xslt:value-of select="date:get-time($date)"/> So within test. Michel Hendriksen Kensas bv
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Elements that inherit chi, Michael Kay | Thread | Re: [xsl] Saxon extension functions, Michael Kay |
Re: [xsl] Random number seed genera, Michel Hendriksen | Date | Re: [xsl] Saxon extension functions, Michael Kay |
Month |