0

I'm working on something to transform an xml file into ICML so I parse the XML file using an XSL file. Using javax.xml.transform.Transformer transformer.

        File xmlSourceFile = new File("f:/xmlSource.html");
        javax.xml.transform.Source xmlSource = new  javax.xml.transform.stream.StreamSource(xmlSourceFile);

        File xsltSourceFile = new File("f:/xstlSource.xsl");
        javax.xml.transform.Source xsltSource = new javax.xml.transform.stream.StreamSource(xsltSourceFile);

        File resultFile = new File("f:/result.icml");
        fw = new FileWriter(resultFile); 

        javax.xml.transform.Result result = new javax.xml.transform.stream.StreamResult(fw);

        javax.xml.transform.TransformerFactory transFact = javax.xml.transform.TransformerFactory.newInstance();

        javax.xml.transform.Transformer transformer = transFact.newTransformer(xsltSource);
        transformer.transform(xmlSource, result);

This code works just fine on any Java SE project, but whenever I try to use it with a web project, I get this error, at deployment:

Digester.getParser:
            javax.xml.parsers.ParserConfigurationException: AElfred parser is namespace-aware
                at com.icl.saxon.aelfred.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:37)

So please, it would be great if someone could help me about this error.

I'm using: NetBeans 7.1 GlassFish v2 build b51g

Sabry Shawally
  • 603
  • 2
  • 11
  • 24

1 Answers1

0

YOu are using Saxon on glassfish server and maybe the standard built in Xerces when running in J2SE. Does glassfish have saxon in its classpath and can you remove it?

Woody
  • 5,052
  • 2
  • 22
  • 28