tng 2002/12/10 10:59:14
Modified: c/src/xercesc/dom/impl DOMWriterImpl.cpp
Log:
pretty format print: consistent newline
Revision Changes Path
1.24 +22 -10 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.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DOMWriterImpl.cpp 10 Dec 2002 13:34:07 -0000 1.23
+++ DOMWriterImpl.cpp 10 Dec 2002 18:59:14 -0000 1.24
@@ -57,6 +57,9 @@
/*
* $Id$
* $Log$
+ * Revision 1.24 2002/12/10 18:59:14 tng
+ * pretty format print: consistent newline
+ *
* Revision 1.23 2002/12/10 13:34:07 tng
* Pretty-format print: also indent PI/comment that appear inside the root element.
*
@@ -757,6 +760,9 @@
if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT)
break;
+ if(level == 1)
+ printNewLine();
+
printNewLine();
printIndent(level);
@@ -803,6 +809,7 @@
processNode(child, level);
child = child->getNextSibling();
}
+ printNewLine();
break;
}
@@ -813,6 +820,9 @@
if ( filterAction == DOMNodeFilter::FILTER_REJECT)
break;
+ if(level == 1)
+ printNewLine();
+
printNewLine();
printIndent(level);
@@ -897,9 +907,6 @@
if (filterAction == DOMNodeFilter::FILTER_ACCEPT)
*fFormatter << XMLFormatter::NoEscapes << chCloseAngle;
- if(level == 1)
- printNewLine();
-
while( child != 0)
{
processNode(child, level);
@@ -915,6 +922,10 @@
if(nodeLine != fCurrentLine)
{
printNewLine();
+
+ if(nodeLine != fCurrentLine && level == 0)
+ printNewLine();
+
printIndent(level);
}
TRY_CATCH_THROW
@@ -924,10 +935,6 @@
,true
)
- //for level 1 nodes that span multiple lines, add an extra
blank line
- if(nodeLine != fCurrentLine && (level == 1 || level==0) )
- printNewLine();
-
}
}
else
@@ -1044,8 +1051,11 @@
if (checkFilter(nodeToWrite) != DOMNodeFilter::FILTER_ACCEPT)
break;
- printNewLine();
- printIndent(level);
+ if(level == 1)
+ printNewLine();
+
+ printNewLine();
+ printIndent(level);
TRY_CATCH_THROW
(
@@ -1064,6 +1074,7 @@
printNewLine();
printIndent(level);
+
TRY_CATCH_THROW
(
*fFormatter << gStartDoctype << nodeName;
@@ -1124,6 +1135,7 @@
//
printNewLine();
printIndent(level);
+
fFormatter->setEscapeFlags(XMLFormatter::NoEscapes);
*fFormatter << gStartEntity << nodeName;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]