Project

Profile

Help

Saxon can't find C#-function within XSL

Added by Anonymous almost 18 years ago

Legacy ID: #4172125 Legacy Poster: cheininger (cheininger)

Hi everyone, I want to include a C#-function within a XSL-Stylesheet. Here's my stylesheet's structure: <xsl:stylesheet version="2.0" ... xmlns:user="http://www..../myscripts" xmlns:saxon="http://icl.com/saxon" ... exclude-result-prefixes="user html"> <xsl:output method="xml" version="1.1" encoding="ISO-8859-1" indent="yes"/> <xsl:template match="/"> ... </xsl:template> <saxon:script language="c#" implements-prefix="user"> public string decodePicture(XPathNodeIterator bindata, string baseDir, string baseVirtualDir, string dirname, string filename, string ending) {...} </saxon:script> ... <img src="{user:decodePicture(...)}"/> ... </xsl:stylesheet> Unfortunately, Saxon can't find the function, although the number of arguments is correct: XPST0003: XPath syntax error at char 200 on line 603 in {...fter(w:binData/@w:name, '.'...}: Cannot find a matching 6-argument function named {http://www..../myscripts}decodePicture() Can anybody help me to solve my problem, please?


Replies (2)

RE: Saxon can't find C#-function within XSL - Added by Anonymous almost 18 years ago

Legacy ID: #4172147 Legacy Poster: Michael Kay (mhkay)

saxon:script isn't even being recognized here because you used the old Saxon 6.x namespace: it should be http://saxon.sf.net/. However, if you corrected that you would get a message that saxon:script language="c#" isn't supported. Even for Java, it doesn't allow the code to be written inline. You seem to have been doing a large amount of guesswork. The documentation for calling extension functions under .NET is here: http://www.saxonica.com/documentation/extensibility/dotnetextensions.html Please make sure you use the option "?asm=assembly-name" in the URI identifying the class where the function is to be located: it sometimes works without, but I haven't established the precise conditions. Michael Kay http://www.saxonica.com/

RE: Saxon can't find C#-function within XSL - Added by Anonymous almost 18 years ago

Legacy ID: #4172162 Legacy Poster: Michael Kay (mhkay)

One other comment, XPathNodeIterator isn't a class that Saxon is going to recognize in the signature to your function. Please see the documentation to see which classes Saxon recognizes.

    (1-2/2)

    Please register to reply