amassari 2004/07/08 12:31:00
Modified: c/tests/DOM/Normalizer Normalizer.cpp
Log:
Force the destruction of an XMLBuffer before terminating Xerces
Revision Changes Path
1.4 +15 -12 xml-xerces/c/tests/DOM/Normalizer/Normalizer.cpp
Index: Normalizer.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tests/DOM/Normalizer/Normalizer.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Normalizer.cpp 30 May 2003 13:08:25 -0000 1.3
+++ Normalizer.cpp 8 Jul 2004 19:31:00 -0000 1.4
@@ -284,18 +284,21 @@
normalizer->serializeNode(doc);
XERCES_STD_QUALIFIER cout << "\n\n";
- //use a binding
- XMLBuffer buf;
- buf.set(XMLUni::fgXMLNSString);
- buf.append(chColon);
- buf.append(X("po2"));
- docFirstElementChild->removeAttributeNS(XMLUni::fgXMLNSURIName,
XMLUni::fgXMLNSString);
- docFirstElement->removeAttributeNS(XMLUni::fgXMLNSURIName,
XMLUni::fgXMLNSString);
- docFirstElement->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(),
X("http://www.test2.com"));
- docFirstElementChild->setPrefix(X("po2"));
- doc->normalizeDocument();
- normalizer->serializeNode(doc);
- XERCES_STD_QUALIFIER cout << "\n\n";
+ // this block is needed to destroy the XMLBuffer
+ {
+ //use a binding
+ XMLBuffer buf;
+ buf.set(XMLUni::fgXMLNSString);
+ buf.append(chColon);
+ buf.append(X("po2"));
+ docFirstElementChild->removeAttributeNS(XMLUni::fgXMLNSURIName,
XMLUni::fgXMLNSString);
+ docFirstElement->removeAttributeNS(XMLUni::fgXMLNSURIName,
XMLUni::fgXMLNSString);
+ docFirstElement->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(),
X("http://www.test2.com"));
+ docFirstElementChild->setPrefix(X("po2"));
+ doc->normalizeDocument();
+ normalizer->serializeNode(doc);
+ XERCES_STD_QUALIFIER cout << "\n\n";
+ }
//some siblngs to ensure the scope stacks are working
docFirstElementChildChild =
doc->createElementNS(X("http://www.test3.com"),X("docEleChildChild2"));
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]