Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in writing XML files on unix

843834Jul 14 2003 — edited Jul 14 2003
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2003
Added on Jul 14 2003
3 comments
182 views