webservice with custom dll

Mar 31, 2011 at 11:13 AM

I've got this code with a alias name. The error is the same if i put it in a <mdo:service> tag.

<msxsl:script language="C#" implements-prefix="script">
  <msxsl:assembly name="Marnix.Website" />
  <msxsl:using namespace="Marnix.Website" />
   public string vindgebruiker (string email, string telefoon) {
   return Meeloopdag.FindUser(email, telefoonnummer);
   }
</msxsl:script>
{{script:vindgebruiker('test@localhost.nl','0123456789')}}
I got the following error:
System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'urn:script'.
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at <xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
at Findy.XsltDb.Transformer.DoTransform(XslCompiledTransform t, XmlReader xr, XsltArgumentList xslArg, StringWriter sw)
at Findy.XsltDb.Transformer.TransformRelease(String xml, String xsl, Helper h, String html, Boolean IsSuper)
at Findy.XsltDb.Transformer.JustTransform(String xsl, String xml, Boolean debug, Boolean IsSuper)
at Findy.XsltDb.Transformer.Transform(String xml, String xsl, Boolean IsSuper)
at Findy.XsltDb.ViewXsltDb.Page_Init(Object sender, EventArgs e)
Is this possible or not?<!-- End_Module_397 -->
Developer
Mar 31, 2011 at 2:11 PM

mvanlaar,

I believe you should include a full stylesheet and declare your prefix, like this:

<xsl:stylesheet version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   exclude-result-prefixes="msxsl mdo"
   xmlns:mdo="urn:mdo"
   xmlns:user="urn:user"
>
<!--
        Custom msxsl functions
    -->
    <msxsl:script language="C#" implements-prefix="user">
        public int CurrentYear()
        {
        return System.DateTime.Now.Year;
        }
    </msxsl:script>
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
    
    CurrentYear: <xsl:value-of select="user:CurrentYear()" />


</xsl:template>
</xsl:stylesheet>