[jdom-interest] XSLT Question??? Help!!!!

Jason Hunter jhunter at collab.net
Wed Sep 26 12:23:31 PDT 2001


I suspect you have an older version of Crimson in your path.  Make sure
the crimson provided with JDOM is selected and no others are ahead of it
in the classpath or in standard extension libs.  See the FAQ for
details.

-jh-

Luis Castro wrote:
> 
> Hi, I'm new to JDOM API's. So, trying to run one of the examples from the
> /samples package I got the following run-time error:
> 
> Source Code:
> 
> import org.jdom.*;
> import org.jdom.input.*;
> import org.jdom.output.*;
> import org.jdom.transform.*;
> import javax.xml.transform.*;
> import javax.xml.transform.stream.*;
> 
> public class XSLTransform {
> 
>   public static void main(String[] args) throws Exception {
>     SAXBuilder builder = new SAXBuilder();
>     Document doc = builder.build(args[0]);
>     Document doc2 = transform(doc, args[1]);
>     XMLOutputter out = new XMLOutputter("  ", true);
>     out.setTextNormalize(true);
>     out.output(doc2, System.out);
>   }
> 
>   public static Document transform(Document in, String stylesheet)
>                               throws JDOMException {
>     try {
>       Transformer transformer = TransformerFactory.newInstance()
>         .newTransformer(new StreamSource(stylesheet));
> 
>       JDOMResult out = new JDOMResult();
>       transformer.transform(new JDOMSource(in), out);
>       return out.getDocument();
>     }
>     catch (TransformerException e) {
>       throw new JDOMException("XSLT Transformation failed", e);
>     }
>   }
> }
> 
> Run-time Error Description:
> 
> gp-elf% java XSLTransform catalog.xsl catalog.xml
> 
> Exception in thread "main" org.jdom.JDOMException: XSLT Transformation failed:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException: java.lang.ClassNotFoundException:
> org.apache.crimson.parser.XMLReaderImpl
>         at XSLTransform.transform(XSLTransform.java, Compiled Code)
>         at XSLTransform.main(XSLTransform.java, Compiled Code)
> Root cause: javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException: java.lang.ClassNotFoundException:
> org.apache.crimson.parser.XMLReaderImpl
>         at
> org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFact
> oryImpl.java, Compiled Code)
>         at XSLTransform.transform(XSLTransform.java, Compiled Code)
>         at XSLTransform.main(XSLTransform.java, Compiled Code)
> 
> Notes:
> I config my CLASSPATH with jaxp.jar, crimson.jar and xalan.jar. If there is
> anything else that I need in my config.????
> My environment is UNIX.
> 
> Thanks
> Luis
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com





More information about the jdom-interest mailing list