aspose file tools*
The moose likes Servlets and the fly likes how to tansform a domcument to xml file, the jaxp dont work!! help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to tansform a domcument to xml file, the jaxp dont work!! help!" Watch "how to tansform a domcument to xml file, the jaxp dont work!! help!" New topic
Author

how to tansform a domcument to xml file, the jaxp dont work!! help!

jianlong chen
Greenhorn

Joined: May 23, 2003
Posts: 3
hi,
I have a dom which parsed from a xml file, now I want to transform it xml file ,the following is my source code:
import org.w3c.dom.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
.......
DOMSource doms=new DOMSource(dom);
File f=new File(file);
StreamResult sr=new StreamResult(f);
TransformerFactory tff =TransformerFactory.newInstance();
Transformer tr=tff.newTransformer();
Properties pr=tr.getOutputProperties();
pr.setProperty(OutputKeys.ENCODING,"GB2312");
pr.setProperty(OutputKeys.INDENT,"yes");
tr.setOutputProperties(pr);
tr.transform(doms,sr);
it will throw a exception when I run it:
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)

what's the matter? pleas help me!!
thanks
Geeta Ramasami
Ranch Hand

Joined: Mar 05, 2003
Posts: 72
Hi..
Check the classpath variable if it includes the
jar file pertinent to the parsing of XML.
Regards
Geeta
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to tansform a domcument to xml file, the jaxp dont work!! help!