///DOMPrintFilter *myFilter = 0;
try {
- // get a serializer, an instance of DOMWriter
+ // get a serializer, an instance of DOMWriter (kmr Now DOMLSSerializer)
XMLCh tempStr[100];
XMLString::transcode("LS", tempStr, 99);
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ theOutput->setByteStream(mymFormTarget);
+
// set user specified end of line sequence and output encoding
//theSerializer->setNewLine(gMyEOLSequence);
static XMLCh* gOutputEncoding = 0;
- theSerializer->setEncoding(gOutputEncoding);
-
+ // kmr theSerializer->setEncoding(gOutputEncoding);
+ theOutput->setEncoding(gOutputEncoding);
+
// plug in user's own filter
/*
if(gUseFilter) {
// plug in user's own error handler
DOMErrorHandler* myErrorHandler = new DOMPrintErrorHandler();
- theSerializer->setErrorHandler(myErrorHandler);
+ dc->setParameter(XMLUni::fgDOMErrorHandler,myErrorHandler);
// set feature if the serializer supports the feature/mode
static bool gSplitCdataSections = true;
- if(theSerializer->canSetFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
- theSerializer->setFeature(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
+ if(dc->canSetParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections))
+ dc->setParameter(XMLUni::fgDOMWRTSplitCdataSections, gSplitCdataSections);
static bool gDiscardDefaultContent = true;
- if(theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
- theSerializer->setFeature(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
+ if(dc->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent))
+ dc->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, gDiscardDefaultContent);
static bool gFormatPrettyPrint = true;
- if(theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
+ if(dc->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint))
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, gFormatPrettyPrint);
//
// Plug in a format target to receive the resultant
//((LocalFileFormatTarget*) myfFormTarget)->Target.setEscapeFlags();
- theSerializer->writeNode(mymFormTarget, *Document);
-
+ //kmr theSerializer->writeNode(mymFormTarget, *Document);
+ theSerializer->write(Document, theOutput);
+ delete theOutput;
delete theSerializer;
//