Problem in writing XML files on unix
843834Jul 14 2003 — edited Jul 14 2003Hi,
I am using JAXP (xalan) to transfer a DOM hierarchy to a XML file. The code works fine on NT but when I try to do the same thing on unix, the code fails.
The code is something like this..
......
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "mydtd.dtd");
DOMSource source = new DOMSource(dfr);
StreamResult result = new StreamResult(new java.io.File("myxmlf.xml"));
transformer.transform(source, result);
...
dfr is DocumentFragment containing my hierarchy.
When I run this code on unix, it throws javax.xml.transform.TransformerException : myxmlf.xml (No such file or directory)
I checked the writing permissions on unix and I am able to write other type of files with normal java IO classes.
Any help will be greatly appreciated.
Thanks
Vivek