Subject: Exception when transforming using XSLT
Posted By: ksskumar Post Date: 10/10/2006 2:26:28 AM
When I am trying to transform an XML using the following XSLT ...

******************************************************************
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:user="http://mycompany.com/mynamespace"
                version="1.0">
  <msxsl:script language="JScript" implements-prefix="user">
    function xml(nodelist) {
      return nodelist.nextNode().xml;
    }
  </msxsl:script>

  <xsl:template match="/">
    <xsl:value-of select="user:xml(.)"/>
  </xsl:template>
</xsl:stylesheet>
*************************************************************

... I am getting the below exception,
"The URI javascript does not identify an external Java class"

This is happening whenever I invoke a function written in an <msxsl:script> block.

Please help.

The full exception is:

***************************************************
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: The URI http://mycompany.com/mynamespace does not identify an external Java class
        at com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:92)
        at com.logistics.javalib.xml.XSLFilterChainTransformer.transform(XSLFilterChainTransformer.java:185)
        at com.logistics.messaging.router.translators.XMLToXMLTranslator.translateOutbound(XMLToXMLTranslator.java:253)
        at RouterOperations.TranslateAndSend(RouterOperations.java:2581)
        at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:287)
        at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:587)
        at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:44)
        at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:229)
...
*************************************************************

Reply By: joefawcett Reply Date: 10/10/2006 3:13:50 AM
As far as I know only the MSXML family of processors support using msxml:script blocks. Java processors tend to support Java script (NOT JavaScript!).

--

Joe (Microsoft MVP - XML)
Reply By: mhkay Reply Date: 10/10/2006 3:15:33 AM
Your stylesheet contains proprietary Microsoft extensions but you are running it through Saxon which does not recognize those extensions.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply By: ksskumar Reply Date: 10/10/2006 4:18:50 AM
Hi,

Thanks for the prompt response.

We already have a setup wherein we use a webMethods server which internally invokes the Saxon parser.

The XSLT has the <msxsl:script> block and it is beyond our control to modify the XSLT.

Could you please suggest a work-around for the problem (,if any?)?



Reply By: mhkay Reply Date: 10/10/2006 6:07:52 AM
You can either modify the stylesheet so it doesn't depend on the Microsoft parser, or you can modify your application setup so that the stylesheet is processed by the Microsoft parser instead of Saxon.

If neither of those is easy, then I'm sorry, but there's nothing I can do to make it easier.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply By: ksskumar Reply Date: 10/10/2006 6:20:02 AM
Thanks for your reply.

Unfortunately, both these options are not possible! No question of these being easy or not!

We probably have to ask the department concerned to modify their XSLT.

Thanks again!


Go to topic 50796

Return to index page 153
Return to index page 152
Return to index page 151
Return to index page 150
Return to index page 149
Return to index page 148
Return to index page 147
Return to index page 146
Return to index page 145
Return to index page 144