You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Jay Freeman (saurik)" <sa...@saurik.com> on 2001/06/19 23:13:56 UTC

RE: problem in DOMPrint.cpp (it really is a problem)

The previous ostream os; mistake that Anand made aside, these new issues
shouldn't be ignored as they _are_ being caused by DOMPrint.cpp.

The problem here is that DOMPrint.cpp wasn't written with usability in mind.
Don't let the fact that it LOOKS like an insertion operator confuse you.  If
you look at it the output stream is all but ignored.  Instead everything is
sent to a formatter.  The formatter is hard coded in DOMPrintFormatTarget to
use cout.write() as the WriteChars() implementation.  If you want to use
another stream you are going to need to change that hard coded point or
retool the sample.

What's the status on the XML serializer API?  I was looking into that before
(surprised to hell that the support that is in the Java version for this
isn't well dealt with in the C++ version) and kept coming across "we'll work
on it when the API is standardized".  Then there was the "I'm at the
conference RIGHT NOW where we are working on the API".  Well, regardless,
what I have ended up doing so far is adapting what was in DOMPrint.cpp into
an operator that takes a formatter so I could whip up the formatter I need
at runtime with the right stream inside of it and start it going.  I might
end up cleaning it up and providing it to people who need it.

* goes back to trying to figure out why Xalan no longer works at _all_...
doesn't seem to be a Xalan problem *

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

-----Original Message-----
From: Awasthi, Anand [mailto:Anand_Awasthi@bmc.com]
Sent: Monday, June 18, 2001 12:24 PM
To: 'xerces-c-dev@xml.apache.org'
Subject: RE: problem in DOMPrint.cpp

anand.txt gives me following o/p:

<?xml version='1.0' encoding='UTF-8' standalone='no' ?>

nothing else














-----Original Message-----
From: Jeff Paquette [mailto:paquette@mediaone.net]
Sent: Monday, June 18, 2001 12:04 PM
To: xerces-c-dev@xml.apache.org
Subject: RE: problem in DOMPrint.cpp


Try:

    std::ofstream xmlfile("anand.txt");
    xmlfile << "<?xml version='1.0' encoding='UTF-8' standalone='no' ?>" <<
std::endl;
    DOM_node node  = parser.getDocument();
    xmlfile << node << std::endl;

--
Jeff Paquette
paquette at mediaone.net
http://www.atnetsend.net


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org