peiyongz 2002/12/02 15:08:09
Modified: c/src/xercesc/dom/impl DOMWriterImpl.cpp
Log:
fix to bug#14528: output n+1 cdatasection
Revision Changes Path
1.21 +16 -3 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.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- DOMWriterImpl.cpp 13 Nov 2002 21:51:22 -0000 1.20
+++ DOMWriterImpl.cpp 2 Dec 2002 23:08:09 -0000 1.21
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.21 2002/12/02 23:08:09 peiyongz
+ * fix to bug#14528: output n+1 cdatasection
+ *
* Revision 1.20 2002/11/13 21:51:22 peiyongz
* fix to Bug#14528
*
@@ -264,6 +267,8 @@
chCloseSquare, chCloseSquare, chCloseAngle, chNull
};
+static const int offset = XMLString::stringLen(gEndCDATA);
+
//<!--
static const XMLCh gStartComment[] =
{
@@ -1198,10 +1203,18 @@
void DOMWriterImpl::procCdataSection(const XMLCh* const nodeValue
, const DOMNode* const nodeToWrite)
{
- XMLCh* curPtr = (XMLCh*) nodeValue;
+ /***
+ * Append a ']]>' at the end
+ */
+ XMLCh* repNodeValue = new XMLCh [XMLString::stringLen(nodeValue) + offset + 1];
+ XMLString::copyString(repNodeValue, nodeValue);
+ XMLString::catString(repNodeValue, gEndCDATA);
+ ArrayJanitor<XMLCh> jName(repNodeValue);
+
+ XMLCh* curPtr = (XMLCh*) repNodeValue;
XMLCh* nextPtr = 0;
int endTagPos = -1;
- int offset = XMLString::stringLen(gEndCDATA);
+
bool endTagFound = true;
while (endTagFound)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]