RE: Namespace 'http://exslt.org/regexp' does not contain anyfunctions.
"David Smith" <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Organization | Comtel Resources |
| Message-ID | <[email protected]> |
Craig, I am not familiar with the particular routine you are using but we have had the same issues as yourself with routines such as date:add, date:difference etc. In a nutshell, you cannot use stuff similar to select="date:add($startDate,$endDate) with MSXML etc. But if you want correct results using .NET etc. you need to use the routine as you have it. Unfortunately, using MSXML is very useful for testing...so here is how we handle it. <xsl:param name="EXSLTREF">yes</xsl:param> <xsl:element name="Value"> <xsl:choose> <xsl:when test="$EXSLTREF = 'yes'"> <xsl:call-template name="date:add"> <xsl:with-param name="date-time"> <xsl:value-of select="$startDate"/> </xsl:with-param> <xsl:with-param name="duration"> <xsl:value-of select="$endDate"/> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="date:add($startDate,$endDate)"/> </xsl:otherwise> </xsl:choose> </xsl:element> We ensure that when stuff is running under .NET, then we get the application to set "EXSLTREF" to "no", thus ensuring that should the xslt have the value set to 'yes' there is no runtime problem. Hope this helps. Regards David -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Craig Dunstan Sent: Thursday, 9 September 2004 21:34 To: [email protected] Subject: [exslt] Namespace 'http://exslt.org/regexp' does not contain anyfunctions. I was looking through the archives and found a question raising this issue but no response. I am using MSXML4 processor (as part of Marrowsoft's XSelerator, but it does the same thing from explorer and Altova's XMLSpy) and I get the following above error with the following style sheet. I haven't got to the point where I can even test the actual regular expression; the output crashes with the above error as soon as it hits the regexp code. Any assistance greatly appreciated.. Craig Dunstan The stylesheet nessus.xslt is as follows: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:regexp="http://exslt.org/regexp" extension-element-prefixes="regexp"> <xsl:import href="c:\exslt\regexp\regexp.xsl" /> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <table border="1"> <tbody> <xsl:apply-templates select="report/results/result/ports/port"> <xsl:sort select="@protocol"/> <xsl:sort select="@portid" data-type="number"/> </xsl:apply-templates> </tbody> </table> </xsl:template> <xsl:template match="port"> <tr valign="top"> <td><xsl:value-of select="information/id"/></td> <xsl:choose> <xsl:when test="@portid"> <td><xsl:value-of select="service/@name"/>(<xsl:value-of select="@protocol"/>/<xsl:value-of select="@portid"/>)</td> </xsl:when> <xsl:otherwise> <td><xsl:value-of select="service/@name"/></td> </xsl:otherwise> </xsl:choose> <td><xsl:value-of select="information/data"/></td> <td><xsl:value-of select="information/severity"/></td> <td><xsl:value-of select="regexp:match(information/description, 'risk factor : (low|high)', 'i')"/></td> </tr> </xsl:template> </xsl:stylesheet> _______________________________________________ exslt mailing list [email protected] http://www.exslt.org/list