peiyongz 2003/03/15 21:42:04
Modified: c/src/xercesc/dom/impl DOMWriterImpl.hpp DOMWriterImpl.cpp
Log:
Bug#17983 Formatter does not escape control characters
Revision Changes Path
1.13 +10 -1 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp
Index: DOMWriterImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DOMWriterImpl.hpp 28 Jan 2003 18:31:47 -0000 1.12
+++ DOMWriterImpl.hpp 16 Mar 2003 05:42:04 -0000 1.13
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.13 2003/03/16 05:42:04 peiyongz
+ * Bug#17983 Formatter does not escape control characters
+ *
* Revision 1.12 2003/01/28 18:31:47 peiyongz
* Bug#13694: Allow Xerces to write the BOM to XML files
*
@@ -438,6 +441,9 @@
// fFilter
// don't own it
//
+ // fDocumentVersion
+ // The XML Version of the document to be serialized.
+ //
// fEncodingUsed (session var)
// the actual encoding used in WriteNode(),
// it does not own any data(memory).
@@ -466,6 +472,7 @@
XMLCh *fNewLine;
DOMErrorHandler *fErrorHandler;
DOMWriterFilter *fFilter;
+ const XMLCh *fDocumentVersion;
//session vars
const XMLCh *fEncodingUsed;
@@ -473,6 +480,8 @@
XMLFormatter *fFormatter;
int fErrorCount;
int fCurrentLine;
+
+
};
inline void DOMWriterImpl::setFeature(const int featureId
1.31 +16 -1 xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp
Index: DOMWriterImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- DOMWriterImpl.cpp 25 Feb 2003 16:07:37 -0000 1.30
+++ DOMWriterImpl.cpp 16 Mar 2003 05:42:04 -0000 1.31
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.31 2003/03/16 05:42:04 peiyongz
+ * Bug#17983 Formatter does not escape control characters
+ *
* Revision 1.30 2003/02/25 16:07:37 tng
* [Bug 13493] Use const on static data in DOMWriterImpl.cpp.
*
@@ -427,6 +430,7 @@
,fNewLine(0)
,fErrorHandler(0)
,fFilter(0)
+,fDocumentVersion(XMLUni::fgVersion1_0)
,fEncodingUsed(0)
,fNewLineUsed(0)
,fFormatter(0)
@@ -548,6 +552,7 @@
try
{
fFormatter = new XMLFormatter(fEncodingUsed
+ ,fDocumentVersion
,destination
,XMLFormatter::NoEscapes
,XMLFormatter::UnRep_CharRef);
@@ -699,6 +704,16 @@
* The default value for this attribute is null
*/
fNewLineUsed = (fNewLine && *fNewLine)? fNewLine : gEOLSeq;
+
+ /**
+ * get Document Version
+ */
+ const DOMDocument *docu = (nodeToWrite->getNodeType() ==
DOMNode::DOCUMENT_NODE)?
+ (const DOMDocument*)nodeToWrite :
nodeToWrite->getOwnerDocument();
+ if (docu)
+ {
+ fDocumentVersion = docu->getVersion();
+ }
fErrorCount = 0;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]