[xsl] Saxon 6.21 TRAX interface vs. Xerces

Subject: [xsl] Saxon 6.21 TRAX interface vs. Xerces
From: "Julian F. Reschke" <julian.reschke@xxxxxx>
Date: Fri, 9 Mar 2001 16:34:40 +0100
Hi,

I am trying to use Saxon's TRAX interface to do a transformation of XSLT/XML
residing in Xerces DOMs. My code looks like:

  public String transform (Document doc)
  {
    try {
      String result = new String();
      TransformerFactory tfactory = TransformerFactory.newInstance();

      // Make sure the TransformerFactory supports the DOM feature.
      if (tfactory.getFeature(DOMSource.FEATURE) &&
tfactory.getFeature(DOMResult.FEATURE))
      {
System.err.println (tfactory.getClass().getName());
        // Create the Templates from a DOM.
        DOMSource dsource = new DOMSource(m_transform, "normalize.xslt");
System.err.println ("0");
        Templates templates = tfactory.newTemplates(dsource);
System.err.println ("1");
        Transformer transformer = templates.newTransformer();
System.err.println ("2");
        transformer.transform(new DOMSource(doc), new StreamResult(result));
System.err.println ("3");
      }

      System.err.println (result);
      return result;
    }
    catch (Exception e) {
System.err.println (e);
return null;
    }

I'm getting down to

System.err.println ("0");

then, I get the following exception:

java.lang.LinkageError: Class org/w3c/dom/Node violates loader constraints
at java.lang.ClassLoader.defineClass0(Native Method) 	at
java.lang.ClassLoader.defineClass(ClassLoader.java:486) 	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) 	at
java.net.URLClassLoader.defineClass(URLClassLoader.java:248) 	at
java.net.URLClassLoader.access$100(URLClassLoader.java:56) 	at
java.net.URLClassLoader$1.run(URLClassLoader.java:195) 	at
java.security.AccessController.doPrivileged(Native Method) 	at
java.net.URLClassLoader.findClass(URLClassLoader.java:188) 	at
java.lang.ClassLoader.loadClass(ClassLoader.java:297) 	at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) 	at
java.lang.ClassLoader.loadClass(ClassLoader.java:253) 	at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) 	at
java.lang.ClassLoader.defineClass0(Native Method) 	at
java.lang.ClassLoader.defineClass(ClassLoader.java:486) 	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) 	at
java.net.URLClassLoader.defineClass(URLClassLoader.java:248) 	at
java.net.URLClassLoader.access$100(URLClassLoader.java:56) 	at
java.net.URLClassLoader$1.run(URLClassLoader.java:195) 	at
java.security.AccessController.doPrivileged(Native Method) 	at
java.net.URLClassLoader.findClass(URLClassLoader.java:188) 	at
java.lang.ClassLoader.loadClass(ClassLoader.java:297) 	at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) 	at
java.lang.ClassLoader.loadClass(ClassLoader.java:253) 	at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) 	at
com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.jav
a:117)

Any help appreciated :-)

Julian


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread