<DIV>Hi all..</DIV>
<DIV> </DIV>
<DIV>With the following code for transforming a xml file to html</DIV>
<DIV> </DIV>
<DIV> public Document transform(Document sourceDoc, File stylesheetFile)<BR> {<BR> <BR> // Set up the XSLT stylesheet for use with Xalan-J 2<BR> <BR> TransformerFactory transformerFactory = TransformerFactory.newInstance();<BR> Templates stylesheet = transformerFactory.newTemplates(new StreamSource(stylesheetFile));<BR> Transformer processor = stylesheet.newTransformer();</DIV>
<DIV> </DIV>
<DIV> //Output the Document to File<BR> FileOutputStream sourceOut = new FileOutputStream(new File("c:\\in.xml"));<BR> XMLOutputter xmlOutputter = new XMLOutputter();<BR> xmlOutputter.output(sourceDoc, sourceOut);<BR> sourceOut.close();<BR> <BR> //Take input Stream<BR> FileInputStream sourceIn = new FileInputStream(new File("c:\\in.xml"));<BR> StreamSource source = new StreamSource(sourceIn);<BR> <BR> //Make Output Stream<BR> FileOutputStream resultOut = new FileOutputStream("c:\\out.html");<BR> StreamResult result = new StreamResult(resultOut);<BR> <BR> // Feed the resultant I/O stream into the XSLT processor<BR> processor.transform(source, result);<BR> resultOut.close();<BR> }</DIV>
<DIV> </DIV>
<DIV>I get this exception</DIV>
<DIV> </DIV>
<DIV> A '(' character or an element type is required in the declaration of element type "JavaXML:Title".</DIV>
<DIV> </DIV>
<DIV>But if i am transforming without jdom that is by using org.apache....Process class from console the transformation works fine.</DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV>Himank Gupta.</DIV><p>
                <hr size=1>Yahoo! for Good<br>
<a href="http://store.yahoo.com/redcross-donate3/">Click here to donate</a> to the Hurricane Katrina relief effort.