You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/08/07 20:41:49 UTC
cvs commit: xml-xalan/c/src/XalanSourceTree XalanSourceTreeContentHandler.cpp
dbertoni 01/08/07 11:41:49
Modified: c/src/XalanSourceTree XalanSourceTreeContentHandler.cpp
Log:
Fixed bug where PIs or comments before the document element would result in a document without a document element.
Revision Changes Path
1.7 +6 -1 xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.cpp
Index: XalanSourceTreeContentHandler.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XalanSourceTree/XalanSourceTreeContentHandler.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XalanSourceTreeContentHandler.cpp 2001/08/06 01:37:01 1.6
+++ XalanSourceTreeContentHandler.cpp 2001/08/07 18:41:49 1.7
@@ -127,6 +127,8 @@
// startDocument()...
m_elementStack.pop_back();
+ assert(m_document->getDocumentElement() != 0);
+
assert(m_elementStack.empty() == true);
assert(m_lastChildStack.empty() == true);
@@ -204,7 +206,10 @@
if (theCurrentElement == 0)
{
- doAppendChildNode(theDocument, theLastChild, theNewChild);
+ // If there is no current element. it means we haven't
+ // created the document element yet, so always append
+ // to the document, rather than the last child.
+ theDocument->appendChildNode(theNewChild);
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org