xml in servlet
Hi
I have used DOM to read XML node values and DOM's Transformer class to save changed xml node values back to the xml file.
File f =new File("C:\\test.xml");
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(f);
I have changed the value of a node using setData method of Text.
Then saved the XML file again:
Source source =new DOMSource(doc);
Result res =new StreamResult(f);
Transformer x = TransformerFactory.newInstance().newTransformer();
x.transform(source,res);
It works fine.
But when I have a web based application, I put this code in a servlet and the xml file in WEB INF, it reads it and changes the node value but does not save the file when I use Transformer.
Does it not work for web based applications. Is there any other way out.

