Hi Georgios, I have tested in sample and it works fine there. Don't know if there are some extra settings or something which i am missing. Well file properties is not the problem as I can just give a file name at some path to LocalFileFormatTarget and the file will be created. In my case, file is created but only contains this: < So, I just wanted to know if anyone has ever encountered similar problem or if there are any clues to it. thanx anyway, Mandeep.
-----Original Message----- From: Kasapoglou Georgios [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 10:50 AM To: [EMAIL PROTECTED] Subject: RE: writing a DOM tree directly to a file Hello Mandeep, I use the code delow and it works just fine. Check this out. If it still doesn;t work then check from the file properties, when was the last modification, in case you wrote a wrong path. ---------------------------------------------------------------------------- -------------------------------------------------------- DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(0); DOMWriter* writer = ((DOMImplementationLS*)impl)->createDOMWriter(); LocalFileFormatTarget myFormTarget(your_file_name); try { writer->writeNode(&myFormTarget , *root); } catch(...) { cout << "Unexpected error.\n"; } writer->release(); ---------------------------------------------------------------------------- -------------------------------------------------------- Friendly, gkasap //////////////////////////////////////////////////////////////////////////// ////////////////////// -----Original Message----- From: Mandeep Singh Bhatia [mailto:[EMAIL PROTECTED] Sent: Δευτέρα, 21 Ιουλίου 2003 5:32 μμ To: [EMAIL PROTECTED] Subject: writing a DOM tree directly to a file Hi, I am writing a DOM tree to a file. Have a look at this code snippet: SomeFn () { ... // SOme code // writing to test1.xml, the tree represented by root. myFormTarget = new LocalFileFormatTarget("C:\\Mandeep\\Xerces\\samples\\DOMPrint\\test1.xml"); xercesWriter->writeNode(myFormTarget,*root); delete myFormTarget; ... // Some code } I am writing to a file thru writeNode using LocalFileFormatTarget. But only thing getting printed in xml file is this: < Please note that when I write out the same root node to a string using writeToNode, then the string contains the whole xml represented by root. Also note that I have tested this thing in sample code (the DOMPrint sample) and there it is successful. The xml file is written properly. Any clues of what might have gone wrong?? regards, Mandeep. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
