Search code examples
c#xsltnamespacesfxsl

error message The URI does not identify an external Java class


I am new to XSL, and thus new to using scripts within the XSL.

I have taken example code (also using C#) and adapted it for my own use.. but it does not work.

EDIT: This code works in Visual Studio.. The error is only generated in Oxygen... I am still wanting to have it error free in Oxygen, so any insight is appreciated!

The error message is: The URI urn:cs-scripts does not identify an external Java class

The relevant code I have is:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:tok="urn:cs-scripts">

...
...
...
</xsl:template>


<xsl:variable name="temp">
    <xsl:value-of select="tok:getList('AAA BBB CCC', ' ')"/>
</xsl:variable>

<msxsl:script language="C#" implements-prefix="tok">
    <![CDATA[
    public string[] getList(string str, char[] delim)
  {
     return str.Split(delim, StringSplitOptions.None);
  }

  public string getString(string[] list, int i)
  {
     return list[i];
  }
  ]]>
</msxsl:script>


</xsl:stylesheet>

Solution

  • The declaration

    xmlns:tok="urn:cs-script"
    

    refers to a function created in C# within your XSLT. Oxygen is created in java, and thus cannot load/compile the C# generated callback function.

    If you want to remove the error in Oxygen, then remove the C# specific callback function (which only will work in a .Net environment).