Hi Kevin,

just define a filestream (here: C:\temp\outputfile.xml) and stream the
output in:



#include <fstream.h>
.....................

ofstream outfile( "C:\\temp\\outputfile.xml" );


//
---------------------------------------------------------------------------
//  Local classes
//
---------------------------------------------------------------------------

class DOMPrintFormatTarget : public XMLFormatTarget
{
public:
    DOMPrintFormatTarget()  {}
    ~DOMPrintFormatTarget() {}

    //
-----------------------------------------------------------------------
    //  Implementations of the format target interface
    //
-----------------------------------------------------------------------
    void writeChars(const   XMLByte* const  toWrite)
    {
        // Surprisingly, Solaris was the only platform on which
        // required the char* cast to print out the string correctly.
        // Without the cast, it was printing the pointer value in hex.
        // Quite annoying, considering every other platform printed
        // the string with the explicit cast to char* below.
//        cout << (char *) toWrite;

     outfile << (char *) toWrite;

    }
.......
}


Bye, Andreas






"Kevin Nguyen" <[EMAIL PROTECTED]> am 20.09.2001 17:07:43

Bitte antworten an [EMAIL PROTECTED]

An:    <[EMAIL PROTECTED]>
Kopie:
Thema: Output DOM Tree to a file.



Hi,
For DOMPrint sample program:� Instead of  printing a XML file to DOS
window, I would like to print it to a file.� Is  it possible and how?
Thanks,

Kevin Nguyen







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to