I am using XML applications. I am using Xalan parser for Xml file transformation. job1 : Create XML document dynamically with data from database. job2 : Transform generated XML file with xsl to get HTML file output. job 1 is working fine with jaxp parser job 2 is working fine with xalan parser I am creating xml file dynamically by fetching data from database. When I am using Xalan parser class path setting I am not able to generate XML document But by adding jaxp parser in the classpath I am able to generete the document. But now if I am tring to transform it I am getting the runtime exception that "Namespace not supported by the parser". How can I get both of the functions working properly with either of the parser. Thanx in Advance, Devang
You need to make sure the parser JAXP is SAX 2.0 and DOM 2.0 compliant. I had a similar problem not to long ago. I fixed it by making sure the "parser" (JAXP in your case) is first in the classpath. BTW I believe there is a parser already in the xalan/xerces packages and you shouldn't need JAXP. (I think it is already included in those packages) Hope this helps
When using JAXP, try turning on namespace-awareness using setNameSpaceAware(true) when you configure the JAXP factory, javax.xml.parsers.SAXParserFactory. The default is set to false when you use Sun's parser & factory-implementaion com.sun.xml.parser.SAXParserFactoryImpl. Also if you use a different parser with JAXP, you may run into classpath problems if the parser supports more features than SAX 1.0 (JAXP parser only supports 1.0). In that case try adjusting the class-path as John suggested.
Ruth Stout was famous for gardening naked. Just like this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners