shaikh_mshariq 2 Junior Poster in Training

Hi to all the posters. I have come up with new problem using crimson parser to parse an xml file. I am creating xml file using crimson parser and DOM object. I have created a xml file using xmldocument object and i am setting nodes value according to tag name but when i transform the file to the xml file it gives error document root not found. I googled and i found that it is a BOM( byte order mark). Refn:- http://forum.java.sun.com/thread.jspa?threadID=499493&messageID=2530320
http://forum.java.sun.com/thread.jspa?forumID=34&threadID=491010
If anyone have the solution to transform xml file using crimson parser.:?:

code to write xml file

((org.apache.crimson.tree.XmlDocument) doc).write(fwriter,"UTF-8");


code to transform document object to file

StreamResult result = new StreamResult(xmlFile);
DOMSource source = new DOMSource(doc);
//apply chages to the original document.
transformer.transform(source, result);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.