[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Saxon extension functions
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|