From 7774bb9ff04700f34bca4bfb4b94d686f26f5713 Mon Sep 17 00:00:00 2001
From: Tinny Ng <tng@apache.org>
Date: Mon, 4 Nov 2002 15:24:50 +0000
Subject: [PATCH] C++ Namespace Support.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174311 13f79535-47bb-0310-9956-ffa450edef68
---
 samples/MemParse/MemParseHandlers.hpp         |   6 +
 samples/Redirect/RedirectHandlers.hpp         |   6 +
 samples/SAXCount/SAXCountHandlers.hpp         |   5 +
 samples/StdInParse/StdInParseHandlers.hpp     |   7 +-
 .../util/ArrayIndexOutOfBoundsException.hpp   |  27 +-
 src/xercesc/util/Base64.cpp                   |  91 +++---
 src/xercesc/util/Base64.hpp                   |  54 ++--
 src/xercesc/util/BinFileInputStream.cpp       |  34 ++-
 src/xercesc/util/BinFileInputStream.hpp       |  34 ++-
 src/xercesc/util/BinInputStream.cpp           |  34 ++-
 src/xercesc/util/BinInputStream.hpp           |  35 ++-
 src/xercesc/util/BinMemInputStream.cpp        |  34 ++-
 src/xercesc/util/BinMemInputStream.hpp        |  34 ++-
 src/xercesc/util/BitOps.hpp                   |  36 ++-
 src/xercesc/util/BitSet.cpp                   |  34 ++-
 src/xercesc/util/BitSet.hpp                   |  35 ++-
 src/xercesc/util/CountedPointer.c             |  35 ++-
 src/xercesc/util/CountedPointer.hpp           |  33 ++-
 src/xercesc/util/EmptyStackException.hpp      |  28 +-
 src/xercesc/util/EncodingValidator.cpp        |   7 +
 src/xercesc/util/EncodingValidator.hpp        |   2 +
 src/xercesc/util/FlagJanitor.c                |  34 ++-
 src/xercesc/util/FlagJanitor.hpp              |  34 ++-
 src/xercesc/util/HashBase.hpp                 |  28 +-
 src/xercesc/util/HashCMStateSet.hpp           |  37 ++-
 src/xercesc/util/HashPtr.cpp                  |   4 +
 src/xercesc/util/HashPtr.hpp                  |   4 +
 src/xercesc/util/HashXMLCh.cpp                |   4 +
 src/xercesc/util/HashXMLCh.hpp                |  30 +-
 src/xercesc/util/HeaderDummy.cpp              |  34 ++-
 src/xercesc/util/HexBin.cpp                   |  47 +--
 src/xercesc/util/HexBin.hpp                   |  30 +-
 src/xercesc/util/IOException.hpp              |  27 +-
 src/xercesc/util/IllegalArgumentException.hpp |  27 +-
 src/xercesc/util/InvalidCastException.hpp     |  28 +-
 src/xercesc/util/Janitor.c                    |  34 ++-
 src/xercesc/util/Janitor.hpp                  |  33 ++-
 src/xercesc/util/KVStringPair.cpp             |  10 +-
 src/xercesc/util/KVStringPair.hpp             |  10 +-
 src/xercesc/util/KeyRefPair.c                 |   4 +-
 src/xercesc/util/KeyRefPair.hpp               |   2 +
 src/xercesc/util/KeyValuePair.c               |  35 ++-
 src/xercesc/util/KeyValuePair.hpp             |  33 ++-
 src/xercesc/util/Mutexes.cpp                  |  35 ++-
 src/xercesc/util/Mutexes.hpp                  |  37 ++-
 src/xercesc/util/NameIdPool.c                 |   7 +-
 src/xercesc/util/NameIdPool.hpp               |  37 +--
 src/xercesc/util/NoDefTranscoderException.hpp |  34 ++-
 src/xercesc/util/NoSuchElementException.hpp   |  27 +-
 src/xercesc/util/NullPointerException.hpp     |  28 +-
 src/xercesc/util/NumberFormatException.hpp    |   3 +
 src/xercesc/util/ParseException.hpp           |   3 +
 src/xercesc/util/PlatformUtils.cpp            |  11 +-
 src/xercesc/util/PlatformUtils.hpp            |   4 +
 src/xercesc/util/QName.cpp                    |   6 +
 src/xercesc/util/QName.hpp                    |   8 +
 src/xercesc/util/RefArrayOf.c                 |  34 ++-
 src/xercesc/util/RefArrayOf.hpp               |   5 +
 src/xercesc/util/RefHash2KeysTableOf.c        |  15 +-
 src/xercesc/util/RefHash2KeysTableOf.hpp      |   7 +
 src/xercesc/util/RefHash3KeysIdPool.c         |  14 +-
 src/xercesc/util/RefHash3KeysIdPool.hpp       |   7 +
 src/xercesc/util/RefHashTableOf.c             |   7 +
 src/xercesc/util/RefHashTableOf.hpp           |   6 +
 src/xercesc/util/RefStackOf.c                 |  35 ++-
 src/xercesc/util/RefStackOf.hpp               |   5 +
 src/xercesc/util/RefVectorOf.c                |   6 +
 src/xercesc/util/RefVectorOf.hpp              |   6 +
 src/xercesc/util/RuntimeException.hpp         |  28 +-
 src/xercesc/util/SchemaDateTimeException.hpp  |  10 +-
 src/xercesc/util/StringPool.cpp               |  10 +-
 src/xercesc/util/StringPool.hpp               |  11 +-
 src/xercesc/util/TransENameMap.c              |  28 +-
 src/xercesc/util/TransENameMap.hpp            |  27 +-
 src/xercesc/util/TransService.cpp             |  10 +-
 src/xercesc/util/TransService.hpp             |  12 +-
 src/xercesc/util/TranscodingException.hpp     |  28 +-
 src/xercesc/util/UTFDataFormatException.hpp   |  28 +-
 src/xercesc/util/UnexpectedEOFException.hpp   |  28 +-
 .../util/UnsupportedEncodingException.hpp     |  28 +-
 src/xercesc/util/ValueArrayOf.c               |  35 ++-
 src/xercesc/util/ValueArrayOf.hpp             |   6 +
 src/xercesc/util/ValueHashTableOf.c           |  35 ++-
 src/xercesc/util/ValueHashTableOf.hpp         |   3 +
 src/xercesc/util/ValueStackOf.c               |  35 ++-
 src/xercesc/util/ValueStackOf.hpp             |   5 +
 src/xercesc/util/ValueVectorOf.c              |  37 +--
 src/xercesc/util/ValueVectorOf.hpp            |   5 +
 src/xercesc/util/XML256TableTranscoder.cpp    |  28 +-
 src/xercesc/util/XML256TableTranscoder.hpp    |  35 ++-
 src/xercesc/util/XML88591Transcoder.cpp       |  30 +-
 src/xercesc/util/XML88591Transcoder.hpp       |  27 +-
 src/xercesc/util/XMLASCIITranscoder.cpp       |  28 +-
 src/xercesc/util/XMLASCIITranscoder.hpp       |  27 +-
 src/xercesc/util/XMLAbstractDoubleFloat.cpp   |   7 +
 src/xercesc/util/XMLAbstractDoubleFloat.hpp   |   7 +
 src/xercesc/util/XMLBigDecimal.cpp            |  13 +-
 src/xercesc/util/XMLBigDecimal.hpp            |   6 +-
 src/xercesc/util/XMLBigInteger.cpp            |   8 +-
 src/xercesc/util/XMLBigInteger.hpp            |   6 +-
 src/xercesc/util/XMLChTranscoder.cpp          |  32 ++-
 src/xercesc/util/XMLChTranscoder.hpp          |  27 +-
 src/xercesc/util/XMLDateTime.cpp              | 267 +++++++++---------
 src/xercesc/util/XMLDateTime.hpp              |  49 ++--
 src/xercesc/util/XMLDeleterFor.c              |  34 ++-
 src/xercesc/util/XMLDeleterFor.hpp            |  35 ++-
 src/xercesc/util/XMLDouble.cpp                |   7 +
 src/xercesc/util/XMLDouble.hpp                |   7 +
 src/xercesc/util/XMLEBCDICTranscoder.cpp      |  28 +-
 src/xercesc/util/XMLEBCDICTranscoder.hpp      |  27 +-
 src/xercesc/util/XMLEnumerator.hpp            |   7 +
 src/xercesc/util/XMLExceptMsgs.hpp            |   7 +
 src/xercesc/util/XMLException.cpp             |  33 ++-
 src/xercesc/util/XMLException.hpp             |   3 +
 src/xercesc/util/XMLFloat.cpp                 |   7 +
 src/xercesc/util/XMLFloat.hpp                 |   7 +
 src/xercesc/util/XMLIBM1140Transcoder.cpp     |  27 +-
 src/xercesc/util/XMLIBM1140Transcoder.hpp     |  29 +-
 src/xercesc/util/XMLInteger.hpp               |  17 +-
 src/xercesc/util/XMLMsgLoader.hpp             |  35 ++-
 src/xercesc/util/XMLNetAccessor.hpp           |   2 +
 src/xercesc/util/XMLNumber.cpp                |  33 ++-
 src/xercesc/util/XMLNumber.hpp                |  41 +--
 src/xercesc/util/XMLRegisterCleanup.hpp       |  51 ++--
 src/xercesc/util/XMLString.cpp                |   3 +
 src/xercesc/util/XMLString.hpp                |   6 +
 src/xercesc/util/XMLStringTokenizer.cpp       |   9 +-
 src/xercesc/util/XMLStringTokenizer.hpp       |   4 +
 src/xercesc/util/XMLUCS4Transcoder.hpp        |  27 +-
 src/xercesc/util/XMLUCSTranscoder.cpp         |   4 +-
 src/xercesc/util/XMLURL.cpp                   |   5 +
 src/xercesc/util/XMLURL.hpp                   |   4 +
 src/xercesc/util/XMLUTF16Transcoder.cpp       |  29 +-
 src/xercesc/util/XMLUTF16Transcoder.hpp       |  28 +-
 src/xercesc/util/XMLUTF8Transcoder.cpp        |  33 ++-
 src/xercesc/util/XMLUTF8Transcoder.hpp        |  28 +-
 src/xercesc/util/XMLUni.cpp                   |   4 +
 src/xercesc/util/XMLUni.hpp                   |   3 +
 src/xercesc/util/XMLUniDefs.hpp               |   4 +
 src/xercesc/util/XMLUri.cpp                   |   4 +
 src/xercesc/util/XMLUri.hpp                   |   7 +
 src/xercesc/util/XMLWin1252Transcoder.cpp     |  28 +-
 src/xercesc/util/XMLWin1252Transcoder.hpp     |  28 +-
 tests/DOM/DOMTest/DTest.h                     |   5 +
 .../DeprecatedDOMCount/DeprecatedDOMCount.hpp |   2 +
 tests/InitTermTest/InitTermTest.hpp           |   2 +
 tests/ThreadTest/ThreadTest.cpp               |   2 +-
 tools/IANACharset/IANACharset.cpp             |  38 ++-
 tools/NLS/Xlat/Xlat.cpp                       |  21 +-
 tools/NLS/Xlat/Xlat_CppSrc.cpp                |  10 +
 tools/NLS/Xlat/Xlat_MsgCatalog.cpp            |  44 ++-
 151 files changed, 2060 insertions(+), 1292 deletions(-)

diff --git a/samples/MemParse/MemParseHandlers.hpp b/samples/MemParse/MemParseHandlers.hpp
index 15a161a74..073328820 100644
--- a/samples/MemParse/MemParseHandlers.hpp
+++ b/samples/MemParse/MemParseHandlers.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/11/04 15:23:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/02/01 22:37:14  peiyongz
  * sane_include
  *
@@ -80,7 +83,10 @@
 //  Includes
 // ---------------------------------------------------------------------------
 #include <xercesc/sax/HandlerBase.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
 class AttributeList;
+XERCES_CPP_NAMESPACE_END
 
 
 class MemParseHandlers : public HandlerBase
diff --git a/samples/Redirect/RedirectHandlers.hpp b/samples/Redirect/RedirectHandlers.hpp
index ae2e76b6e..0e04c9796 100644
--- a/samples/Redirect/RedirectHandlers.hpp
+++ b/samples/Redirect/RedirectHandlers.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/11/04 15:23:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/02/01 22:38:26  peiyongz
  * sane_include
  *
@@ -80,7 +83,10 @@
 //  Includes
 // ---------------------------------------------------------------------------
 #include <xercesc/sax/HandlerBase.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
 class AttributeList;
+XERCES_CPP_NAMESPACE_END
 
 
 class RedirectHandlers : public HandlerBase
diff --git a/samples/SAXCount/SAXCountHandlers.hpp b/samples/SAXCount/SAXCountHandlers.hpp
index 78b3ea585..42933695e 100644
--- a/samples/SAXCount/SAXCountHandlers.hpp
+++ b/samples/SAXCount/SAXCountHandlers.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2002/11/04 15:23:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/02/01 22:41:07  peiyongz
  * sane_include
  *
@@ -84,7 +87,9 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/sax/HandlerBase.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 class AttributeList;
+XERCES_CPP_NAMESPACE_END
 
 class SAXCountHandlers : public HandlerBase
 {
diff --git a/samples/StdInParse/StdInParseHandlers.hpp b/samples/StdInParse/StdInParseHandlers.hpp
index be844ef68..ace9102cf 100644
--- a/samples/StdInParse/StdInParseHandlers.hpp
+++ b/samples/StdInParse/StdInParseHandlers.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/11/04 15:23:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/02/01 22:41:37  peiyongz
  * sane_include
  *
@@ -80,8 +83,10 @@
 //  Includes
 // ---------------------------------------------------------------------------
 #include <xercesc/sax/HandlerBase.hpp>
-class AttributeList;
 
+XERCES_CPP_NAMESPACE_BEGIN
+class AttributeList;
+XERCES_CPP_NAMESPACE_END
 
 class StdInParseHandlers : public HandlerBase
 {
diff --git a/src/xercesc/util/ArrayIndexOutOfBoundsException.hpp b/src/xercesc/util/ArrayIndexOutOfBoundsException.hpp
index d6406e4a9..0b0db3f46 100644
--- a/src/xercesc/util/ArrayIndexOutOfBoundsException.hpp
+++ b/src/xercesc/util/ArrayIndexOutOfBoundsException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,7 +64,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(ArrayIndexOutOfBoundsException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/Base64.cpp b/src/xercesc/util/Base64.cpp
index 464f5c6e3..d56df24af 100644
--- a/src/xercesc/util/Base64.cpp
+++ b/src/xercesc/util/Base64.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 2001, International
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/03/19 17:01:20  peiyongz
  * Fix to Bug#7243 Base64 encoding is not working.
  *
@@ -97,10 +100,12 @@
 #include <xercesc/util/PlatformUtils.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  constants
 // ---------------------------------------------------------------------------
-static const int BASELENGTH = 255;       
+static const int BASELENGTH = 255;
 static const int FOURBYTE   = 4;
 
 // ---------------------------------------------------------------------------
@@ -113,14 +118,14 @@ const XMLByte Base64::base64Alphabet[] = {
     chLatin_F, chLatin_G, chLatin_H, chLatin_I, chLatin_J,
     chLatin_K, chLatin_L, chLatin_M, chLatin_N, chLatin_O,
     chLatin_P, chLatin_Q, chLatin_R, chLatin_S, chLatin_T,
-    chLatin_U, chLatin_V, chLatin_W, chLatin_X, chLatin_Y, chLatin_Z, 
-	chLatin_a, chLatin_b, chLatin_c, chLatin_d, chLatin_e, 
-	chLatin_f, chLatin_g, chLatin_h, chLatin_i, chLatin_j, 
-	chLatin_k, chLatin_l, chLatin_m, chLatin_n, chLatin_o, 
-	chLatin_p, chLatin_q, chLatin_r, chLatin_s, chLatin_t, 
-	chLatin_u, chLatin_v, chLatin_w, chLatin_x, chLatin_y, chLatin_z, 
-	chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, 
-	chDigit_5, chDigit_6, chDigit_7, chDigit_8, chDigit_9, 
+    chLatin_U, chLatin_V, chLatin_W, chLatin_X, chLatin_Y, chLatin_Z,
+	chLatin_a, chLatin_b, chLatin_c, chLatin_d, chLatin_e,
+	chLatin_f, chLatin_g, chLatin_h, chLatin_i, chLatin_j,
+	chLatin_k, chLatin_l, chLatin_m, chLatin_n, chLatin_o,
+	chLatin_p, chLatin_q, chLatin_r, chLatin_s, chLatin_t,
+	chLatin_u, chLatin_v, chLatin_w, chLatin_x, chLatin_y, chLatin_z,
+	chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4,
+	chDigit_5, chDigit_6, chDigit_7, chDigit_8, chDigit_9,
 	chPlus, chForwardSlash, chNull
 };
 
@@ -235,7 +240,7 @@ XMLByte* Base64::encode(const XMLByte* const inputData,
 //
 // In previous version, we use XMLString::strLen(decodedData)
 // to get the length, this will fail for test case containing
-// consequtive "A", such "AAFF", or "ab56AA56". Instead of 
+// consequtive "A", such "AAFF", or "ab56AA56". Instead of
 // returning 3/6, we have 0 and 3, indicating that "AA", after
 // decoded, is interpreted as <null> by the strLen().
 //
@@ -260,7 +265,7 @@ int Base64::getDataLength( const XMLCh* const inputData )
 // return 0(null) if invalid data found.
 // return the buffer containning decoded data otherwise
 // the caller is responsible for the de-allocation of the
-// buffer returned. 
+// buffer returned.
 //
 // temporary data, rawInputData, is ALWAYS released by this function.
 //
@@ -294,8 +299,8 @@ XMLByte* Base64::decode(const XMLByte* const inputData,
     rawInputData[ rawInputLength ] = 0;
 
     // the length of raw data should be divisible by four
-    if (( rawInputLength % FOURBYTE ) != 0 ) 
-        return 0;  
+    if (( rawInputLength % FOURBYTE ) != 0 )
+        return 0;
 
     int quadrupletCount = rawInputLength / FOURBYTE;
     if ( quadrupletCount == 0 )
@@ -351,17 +356,17 @@ XMLByte* Base64::decode(const XMLByte* const inputData,
         return 0;
     }
 
-    b1 = base64Inverse[ d1 ]; 
+    b1 = base64Inverse[ d1 ];
     b2 = base64Inverse[ d2 ];
 
     // try to process last two octets
     d3 = rawInputData[ rawInputIndex++ ];
     d4 = rawInputData[ rawInputIndex++ ];
 
-    if (!isData( d3 ) || !isData( d4 )) 
+    if (!isData( d3 ) || !isData( d4 ))
     {
         // check if last two are PAD characters
-        if (isPad( d3 ) && isPad( d4 )) 
+        if (isPad( d3 ) && isPad( d4 ))
         {
             // two PAD e.g. 3c==
             if ((b2 & 0xf) != 0) // last 4 bits should be zero
@@ -372,8 +377,8 @@ XMLByte* Base64::decode(const XMLByte* const inputData,
 
             decodedData[ outputIndex++ ] = set1stOctet(b1, b2);
         }
-        else if (!isPad( d3 ) && isPad( d4 )) 
-        {               
+        else if (!isPad( d3 ) && isPad( d4 ))
+        {
             // one PAD e.g. 3cQ=
             b3 = base64Inverse[ d3 ];
             if (( b3 & 0x3 ) != 0 ) // last 2 bits should be zero
@@ -384,16 +389,16 @@ XMLByte* Base64::decode(const XMLByte* const inputData,
 
             decodedData[ outputIndex++ ] = set1stOctet( b1, b2 );
             decodedData[ outputIndex++ ] = set2ndOctet( b2, b3 );
-        } 
-        else 
+        }
+        else
         {
-            // an error like "3c[Pad]r", "3cdX", "3cXd", "3cXX" where X is non data 
+            // an error like "3c[Pad]r", "3cdX", "3cXd", "3cXX" where X is non data
             delete[] decodedData;
             return 0;
-        }       
-    } 
-    else 
-    { 
+        }
+    }
+    else
+    {
         // no PAD e.g 3cQl
         b3 = base64Inverse[ d3 ];
         b4 = base64Inverse[ d4 ];
@@ -403,7 +408,7 @@ XMLByte* Base64::decode(const XMLByte* const inputData,
     }
 
     // write out the end of string
-    decodedData[ outputIndex ] = 0; 
+    decodedData[ outputIndex ] = 0;
     *outputLength = outputIndex;
 
     return decodedData;
@@ -460,15 +465,17 @@ void Base64::init()
 
     int i;
     // set all fields to -1
-    for ( i = 0; i < BASELENGTH; i++ ) 
-        base64Inverse[i] = (XMLByte)-1; 
+    for ( i = 0; i < BASELENGTH; i++ )
+        base64Inverse[i] = (XMLByte)-1;
 
     // compute inverse table
-    for ( i = 0; i < 64; i++ ) 
+    for ( i = 0; i < 64; i++ )
         base64Inverse[ base64Alphabet[i] ] = (XMLByte)i;
 }
 
-bool Base64::isData(const XMLByte& octet) 
+bool Base64::isData(const XMLByte& octet)
 {
     return (base64Inverse[octet]!=(XMLByte)-1);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/Base64.hpp b/src/xercesc/util/Base64.hpp
index c7809c56e..ea2ae7611 100644
--- a/src/xercesc/util/Base64.hpp
+++ b/src/xercesc/util/Base64.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 2001, International
@@ -64,6 +64,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 // This class provides encode/decode for RFC 2045 Base64 as
 // defined by RFC 2045, N. Freed and N. Borenstein.
@@ -71,7 +73,7 @@
 // Part One: Format of Internet Message Bodies. Reference
 // 1996 Available at: http://www.ietf.org/rfc/rfc2045.txt
 // This class is used by XML Schema binary format validation
-//  
+//
 //
 class XMLUTIL_EXPORT Base64
 {
@@ -81,7 +83,7 @@ public :
 
     /**
      * Encodes octets into Base64 data
-     * 
+     *
      * @param inputData Binary data in XMLByte stream.
      * @param inputLength Length of the XMLByte stream.
      * @param outputLength Length of the encoded Base64 byte stream.
@@ -94,10 +96,10 @@ public :
 
     /**
      * Decodes Base64 data into octets
-     * 
+     *
      * @param inputData Base64 data in XMLByte stream.
-     * @param outputLength Length of decoded XMLByte stream. 
-     * @return Decoded binary data in XMLByte stream, 
+     * @param outputLength Length of decoded XMLByte stream.
+     * @return Decoded binary data in XMLByte stream,
 	 *      or NULL if input data can not be decoded.
      */
     static XMLByte* decode(const XMLByte* const inputData,
@@ -105,10 +107,10 @@ public :
 
     /**
      * Decodes Base64 data into XMLCh
-     * 
+     *
      * @param inputData Base64 data in XMLCh stream.
      * @param outputLength Length of decoded XMLCh stream
-     * @return Decoded binary data in XMLCh stream,  
+     * @return Decoded binary data in XMLCh stream,
      *      or NULL if input data can not be decoded.
      */
     static XMLCh* decode(const XMLCh* const inputData,
@@ -117,11 +119,11 @@ public :
     /**
      * Get data length
 	 *
-     * Returns length of decoded data given an array 
+     * Returns length of decoded data given an array
      * containing encoded data.
      *
      * @param inputData Base64 data in XMLCh stream.
-     * @return Length of decoded data, 
+     * @return Length of decoded data,
 	 *      or -1 if input data can not be decoded.
      */
     static int getDataLength(const XMLCh* const inputData );
@@ -170,7 +172,7 @@ private :
     //
     //  quadsPerLine
     //     Number of quadruplets per one line. The encoded output
-    //     stream must be represented in lines of no more 
+    //     stream must be represented in lines of no more
     //     than 19 quadruplets each.
     //
     // -----------------------------------------------------------------------
@@ -187,7 +189,7 @@ private :
 // -----------------------------------------------------------------------
 //  Helper methods
 // -----------------------------------------------------------------------
-inline bool Base64::isPad(const XMLByte& octet) 
+inline bool Base64::isPad(const XMLByte& octet)
 {
     return ( octet == base64Padding );
 }
@@ -213,13 +215,15 @@ inline void Base64::split1stOctet(const XMLByte& ch, XMLByte& b1, XMLByte& b2) {
 }
 
 inline void Base64::split2ndOctet(const XMLByte& ch, XMLByte& b2, XMLByte& b3) {
-    b2 |= ch >> 4;  // combine with previous value  
+    b2 |= ch >> 4;  // combine with previous value
     b3 = ( ch & 0xf ) << 2;
 }
 
 inline void Base64::split3rdOctet(const XMLByte& ch, XMLByte& b3, XMLByte& b4) {
-    b3 |= ch >> 6;  // combine with previous value 
+    b3 |= ch >> 6;  // combine with previous value
     b4 = ( ch & 0x3f );
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/BinFileInputStream.cpp b/src/xercesc/util/BinFileInputStream.cpp
index e98d8a0c8..225a9e2d8 100644
--- a/src/xercesc/util/BinFileInputStream.cpp
+++ b/src/xercesc/util/BinFileInputStream.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:09  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -91,6 +94,7 @@
 #include <xercesc/util/XMLExceptMsgs.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  BinFileInputStream: Constructors and Destructor
@@ -164,3 +168,5 @@ BinFileInputStream::readBytes(          XMLByte* const  toFill
     //
     return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/BinFileInputStream.hpp b/src/xercesc/util/BinFileInputStream.hpp
index cd29ba3b3..6f80bf471 100644
--- a/src/xercesc/util/BinFileInputStream.hpp
+++ b/src/xercesc/util/BinFileInputStream.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:09  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/02/24 20:05:23  abagchi
  * Swat for removing Log from API docs
@@ -78,6 +81,7 @@
 
 #include <xercesc/util/BinInputStream.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class XMLUTIL_EXPORT BinFileInputStream : public BinInputStream
 {
@@ -143,4 +147,6 @@ inline bool BinFileInputStream::getIsOpen() const
     return (fSource != 0);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/BinInputStream.cpp b/src/xercesc/util/BinInputStream.cpp
index a444b7500..8a715c887 100644
--- a/src/xercesc/util/BinInputStream.cpp
+++ b/src/xercesc/util/BinInputStream.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -81,6 +84,7 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/BinInputStream.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  BinInputStream: Virtual destructor!
@@ -96,3 +100,5 @@ BinInputStream::~BinInputStream()
 BinInputStream::BinInputStream()
 {
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/BinInputStream.hpp b/src/xercesc/util/BinInputStream.hpp
index 377400312..3c5f500bb 100644
--- a/src/xercesc/util/BinInputStream.hpp
+++ b/src/xercesc/util/BinInputStream.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,6 +86,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT BinInputStream
 {
 public :
@@ -119,4 +124,6 @@ private :
     void operator=(const BinInputStream&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/BinMemInputStream.cpp b/src/xercesc/util/BinMemInputStream.cpp
index c812b08e0..de561ab12 100644
--- a/src/xercesc/util/BinMemInputStream.cpp
+++ b/src/xercesc/util/BinMemInputStream.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.5  2001/11/28 19:05:29  knoaman
  * Bug 4442: fix by mlovett@uk.ibm.com
@@ -88,6 +91,7 @@
 #include <xercesc/util/BinMemInputStream.hpp>
 #include <string.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  BinMemInputStream: Constructors and Destructor
@@ -145,3 +149,5 @@ unsigned int BinMemInputStream::readBytes(          XMLByte* const  toFill
     fCurIndex += actualToRead;
     return actualToRead;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/BinMemInputStream.hpp b/src/xercesc/util/BinMemInputStream.hpp
index 50b8afea2..a728cae6e 100644
--- a/src/xercesc/util/BinMemInputStream.hpp
+++ b/src/xercesc/util/BinMemInputStream.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/02/24 20:05:24  abagchi
  * Swat for removing Log from API docs
@@ -78,6 +81,7 @@
 
 #include <xercesc/util/BinInputStream.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class XMLUTIL_EXPORT BinMemInputStream : public BinInputStream
 {
@@ -165,4 +169,6 @@ inline unsigned int BinMemInputStream::curPos() const
     return fCurIndex;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/BitOps.hpp b/src/xercesc/util/BitOps.hpp
index db432af73..bfbe4d0b8 100644
--- a/src/xercesc/util/BitOps.hpp
+++ b/src/xercesc/util/BitOps.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.7  2000/09/06 00:24:15  andyh
  * Clean up misc compiler warnings
@@ -92,6 +95,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class XMLUTIL_EXPORT BitOps
 {
@@ -101,7 +105,7 @@ public:
     // -----------------------------------------------------------------------
     static inline XMLCh swapBytes(const XMLUInt16 toSwap)
     {
-        //The mask is required to overcome a compiler error on solaris 
+        //The mask is required to overcome a compiler error on solaris
         return XMLCh(((toSwap >> 8) | (toSwap << 8)) & 0xFFFF);
     }
 
@@ -129,4 +133,6 @@ protected :
     void operator=(const BitOps);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/BitSet.cpp b/src/xercesc/util/BitSet.cpp
index 2e6c73939..d117ea9be 100644
--- a/src/xercesc/util/BitSet.cpp
+++ b/src/xercesc/util/BitSet.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -86,6 +89,7 @@
 #include <xercesc/util/ArrayIndexOutOfBoundsException.hpp>
 #include <xercesc/util/BitSet.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local const data
@@ -316,3 +320,5 @@ void BitSet::ensureCapacity(const unsigned int size)
         fUnitLen = unitsNeeded;
     }
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/BitSet.hpp b/src/xercesc/util/BitSet.hpp
index 79213fdc1..b5a309e8f 100644
--- a/src/xercesc/util/BitSet.hpp
+++ b/src/xercesc/util/BitSet.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,6 +86,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT BitSet
 {
 public:
@@ -157,4 +162,6 @@ private :
     unsigned int    fUnitLen;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/CountedPointer.c b/src/xercesc/util/CountedPointer.c
index 8e4e854f6..58be17071 100644
--- a/src/xercesc/util/CountedPointer.c
+++ b/src/xercesc/util/CountedPointer.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:38  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,7 +86,7 @@
 #include <xercesc/util/CountedPointer.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  CountedPointerTo: Constructors and Destructor
@@ -159,3 +162,5 @@ template <class T> T& CountedPointerTo<T>::operator*()
         ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
     return *fPtr;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/CountedPointer.hpp b/src/xercesc/util/CountedPointer.hpp
index e484b4664..27646d082 100644
--- a/src/xercesc/util/CountedPointer.hpp
+++ b/src/xercesc/util/CountedPointer.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:39  roddey
  * This checkin includes many changes done while waiting for the
@@ -85,6 +88,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/NullPointerException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class T> class CountedPointerTo
 {
@@ -120,6 +124,7 @@ private:
     T*  fPtr;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/CountedPointer.c>
diff --git a/src/xercesc/util/EmptyStackException.hpp b/src/xercesc/util/EmptyStackException.hpp
index 0aacf6238..711415adb 100644
--- a/src/xercesc/util/EmptyStackException.hpp
+++ b/src/xercesc/util/EmptyStackException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,6 +64,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(EmptyStackException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/EncodingValidator.cpp b/src/xercesc/util/EncodingValidator.cpp
index 6b9e52617..0f2208610 100644
--- a/src/xercesc/util/EncodingValidator.cpp
+++ b/src/xercesc/util/EncodingValidator.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.1  2002/07/18 20:08:16  knoaman
  * Initial checkin: feature to control strict IANA encoding name.
  *
@@ -69,6 +72,8 @@
 #include <xercesc/util/PlatformUtils.hpp>
 #include <xercesc/util/XMLRegisterCleanup.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  Static member data initialization
 // ---------------------------------------------------------------------------
@@ -147,6 +152,8 @@ void EncodingValidator::reinitInstance() {
 	fInstance = 0;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 /**
   * End of file EncodingValidator.cpp
   */
diff --git a/src/xercesc/util/EncodingValidator.hpp b/src/xercesc/util/EncodingValidator.hpp
index aef4e4db9..475aa1e41 100644
--- a/src/xercesc/util/EncodingValidator.hpp
+++ b/src/xercesc/util/EncodingValidator.hpp
@@ -66,6 +66,7 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/ValueHashTableOf.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 /**
   * A singleton class that checks whether an encoding name is a valid IANA
@@ -122,6 +123,7 @@ private:
     static EncodingValidator* fInstance;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #endif
 
diff --git a/src/xercesc/util/FlagJanitor.c b/src/xercesc/util/FlagJanitor.c
index 9f2eaf30b..7c4391a3c 100644
--- a/src/xercesc/util/FlagJanitor.c
+++ b/src/xercesc/util/FlagJanitor.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:39  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,6 +86,7 @@
 #include <xercesc/util/FlagJanitor.hpp>
 #endif
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Constructors and Destructor
@@ -113,3 +117,5 @@ template <class T> void FlagJanitor<T>::release()
 {
     fValPtr = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/FlagJanitor.hpp b/src/xercesc/util/FlagJanitor.hpp
index 5e2727594..c58e8937e 100644
--- a/src/xercesc/util/FlagJanitor.hpp
+++ b/src/xercesc/util/FlagJanitor.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:39  roddey
  * This checkin includes many changes done while waiting for the
@@ -84,7 +87,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class T> class FlagJanitor
 {
@@ -124,6 +127,7 @@ private :
     T*  fValPtr;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/FlagJanitor.c>
diff --git a/src/xercesc/util/HashBase.hpp b/src/xercesc/util/HashBase.hpp
index 46e89525b..7a4355cb1 100644
--- a/src/xercesc/util/HashBase.hpp
+++ b/src/xercesc/util/HashBase.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -59,6 +59,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
  * The <code>HashBase</code> interface is the general outline of a hasher.
  * Hashers are used in <code>RefHashTableOf</code> hashtables to hash any
@@ -91,4 +93,6 @@ public:
 
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/HashCMStateSet.hpp b/src/xercesc/util/HashCMStateSet.hpp
index d55950a86..ea73ddcef 100644
--- a/src/xercesc/util/HashCMStateSet.hpp
+++ b/src/xercesc/util/HashCMStateSet.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.2  2001/11/22 20:23:00  peiyongz
  * _declspec(dllimport) and inline warning C4273
@@ -74,10 +77,12 @@
 #include <xercesc/util/HashBase.hpp>
 #include <xercesc/validators/common/CMStateSet.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
  * The <code>HashCMStateSet</code> class inherits from <code>HashBase</code>.
  * This is a CMStateSet specific hasher class designed to hash the values
- * of CMStateSet.  
+ * of CMStateSet.
  *
  * See <code>HashBase</code> for more information.
  */
@@ -114,4 +119,6 @@ inline bool HashCMStateSet::equals(const void *const key1, const void *const key
 	return (*pkey1==*pkey2);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/HashPtr.cpp b/src/xercesc/util/HashPtr.cpp
index f976e8bc5..f0b27f4aa 100644
--- a/src/xercesc/util/HashPtr.cpp
+++ b/src/xercesc/util/HashPtr.cpp
@@ -57,6 +57,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include "HashPtr.hpp"
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 HashPtr::HashPtr()
 {
 }
@@ -74,3 +76,5 @@ bool HashPtr::equals(const void *const key1, const void *const key2)
 {
 	return (key1 == key2);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/HashPtr.hpp b/src/xercesc/util/HashPtr.hpp
index 026ffb1ce..7b7cece94 100644
--- a/src/xercesc/util/HashPtr.hpp
+++ b/src/xercesc/util/HashPtr.hpp
@@ -60,6 +60,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/HashBase.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
  * The <code>HashPtr</code> class inherits from <code>HashBase</code>.
  * This is a generic hasher class designed to hash the pointers of the
@@ -78,4 +80,6 @@ public:
 
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/HashXMLCh.cpp b/src/xercesc/util/HashXMLCh.cpp
index 19ea2fb2c..d7002b95d 100644
--- a/src/xercesc/util/HashXMLCh.cpp
+++ b/src/xercesc/util/HashXMLCh.cpp
@@ -57,6 +57,8 @@
 #include "HashXMLCh.hpp"
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 HashXMLCh::HashXMLCh()
 {
 }
@@ -74,3 +76,5 @@ bool HashXMLCh::equals(const void *const key1, const void *const key2)
 {
 	return (XMLString::equals((XMLCh*)key1, (XMLCh*)key2)) ? true : false;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/HashXMLCh.hpp b/src/xercesc/util/HashXMLCh.hpp
index 9c4392014..66801ccfc 100644
--- a/src/xercesc/util/HashXMLCh.hpp
+++ b/src/xercesc/util/HashXMLCh.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,11 +60,13 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/HashBase.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
  * The <code>HashXMLCh</code> class inherits from <code>HashBase</code>.
  * This is a XMLCh* string specific hasher class designed to hash the values
  * of XMLCh* strings with a given modulo.  References the XMLString hash
- * function.  
+ * function.
  * See <code>HashBase</code> for more information.
  */
 
@@ -78,4 +80,6 @@ public:
 
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/HeaderDummy.cpp b/src/xercesc/util/HeaderDummy.cpp
index 23183f1ff..c9302a978 100644
--- a/src/xercesc/util/HeaderDummy.cpp
+++ b/src/xercesc/util/HeaderDummy.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:40  roddey
  * This checkin includes many changes done while waiting for the
@@ -95,3 +98,6 @@
 #include <xercesc/util/UnexpectedEOFException.hpp>
 #include <xercesc/util/UnsupportedEncodingException.hpp>
 #include <xercesc/util/UTFDataFormatException.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/HexBin.cpp b/src/xercesc/util/HexBin.cpp
index 0640f2410..99f435fe4 100644
--- a/src/xercesc/util/HexBin.cpp
+++ b/src/xercesc/util/HexBin.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 2001, International
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:03  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/04/18 14:55:38  peiyongz
  * Bug#7301: Redundant range-check in HexBin.cpp, patch from Martin Kalen
  *
@@ -74,15 +77,17 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  constants
 // ---------------------------------------------------------------------------
-static const int BASELENGTH = 255;       
+static const int BASELENGTH = 255;
 
 // ---------------------------------------------------------------------------
 //  class data member
 // ---------------------------------------------------------------------------
-bool HexBin::hexNumberTable[BASELENGTH]; 
+bool HexBin::hexNumberTable[BASELENGTH];
 bool HexBin::isInitialized = false;
 
 int HexBin::getDataLength(const XMLCh* const hexData)
@@ -106,7 +111,7 @@ bool HexBin::isArrayByteHex(const XMLCh* const hexData)
         return false;
 
     for ( int i = 0; i < strLen; i++ )
-        if( !isHex(hexData[i]) ) 
+        if( !isHex(hexData[i]) )
             return false;
 
     return true;
@@ -115,7 +120,7 @@ bool HexBin::isArrayByteHex(const XMLCh* const hexData)
 // -----------------------------------------------------------------------
 //  Helper methods
 // -----------------------------------------------------------------------
-bool HexBin::isHex(const XMLCh& octet) 
+bool HexBin::isHex(const XMLCh& octet)
 {
     // sanity check to avoid out-of-bound index
     if ( octet >= BASELENGTH )
@@ -130,17 +135,19 @@ void HexBin::init()
         return;
 
     int i;
-    for ( i = 0; i < BASELENGTH; i++ ) 
-        hexNumberTable[i] = false; 
+    for ( i = 0; i < BASELENGTH; i++ )
+        hexNumberTable[i] = false;
 
     for ( i = chDigit_9; i >= chDigit_0; i-- )
         hexNumberTable[i] = true;
 
-    for ( i = chLatin_F; i >= chLatin_A; i-- ) 
+    for ( i = chLatin_F; i >= chLatin_A; i-- )
         hexNumberTable[i] = true;
 
-    for ( i = chLatin_f; i >= chLatin_a; i-- ) 
+    for ( i = chLatin_f; i >= chLatin_a; i-- )
         hexNumberTable[i] = true;
 
     isInitialized = true;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/HexBin.hpp b/src/xercesc/util/HexBin.hpp
index d28f15c43..4d1db90ca 100644
--- a/src/xercesc/util/HexBin.hpp
+++ b/src/xercesc/util/HexBin.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 2001, International
@@ -63,6 +63,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT HexBin
 {
 public :
@@ -121,7 +123,9 @@ private :
     //
     // -----------------------------------------------------------------------
     static bool       isInitialized;
-    static bool       hexNumberTable[]; 
+    static bool       hexNumberTable[];
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/IOException.hpp b/src/xercesc/util/IOException.hpp
index fc638655a..974693c0c 100644
--- a/src/xercesc/util/IOException.hpp
+++ b/src/xercesc/util/IOException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,7 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(IOException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/IllegalArgumentException.hpp b/src/xercesc/util/IllegalArgumentException.hpp
index bac4a3b2f..950a37d8c 100644
--- a/src/xercesc/util/IllegalArgumentException.hpp
+++ b/src/xercesc/util/IllegalArgumentException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,7 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(IllegalArgumentException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/InvalidCastException.hpp b/src/xercesc/util/InvalidCastException.hpp
index d797665ec..cfd9c5a76 100644
--- a/src/xercesc/util/InvalidCastException.hpp
+++ b/src/xercesc/util/InvalidCastException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,6 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(InvalidCastException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/Janitor.c b/src/xercesc/util/Janitor.c
index 555817aa5..1868fee6b 100644
--- a/src/xercesc/util/Janitor.c
+++ b/src/xercesc/util/Janitor.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.6  2000/10/13 22:45:11  andyh
  * Complete removal of ArrayJanitory::operator->().  Was just commented out earlier.
@@ -93,7 +96,7 @@
 #include <xercesc/util/Janitor.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Janitor: Constructors and Destructor
@@ -214,4 +217,5 @@ ArrayJanitor<T>::reset(T* p)
 	fData = p;
 }
 
+XERCES_CPP_NAMESPACE_END
 
diff --git a/src/xercesc/util/Janitor.hpp b/src/xercesc/util/Janitor.hpp
index 8f0c1dbf0..b570207bb 100644
--- a/src/xercesc/util/Janitor.hpp
+++ b/src/xercesc/util/Janitor.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.7  2000/10/13 22:45:12  andyh
  * Complete removal of ArrayJanitory::operator->().  Was just commented out earlier.
@@ -94,6 +97,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class T> class Janitor
 {
@@ -173,6 +177,7 @@ private :
     T*  fData;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/Janitor.c>
diff --git a/src/xercesc/util/KVStringPair.cpp b/src/xercesc/util/KVStringPair.cpp
index 0ae755525..5ecc893ac 100644
--- a/src/xercesc/util/KVStringPair.cpp
+++ b/src/xercesc/util/KVStringPair.cpp
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.5  2001/05/11 13:26:27  tng
  * Copyright update.
@@ -114,6 +117,7 @@
 #include <xercesc/util/KVStringPair.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  KVStringPair: Constructors and Destructor
@@ -215,3 +219,5 @@ void KVStringPair::set(  const   XMLCh* const    newKey
     setKey(newKey);
     setValue(newValue);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/KVStringPair.hpp b/src/xercesc/util/KVStringPair.hpp
index 7e3b4bdc1..8f3497c9f 100644
--- a/src/xercesc/util/KVStringPair.hpp
+++ b/src/xercesc/util/KVStringPair.hpp
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.6  2001/05/11 13:26:27  tng
  * Copyright update.
@@ -115,6 +118,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides a commonly used data structure, which is that of
@@ -179,4 +183,6 @@ private :
     unsigned long  fValueAllocSize;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/KeyRefPair.c b/src/xercesc/util/KeyRefPair.c
index fc08b7bb9..d646d959f 100644
--- a/src/xercesc/util/KeyRefPair.c
+++ b/src/xercesc/util/KeyRefPair.c
@@ -66,7 +66,7 @@
 #include <xercesc/util/KeyRefPair.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  KeyRefPair: Constructors and Destructor
@@ -139,3 +139,5 @@ KeyRefPair<TKey,TValue>::setValue(TValue* newValue)
     fValue = newValue;
     return fValue;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/KeyRefPair.hpp b/src/xercesc/util/KeyRefPair.hpp
index f6922d465..e52680782 100644
--- a/src/xercesc/util/KeyRefPair.hpp
+++ b/src/xercesc/util/KeyRefPair.hpp
@@ -64,6 +64,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class TKey, class TValue> class KeyRefPair
 {
@@ -107,6 +108,7 @@ template <class TKey, class TValue> class KeyRefPair
         TValue*  fValue;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/KeyRefPair.c>
diff --git a/src/xercesc/util/KeyValuePair.c b/src/xercesc/util/KeyValuePair.c
index 1a507f7ab..4fcb27f53 100644
--- a/src/xercesc/util/KeyValuePair.c
+++ b/src/xercesc/util/KeyValuePair.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:41  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,7 +86,7 @@
 #include <xercesc/util/KeyValuePair.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  KeyValuePair: Constructors and Destructor
@@ -156,3 +159,5 @@ KeyValuePair<TKey,TValue>::setValue(const TValue& newValue)
     fValue = newValue;
     return fValue;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/KeyValuePair.hpp b/src/xercesc/util/KeyValuePair.hpp
index 82f3af7b0..4e25da51c 100644
--- a/src/xercesc/util/KeyValuePair.hpp
+++ b/src/xercesc/util/KeyValuePair.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:10  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:10  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:41  roddey
  * This checkin includes many changes done while waiting for the
@@ -84,6 +87,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class TKey, class TValue> class KeyValuePair
 {
@@ -127,6 +131,7 @@ template <class TKey, class TValue> class KeyValuePair
         TValue  fValue;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/KeyValuePair.c>
diff --git a/src/xercesc/util/Mutexes.cpp b/src/xercesc/util/Mutexes.cpp
index 676947152..18eb434b0 100644
--- a/src/xercesc/util/Mutexes.cpp
+++ b/src/xercesc/util/Mutexes.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:41  roddey
  * This checkin includes many changes done while waiting for the
@@ -88,7 +91,7 @@
 #include <xercesc/util/PlatformUtils.hpp>
 #include <xercesc/util/Mutexes.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLMutex: Constructors and Destructor
@@ -142,3 +145,5 @@ XMLMutexLock::~XMLMutexLock()
 {
     fToLock->unlock();
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/Mutexes.hpp b/src/xercesc/util/Mutexes.hpp
index 57aeea857..b39efd894 100644
--- a/src/xercesc/util/Mutexes.hpp
+++ b/src/xercesc/util/Mutexes.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:42  roddey
  * This checkin includes many changes done while waiting for the
@@ -84,6 +87,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLMutex
 {
 public :
@@ -119,7 +124,7 @@ private :
     //      platform utilities methods which knows what's really in it.
     // -----------------------------------------------------------------------
     void*   fHandle;
-    
+
 
     // -----------------------------------------------------------------------
     //  Sun PlatformUtils needs acess to fHandle to initialize the
@@ -157,4 +162,6 @@ private :
     XMLMutex*   fToLock;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/NameIdPool.c b/src/xercesc/util/NameIdPool.c
index 76aa15fb0..e4230dd1c 100644
--- a/src/xercesc/util/NameIdPool.c
+++ b/src/xercesc/util/NameIdPool.c
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/09/24 19:51:24  tng
  * Performance: use XMLString::equals instead of XMLString::compareString
  *
@@ -93,7 +96,7 @@
 #include <xercesc/util/NoSuchElementException.hpp>
 #include <xercesc/util/RuntimeException.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  NameIdPoolBucketElem: Constructors and Destructor
@@ -420,3 +423,5 @@ template <class TElem> void NameIdPoolEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/NameIdPool.hpp b/src/xercesc/util/NameIdPool.hpp
index b2085dcd6..619012dbc 100644
--- a/src/xercesc/util/NameIdPool.hpp
+++ b/src/xercesc/util/NameIdPool.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.6  2000/09/09 00:11:48  andyh
  * Virtual Destructor Patch, submitted by Kirk Wylie
@@ -93,6 +96,7 @@
 #include <xercesc/util/XMLEnumerator.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  Forward declare the enumerator so he can be our friend. Can you say
@@ -115,7 +119,7 @@ template <class TElem> class NameIdPoolEnumerator;
 //  This provides very fast access by id.
 //
 //  The way these pools are used, elements are never removed except when the
-//  whole thing is flushed. This makes it very easy to maintain the two 
+//  whole thing is flushed. This makes it very easy to maintain the two
 //  access methods in sync.
 //
 //  For efficiency reasons, the id refererence array is never flushed until
@@ -284,7 +288,7 @@ public :
     void Reset();
 
 
-private :    
+private :
     // -----------------------------------------------------------------------
     //  Data Members
     //
@@ -299,6 +303,7 @@ private :
     NameIdPool<TElem>*  fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/NameIdPool.c>
diff --git a/src/xercesc/util/NoDefTranscoderException.hpp b/src/xercesc/util/NoDefTranscoderException.hpp
index 81d677c1a..e8e96daf5 100644
--- a/src/xercesc/util/NoDefTranscoderException.hpp
+++ b/src/xercesc/util/NoDefTranscoderException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.4  2000/03/02 19:54:43  roddey
  * This checkin includes many changes done while waiting for the
@@ -85,6 +88,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class XMLUTIL_EXPORT NoDefTranscoderException : public XMLException
 {
@@ -142,4 +146,6 @@ public:
     }
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/NoSuchElementException.hpp b/src/xercesc/util/NoSuchElementException.hpp
index 9b52ee2bb..8734bec3a 100644
--- a/src/xercesc/util/NoSuchElementException.hpp
+++ b/src/xercesc/util/NoSuchElementException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,7 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(NoSuchElementException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/NullPointerException.hpp b/src/xercesc/util/NullPointerException.hpp
index e502e415f..04794dff4 100644
--- a/src/xercesc/util/NullPointerException.hpp
+++ b/src/xercesc/util/NullPointerException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,6 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(NullPointerException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/NumberFormatException.hpp b/src/xercesc/util/NumberFormatException.hpp
index e226cadc0..69872171a 100644
--- a/src/xercesc/util/NumberFormatException.hpp
+++ b/src/xercesc/util/NumberFormatException.hpp
@@ -65,7 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(NumberFormatException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/ParseException.hpp b/src/xercesc/util/ParseException.hpp
index d3bc16eff..a9b62f29a 100644
--- a/src/xercesc/util/ParseException.hpp
+++ b/src/xercesc/util/ParseException.hpp
@@ -65,7 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(ParseException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/PlatformUtils.cpp b/src/xercesc/util/PlatformUtils.cpp
index c8e9e972d..191ce81a2 100644
--- a/src/xercesc/util/PlatformUtils.cpp
+++ b/src/xercesc/util/PlatformUtils.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/07/18 20:05:31  knoaman
  * Add a new feature to control strict IANA encoding name.
  *
@@ -145,6 +148,7 @@
 #include <xercesc/util/XMLRegisterCleanup.hpp>
 #include <limits.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local data members
@@ -160,7 +164,7 @@ static long                     gInitFlag = 0;
 //  Global data
 //
 //	gXMLCleanupList
-//		This is a list of cleanup functions to be called on 
+//		This is a list of cleanup functions to be called on
 //		XMLPlatformUtils::Terminate.  Their function is to reset static
 //		data in classes that use it.
 //
@@ -193,7 +197,7 @@ void XMLPlatformUtils::Initialize()
     //
     //  We got to prevent overflow from happening.
     //  no error or exception
-    //  
+    //
     if (gInitFlag == LONG_MAX)
         return;
 
@@ -267,7 +271,7 @@ void XMLPlatformUtils::Terminate()
     // otherwise we come to delete non-existing resources.
     //
     //  no error or exception
-    //  
+    //
     if (gInitFlag == 0)
         return;
 
@@ -383,3 +387,4 @@ bool XMLPlatformUtils::isStrictIANAEncoding() {
     return false;
 }
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/PlatformUtils.hpp b/src/xercesc/util/PlatformUtils.hpp
index a089aea77..a18765a12 100644
--- a/src/xercesc/util/PlatformUtils.hpp
+++ b/src/xercesc/util/PlatformUtils.hpp
@@ -65,6 +65,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLMsgLoader;
 class XMLNetAccessor;
 class XMLTransService;
@@ -671,4 +673,6 @@ inline XMLDeleter::XMLDeleter()
 {
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/QName.cpp b/src/xercesc/util/QName.cpp
index c0dee384e..1248fc139 100644
--- a/src/xercesc/util/QName.cpp
+++ b/src/xercesc/util/QName.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/10/30 21:52:00  tng
  * [Bug 13641] compiler-generated copy-constructor for QName doesn't do the right thing.
  *
@@ -103,6 +106,8 @@
 #include <xercesc/util/QName.hpp>
 #include <xercesc/util/Janitor.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  QName: Constructors and Destructor
 // ---------------------------------------------------------------------------
@@ -443,3 +448,4 @@ void QName::cleanUp()
     delete [] fRawName;
 }
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/QName.hpp b/src/xercesc/util/QName.hpp
index e8e065bd4..69975c047 100644
--- a/src/xercesc/util/QName.hpp
+++ b/src/xercesc/util/QName.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/10/30 21:52:00  tng
  * [Bug 13641] compiler-generated copy-constructor for QName doesn't do the right thing.
  *
@@ -104,6 +107,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLUni.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT QName
 {
 public :
@@ -254,4 +259,7 @@ inline void QName::setURI(const unsigned int uriId)
 {
     fURIId = uriId;
 }
+
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/RefArrayOf.c b/src/xercesc/util/RefArrayOf.c
index 34f3b9ddb..950e59229 100644
--- a/src/xercesc/util/RefArrayOf.c
+++ b/src/xercesc/util/RefArrayOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:11  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:11  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:44  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,6 +86,7 @@
 #include <xercesc/util/RefArrayOf.hpp>
 #endif
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  RefArrayOf: Contructors and Destructor
@@ -310,3 +314,5 @@ template <class TElem> void RefArrayEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefArrayOf.hpp b/src/xercesc/util/RefArrayOf.hpp
index ec73972c3..19120e669 100644
--- a/src/xercesc/util/RefArrayOf.hpp
+++ b/src/xercesc/util/RefArrayOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:44:59  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -90,6 +93,7 @@
 #include <xercesc/util/IllegalArgumentException.hpp>
 #include <xercesc/util/XMLEnumerator.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class TElem> class RefArrayOf
 {
@@ -188,6 +192,7 @@ private :
     RefArrayOf<TElem>*  fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefArrayOf.c>
diff --git a/src/xercesc/util/RefHash2KeysTableOf.c b/src/xercesc/util/RefHash2KeysTableOf.c
index 7b9877815..eb5e4d137 100644
--- a/src/xercesc/util/RefHash2KeysTableOf.c
+++ b/src/xercesc/util/RefHash2KeysTableOf.c
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.5  2001/07/19 18:43:18  peiyongz
  * fix: detect null poiniter in enumerator's ctor.
@@ -86,6 +89,8 @@
 
 #include <xercesc/util/NullPointerException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  RefHash2KeysTableOf: Constructors and Destructor
 // ---------------------------------------------------------------------------
@@ -352,8 +357,8 @@ template <class TVal> RefHash2KeysTableOfEnumerator<TVal>::
 RefHash2KeysTableOfEnumerator(RefHash2KeysTableOf<TVal>* const toEnum, const bool adopt)
 	: fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
 {
-    if (!toEnum)  
-        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);        
+    if (!toEnum)
+        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
 
     //
     //  Find the next available bucket element in the hash table. If it
@@ -449,3 +454,5 @@ template <class TVal> void RefHash2KeysTableOfEnumerator<TVal>::findNext()
         fCurElem = fToEnum->fBucketList[fCurHash];
     }
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefHash2KeysTableOf.hpp b/src/xercesc/util/RefHash2KeysTableOf.hpp
index deafea5e6..4837fa4fe 100644
--- a/src/xercesc/util/RefHash2KeysTableOf.hpp
+++ b/src/xercesc/util/RefHash2KeysTableOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/06/12 17:15:12  tng
  * Remove redundant include header file.
  *
@@ -97,6 +100,8 @@
 #include <xercesc/util/HashBase.hpp>
 #include <xercesc/util/HashXMLCh.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // This hash table is similar to RefHashTableOf with an additional integer as key2
 
 //
@@ -261,6 +266,8 @@ private :
     RefHash2KeysTableOf<TVal>*                 fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefHash2KeysTableOf.c>
 #endif
diff --git a/src/xercesc/util/RefHash3KeysIdPool.c b/src/xercesc/util/RefHash3KeysIdPool.c
index 49101923d..bb629a781 100644
--- a/src/xercesc/util/RefHash3KeysIdPool.c
+++ b/src/xercesc/util/RefHash3KeysIdPool.c
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.4  2001/07/19 18:43:18  peiyongz
  * fix: detect null poiniter in enumerator's ctor.
@@ -83,6 +86,8 @@
 
 #include <xercesc/util/NullPointerException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  RefHash3KeysIdPool: Constructors and Destructor
 // ---------------------------------------------------------------------------
@@ -395,8 +400,8 @@ template <class TVal> RefHash3KeysIdPoolEnumerator<TVal>::
 RefHash3KeysIdPoolEnumerator(RefHash3KeysIdPool<TVal>* const toEnum, const bool adopt)
 	: fAdoptedElems(adopt), fCurIndex(0), fToEnum(toEnum)
 {
-    if (!toEnum)  
-        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);        
+    if (!toEnum)
+        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
 
     //
     //  Find the next available bucket element in the pool. We use the id
@@ -441,3 +446,4 @@ template <class TVal> void RefHash3KeysIdPoolEnumerator<TVal>::Reset()
     fCurIndex = 0;
 }
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefHash3KeysIdPool.hpp b/src/xercesc/util/RefHash3KeysIdPool.hpp
index b4de9ef81..752603fbd 100644
--- a/src/xercesc/util/RefHash3KeysIdPool.hpp
+++ b/src/xercesc/util/RefHash3KeysIdPool.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/06/12 17:15:12  tng
  * Remove redundant include header file.
  *
@@ -97,6 +100,8 @@
 #include <xercesc/util/HashBase.hpp>
 #include <xercesc/util/HashXMLCh.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // This hash table is a combination of RefHash2KeyTableOf (with an additional integer as key3)
 // and NameIdPool with an id as index
 
@@ -294,6 +299,8 @@ private :
     RefHash3KeysIdPool<TVal>*  fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefHash3KeysIdPool.c>
 #endif
diff --git a/src/xercesc/util/RefHashTableOf.c b/src/xercesc/util/RefHashTableOf.c
index 9b0f31034..f3166765f 100644
--- a/src/xercesc/util/RefHashTableOf.c
+++ b/src/xercesc/util/RefHashTableOf.c
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.6  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/07/11 18:49:53  knoaman
  * Add setAdoptElements method.
  * Rename removeBucketElemSafe to orphanKey.
@@ -121,6 +124,8 @@
 
 #include <xercesc/util/NullPointerException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  RefHashTableOf: Constructors and Destructor
 // ---------------------------------------------------------------------------
@@ -607,3 +612,5 @@ template <class TVal> void RefHashTableOfEnumerator<TVal>::findNext()
         fCurElem = fToEnum->fBucketList[fCurHash];
     }
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefHashTableOf.hpp b/src/xercesc/util/RefHashTableOf.hpp
index 7fa0b4a95..a1ad5d0ff 100644
--- a/src/xercesc/util/RefHashTableOf.hpp
+++ b/src/xercesc/util/RefHashTableOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -128,6 +131,7 @@
 #include <xercesc/util/HashBase.hpp>
 #include <xercesc/util/HashXMLCh.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  Forward declare the enumerator so he can be our friend. Can you say
@@ -302,6 +306,8 @@ private :
     RefHashTableOf<TVal>*                 fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefHashTableOf.c>
 #endif
diff --git a/src/xercesc/util/RefStackOf.c b/src/xercesc/util/RefStackOf.c
index c22874236..10f8aec19 100644
--- a/src/xercesc/util/RefStackOf.c
+++ b/src/xercesc/util/RefStackOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:44  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,7 +86,7 @@
 #include <xercesc/util/RefStackOf.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  RefStackOf: Constructors and Destructor
@@ -201,3 +204,5 @@ template <class TElem> void RefStackEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefStackOf.hpp b/src/xercesc/util/RefStackOf.hpp
index 773c796a2..59b63ac93 100644
--- a/src/xercesc/util/RefStackOf.hpp
+++ b/src/xercesc/util/RefStackOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -91,6 +94,7 @@
 #include <xercesc/util/RefVectorOf.hpp>
 #include <xercesc/util/XMLEnumerator.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  Forward declare the enumerator so he can be our friend. Can you say
@@ -195,6 +199,7 @@ private :
     RefStackOf<TElem>*  fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefStackOf.c>
diff --git a/src/xercesc/util/RefVectorOf.c b/src/xercesc/util/RefVectorOf.c
index dc666a687..7426ee7b1 100644
--- a/src/xercesc/util/RefVectorOf.c
+++ b/src/xercesc/util/RefVectorOf.c
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/02/05 15:38:14  tng
  * [Bug 6114] Memory leaks on iDOM getElementsByTagName().
  *
@@ -96,6 +99,7 @@
 #include <xercesc/util/RefVectorOf.hpp>
 #endif
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  RefVectorOf: Constructors and Destructor
@@ -397,3 +401,5 @@ template <class TElem> void RefVectorEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/RefVectorOf.hpp b/src/xercesc/util/RefVectorOf.hpp
index 1843a85d2..f01f6e8b7 100644
--- a/src/xercesc/util/RefVectorOf.hpp
+++ b/src/xercesc/util/RefVectorOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -95,6 +98,7 @@
 #include <xercesc/util/ArrayIndexOutOfBoundsException.hpp>
 #include <xercesc/util/XMLEnumerator.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class TElem> class RefVectorOf
 {
@@ -192,6 +196,8 @@ private :
     RefVectorOf<TElem>* fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/RefVectorOf.c>
 #endif
diff --git a/src/xercesc/util/RuntimeException.hpp b/src/xercesc/util/RuntimeException.hpp
index 2b49b6233..b4a21cd78 100644
--- a/src/xercesc/util/RuntimeException.hpp
+++ b/src/xercesc/util/RuntimeException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,6 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(RuntimeException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/SchemaDateTimeException.hpp b/src/xercesc/util/SchemaDateTimeException.hpp
index b595b9bc5..78fd9df19 100644
--- a/src/xercesc/util/SchemaDateTimeException.hpp
+++ b/src/xercesc/util/SchemaDateTimeException.hpp
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.1  2001/11/12 20:36:54  peiyongz
  * SchemaDateTimeException defined
@@ -73,7 +76,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 MakeXMLException(SchemaDateTimeException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/StringPool.cpp b/src/xercesc/util/StringPool.cpp
index 39c24758e..5d507781b 100644
--- a/src/xercesc/util/StringPool.cpp
+++ b/src/xercesc/util/StringPool.cpp
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.6  2001/10/22 15:43:35  tng
  * [Bug 3361] "String pool id was not legal" error in Attributes::getURI().
@@ -94,6 +97,7 @@
 #include <xercesc/util/XMLString.hpp>
 #include <string.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  StringPool::PoolElem: Constructors and Destructor
@@ -242,3 +246,5 @@ unsigned int XMLStringPool::addNewEntry(const XMLCh* const newString)
     fCurId++;
     return newElem->fId;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/StringPool.hpp b/src/xercesc/util/StringPool.hpp
index aa38cdeb7..4694b43db 100644
--- a/src/xercesc/util/StringPool.hpp
+++ b/src/xercesc/util/StringPool.hpp
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:12  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:12  peiyongz
+ * sane_include
  *
  * Revision 1.5  2001/10/22 15:43:35  tng
  * [Bug 3361] "String pool id was not legal" error in Attributes::getURI().
@@ -84,6 +87,8 @@
 
 #include <xercesc/util/RefHashTableOf.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 //  This class implements a string pool, in which strings can be added and
 //  given a unique id by which they can be refered. It has to provide fast
@@ -179,4 +184,6 @@ private :
     unsigned int                fCurId;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/TransENameMap.c b/src/xercesc/util/TransENameMap.c
index 9d53b48a5..a75211c69 100644
--- a/src/xercesc/util/TransENameMap.c
+++ b/src/xercesc/util/TransENameMap.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -62,7 +62,7 @@
 #include <xercesc/util/TransENameMap.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  ENameMapFor: Constructors and Destructor
@@ -114,3 +114,5 @@ EEndianNameMapFor<TType>::makeNew(const unsigned int blockSize) const
 {
     return new TType(getKey(), blockSize, fSwapped);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/TransENameMap.hpp b/src/xercesc/util/TransENameMap.hpp
index 9ec69d495..3e2d63d47 100644
--- a/src/xercesc/util/TransENameMap.hpp
+++ b/src/xercesc/util/TransENameMap.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -61,6 +61,8 @@
 #include <xercesc/util/TransService.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 //  This class is really private to the TransService class. However, some
 //  compilers are too dumb to allow us to hide this class there in the Cpp
@@ -188,6 +190,7 @@ private :
     bool    fSwapped;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/TransENameMap.c>
diff --git a/src/xercesc/util/TransService.cpp b/src/xercesc/util/TransService.cpp
index ebec98af1..d731ce81b 100644
--- a/src/xercesc/util/TransService.cpp
+++ b/src/xercesc/util/TransService.cpp
@@ -76,7 +76,7 @@
 #include <xercesc/util/TransENameMap.hpp>
 #include <xercesc/util/EncodingValidator.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local, static data
@@ -154,7 +154,7 @@ XMLTransService::makeNewTranscoderFor(  const   XMLCh* const            encoding
     {
         if (!EncodingValidator::instance()->isValidEncoding(encodingName))
         {
-            resValue = XMLTransService::UnsupportedEncoding;               
+            resValue = XMLTransService::UnsupportedEncoding;
             return 0;
         }
     }
@@ -190,9 +190,9 @@ XMLTransService::makeNewTranscoderFor(  const   XMLCh* const            encoding
 
     XMLTranscoder* temp =  makeNewXMLTranscoder(encodingName, resValue, blockSize);
 
-    // if successful, set resValue to OK  
+    // if successful, set resValue to OK
     // if failed, the makeNewXMLTranscoder has already set the proper failing resValue
-    if (temp) resValue =  XMLTransService::Ok;    
+    if (temp) resValue =  XMLTransService::Ok;
 
     return temp;
 
@@ -490,3 +490,5 @@ bool XMLTransService::isStrictIANAEncoding()
 {
     return gStrictIANAEncoding;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/TransService.hpp b/src/xercesc/util/TransService.hpp
index cee2973cf..0e7edff65 100644
--- a/src/xercesc/util/TransService.hpp
+++ b/src/xercesc/util/TransService.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:04  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/07/18 20:05:31  knoaman
  * Add a new feature to control strict IANA encoding name.
  *
@@ -128,6 +131,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // Forward references
 class XMLPlatformUtils;
@@ -280,7 +284,7 @@ private :
   * strings, it is not meant to be a comphrehensive string class.
   */
 
-/** 
+/**
   *   <code>XMLTranscoder</code> is for transcoding non-local code
   *   page encodings, i.e.  named encodings. These are used internally
   *   by the scanner to internalize raw XML into the internal Unicode
@@ -292,7 +296,7 @@ class XMLUTIL_EXPORT XMLTranscoder
 {
 public :
 
-	/** 
+	/**
 	 * This enum is used by the <code>transcodeTo()</code> method
 	 * to indicate how to react to unrepresentable characters. The
 	 * <code>transcodeFrom()</code> method always works the
@@ -358,7 +362,7 @@ public :
       * @param maxBytes   the max number of bytes in the destination buffer
       * @param charsEaten after transcoding, this will hold the number of chars
       *    that were processed from the source buffer
-      * @param options    options to pass to the transcoder that explain how to 
+      * @param options    options to pass to the transcoder that explain how to
       *    respond to an unrepresentable character
       * @return Returns the number of chars put into the target buffer
       */
@@ -526,4 +530,6 @@ inline const XMLCh* XMLTranscoder::getEncodingName() const
     return fEncodingName;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/TranscodingException.hpp b/src/xercesc/util/TranscodingException.hpp
index 3b8482013..6b7d9f3c2 100644
--- a/src/xercesc/util/TranscodingException.hpp
+++ b/src/xercesc/util/TranscodingException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,6 +64,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(TranscodingException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/UTFDataFormatException.hpp b/src/xercesc/util/UTFDataFormatException.hpp
index d085e6960..77015fdb6 100644
--- a/src/xercesc/util/UTFDataFormatException.hpp
+++ b/src/xercesc/util/UTFDataFormatException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -65,6 +65,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(UTFDataFormatException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/UnexpectedEOFException.hpp b/src/xercesc/util/UnexpectedEOFException.hpp
index 87e30c0bc..236b35fd7 100644
--- a/src/xercesc/util/UnexpectedEOFException.hpp
+++ b/src/xercesc/util/UnexpectedEOFException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,6 +64,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(UnexpectedEOFException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/UnsupportedEncodingException.hpp b/src/xercesc/util/UnsupportedEncodingException.hpp
index a338d9902..d4718dc32 100644
--- a/src/xercesc/util/UnsupportedEncodingException.hpp
+++ b/src/xercesc/util/UnsupportedEncodingException.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,6 +64,10 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 MakeXMLException(UnsupportedEncodingException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/ValueArrayOf.c b/src/xercesc/util/ValueArrayOf.c
index e363ffd42..7f180f71f 100644
--- a/src/xercesc/util/ValueArrayOf.c
+++ b/src/xercesc/util/ValueArrayOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:13  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:13  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:47  roddey
  * This checkin includes many changes done while waiting for the
@@ -84,6 +87,8 @@
 #endif
 
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  ValueArrayOf: Contructors and Destructor
 // ---------------------------------------------------------------------------
@@ -293,3 +298,5 @@ template <class TElem> void ValueArrayEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/ValueArrayOf.hpp b/src/xercesc/util/ValueArrayOf.hpp
index ec6506990..9dcc3a7ce 100644
--- a/src/xercesc/util/ValueArrayOf.hpp
+++ b/src/xercesc/util/ValueArrayOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -90,6 +93,8 @@
 #include <xercesc/util/ArrayIndexOutOfBoundsException.hpp>
 #include <xercesc/util/IllegalArgumentException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 template <class TElem> class ValueArrayOf
 {
 public :
@@ -185,6 +190,7 @@ private :
     ValueArrayOf<TElem>*    fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/ValueArrayOf.c>
diff --git a/src/xercesc/util/ValueHashTableOf.c b/src/xercesc/util/ValueHashTableOf.c
index 8beda4fc4..e98d19d8d 100644
--- a/src/xercesc/util/ValueHashTableOf.c
+++ b/src/xercesc/util/ValueHashTableOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2002 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,6 +56,9 @@
 
 /**
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/05/24 19:46:40  knoaman
  * Initial checkin.
  *
@@ -71,6 +74,8 @@
 
 #include <xercesc/util/NullPointerException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  ValueHashTableOf: Constructors and Destructor
 // ---------------------------------------------------------------------------
@@ -316,8 +321,8 @@ template <class TVal> ValueHashTableOfEnumerator<TVal>::
 ValueHashTableOfEnumerator(ValueHashTableOf<TVal>* const toEnum, const bool adopt)
 	: fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
 {
-    if (!toEnum)  
-        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);        
+    if (!toEnum)
+        ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
 
     //
     //  Find the next available bucket element in the hash table. If it
@@ -413,3 +418,5 @@ template <class TVal> void ValueHashTableOfEnumerator<TVal>::findNext()
         fCurElem = fToEnum->fBucketList[fCurHash];
     }
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/ValueHashTableOf.hpp b/src/xercesc/util/ValueHashTableOf.hpp
index b166b797e..095d571d2 100644
--- a/src/xercesc/util/ValueHashTableOf.hpp
+++ b/src/xercesc/util/ValueHashTableOf.hpp
@@ -74,6 +74,7 @@
 #include <xercesc/util/HashBase.hpp>
 #include <xercesc/util/HashXMLCh.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  Forward declare the enumerator so he can be our friend. Can you say
@@ -228,6 +229,8 @@ private :
     ValueHashTableOf<TVal>*         fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/ValueHashTableOf.c>
 #endif
diff --git a/src/xercesc/util/ValueStackOf.c b/src/xercesc/util/ValueStackOf.c
index fcf9f4022..c469a989f 100644
--- a/src/xercesc/util/ValueStackOf.c
+++ b/src/xercesc/util/ValueStackOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:13  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:13  peiyongz
+ * sane_include
  *
  * Revision 1.3  2000/03/02 19:54:47  roddey
  * This checkin includes many changes done while waiting for the
@@ -83,6 +86,8 @@
 #include <xercesc/util/ValueStackOf.hpp>
 #endif
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 // ---------------------------------------------------------------------------
 //  ValueStackOf: Constructors and Destructor
@@ -194,3 +199,5 @@ template <class TElem> void ValueStackEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/ValueStackOf.hpp b/src/xercesc/util/ValueStackOf.hpp
index b18b3ceed..8ffb2ed76 100644
--- a/src/xercesc/util/ValueStackOf.hpp
+++ b/src/xercesc/util/ValueStackOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -89,6 +92,7 @@
 #include <xercesc/util/EmptyStackException.hpp>
 #include <xercesc/util/ValueVectorOf.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  Forward declare the enumerator so he can be our friend. Can you say
@@ -192,6 +196,7 @@ private :
     ValueStackOf<TElem>*    fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/ValueStackOf.c>
diff --git a/src/xercesc/util/ValueVectorOf.c b/src/xercesc/util/ValueVectorOf.c
index d06f28e20..74dd096fa 100644
--- a/src/xercesc/util/ValueVectorOf.c
+++ b/src/xercesc/util/ValueVectorOf.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /**
  * $Log$
- * Revision 1.1  2002/02/01 22:22:13  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:13  peiyongz
+ * sane_include
  *
  * Revision 1.5  2002/01/10 17:44:49  knoaman
  * Fix for bug 5786.
@@ -89,7 +92,7 @@
 #include <xercesc/util/ValueVectorOf.hpp>
 #endif
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  ValueVectorOf: Constructors and Destructor
@@ -212,7 +215,7 @@ template <class TElem> void ValueVectorOf<TElem>::removeAllElements()
     fCurCount = 0;
 }
 
-template <class TElem> 
+template <class TElem>
 bool ValueVectorOf<TElem>::containsElement(const TElem& toCheck,
                                            const unsigned int startIndex) {
 
@@ -328,3 +331,5 @@ template <class TElem> void ValueVectorEnumerator<TElem>::Reset()
 {
     fCurIndex = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/ValueVectorOf.hpp b/src/xercesc/util/ValueVectorOf.hpp
index 97fc8b515..16a88a274 100644
--- a/src/xercesc/util/ValueVectorOf.hpp
+++ b/src/xercesc/util/ValueVectorOf.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -95,6 +98,7 @@
 #include <xercesc/util/ArrayIndexOutOfBoundsException.hpp>
 #include <xercesc/util/XMLEnumerator.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 template <class TElem> class ValueVectorOf
 {
@@ -206,6 +210,7 @@ private :
     ValueVectorOf<TElem>*   fToEnum;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/ValueVectorOf.c>
diff --git a/src/xercesc/util/XML256TableTranscoder.cpp b/src/xercesc/util/XML256TableTranscoder.cpp
index cdbfbc6fa..adad1d79a 100644
--- a/src/xercesc/util/XML256TableTranscoder.cpp
+++ b/src/xercesc/util/XML256TableTranscoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -64,7 +64,7 @@
 #include <xercesc/util/XMLString.hpp>
 #include <string.h>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 
 // ---------------------------------------------------------------------------
@@ -262,3 +262,5 @@ XMLByte XML256TableTranscoder::xlatOneTo(const XMLCh toXlat) const
 
     return 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XML256TableTranscoder.hpp b/src/xercesc/util/XML256TableTranscoder.hpp
index d4347a6b1..07c5c7893 100644
--- a/src/xercesc/util/XML256TableTranscoder.hpp
+++ b/src/xercesc/util/XML256TableTranscoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:13  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:13  peiyongz
+ * sane_include
  *
  * Revision 1.1  2000/03/18 00:00:32  roddey
  * Initial updates for two way transcoding support
@@ -70,6 +73,8 @@
 
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 //  This class implements the functionality of a common type of transcoder
 //  for an 8 bit, single byte encoding based on a set of 'to' and 'from'
@@ -184,4 +189,6 @@ private :
     const XMLTransService::TransRec*    fToTable;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XML88591Transcoder.cpp b/src/xercesc/util/XML88591Transcoder.cpp
index c20b06c5c..a022060f6 100644
--- a/src/xercesc/util/XML88591Transcoder.cpp
+++ b/src/xercesc/util/XML88591Transcoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -63,7 +63,7 @@
 #include <xercesc/util/XMLString.hpp>
 #include <string.h>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XML88591Transcoder: Constructors and Destructor
@@ -151,7 +151,7 @@ XML88591Transcoder::transcodeTo(const   XMLCh* const    srcData
     while (srcPtr < srcEnd)
     {
         // If its legal, take it and jump back to top
-        if (*srcPtr < 256)  
+        if (*srcPtr < 256)
         {
             *destPtr++ = XMLByte(*srcPtr++);
             continue;
@@ -189,3 +189,5 @@ bool XML88591Transcoder::canTranscodeTo(const unsigned int toCheck) const
 {
     return (toCheck < 256);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XML88591Transcoder.hpp b/src/xercesc/util/XML88591Transcoder.hpp
index 3ae99221d..a2ba6d50f 100644
--- a/src/xercesc/util/XML88591Transcoder.hpp
+++ b/src/xercesc/util/XML88591Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -121,4 +122,6 @@ private :
     void operator=(const XML88591Transcoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLASCIITranscoder.cpp b/src/xercesc/util/XMLASCIITranscoder.cpp
index 00b1273c5..348c6bc70 100644
--- a/src/xercesc/util/XMLASCIITranscoder.cpp
+++ b/src/xercesc/util/XMLASCIITranscoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -63,7 +63,7 @@
 #include <xercesc/util/TranscodingException.hpp>
 #include <string.h>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLASCIITranscoder: Constructors and Destructor
@@ -214,3 +214,5 @@ bool XMLASCIITranscoder::canTranscodeTo(const unsigned int toCheck) const
 {
     return (toCheck < 0x80);
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLASCIITranscoder.hpp b/src/xercesc/util/XMLASCIITranscoder.hpp
index aba1618f0..b67bb3aa6 100644
--- a/src/xercesc/util/XMLASCIITranscoder.hpp
+++ b/src/xercesc/util/XMLASCIITranscoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -121,4 +122,6 @@ private :
     void operator=(const XMLASCIITranscoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLAbstractDoubleFloat.cpp b/src/xercesc/util/XMLAbstractDoubleFloat.cpp
index 4284d03df..24d9c83f4 100644
--- a/src/xercesc/util/XMLAbstractDoubleFloat.cpp
+++ b/src/xercesc/util/XMLAbstractDoubleFloat.cpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.6  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/09/24 19:51:24  tng
  * Performance: use XMLString::equals instead of XMLString::compareString
  *
@@ -90,6 +93,8 @@
 #include <xercesc/util/NumberFormatException.hpp>
 #include <xercesc/util/Janitor.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  local data member
 // ---------------------------------------------------------------------------
@@ -410,3 +415,5 @@ void XMLAbstractDoubleFloat::normalizeZero(XMLCh* const inData)
 
 	return;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLAbstractDoubleFloat.hpp b/src/xercesc/util/XMLAbstractDoubleFloat.hpp
index 4ffe6035c..7eae2e087 100644
--- a/src/xercesc/util/XMLAbstractDoubleFloat.hpp
+++ b/src/xercesc/util/XMLAbstractDoubleFloat.hpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.5  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/03/06 19:13:12  peiyongz
  * Patch: more valid lexcial representation for positive/negative zero
  *
@@ -91,6 +94,8 @@
 #include <xercesc/util/XMLNumber.hpp>
 #include <xercesc/util/XMLBigDecimal.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /***
  * 3.2.5.1 Lexical representation
  *
@@ -212,4 +217,6 @@ inline bool XMLAbstractDoubleFloat::isSpecialValue() const
     return (fType < SpecialTypeNum);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLBigDecimal.cpp b/src/xercesc/util/XMLBigDecimal.cpp
index 49696270a..20b720d1d 100644
--- a/src/xercesc/util/XMLBigDecimal.cpp
+++ b/src/xercesc/util/XMLBigDecimal.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/13 22:11:23  peiyongz
  * Fix to Bug#9442
  *
@@ -99,6 +102,8 @@
 #include <xercesc/util/TransService.hpp>
 #include <xercesc/util/Janitor.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
  * Constructs a BigDecimal from a string containing an optional (plus | minus)
  * sign followed by a sequence of zero or more decimal digits, optionally
@@ -110,7 +115,7 @@
  * Any extraneous characters (including whitespace) will result in
  * a NumberFormatException.
 
- * since parseBigDecimal and XMLBigInteger() may throw exception, 
+ * since parseBigDecimal and XMLBigInteger() may throw exception,
  * caller of XMLBigDecimal need to catch it.
 //
 **/
@@ -148,7 +153,7 @@ XMLBigDecimal::XMLBigDecimal(const XMLBigDecimal& toCopy, const int addExponent)
 {
     //invoke XMLBigInteger' copy ctor
     fIntVal = new XMLBigInteger(*(toCopy.getValue()));
- 
+
     if ( addExponent > 0 )
     {
         if (fScale >= (unsigned int)addExponent)
@@ -239,7 +244,7 @@ void XMLBigDecimal::parseBigDecimal(const XMLCh* const toConvert
     // '+' or '-' is allowed only at the first position
     //
     if (*startPtr == chDash)
-    {       
+    {
         *retPtr = chDash;  // copy the '-'
         startPtr++;
         retPtr++;
@@ -359,3 +364,5 @@ XMLCh*  XMLBigDecimal::toString() const
     return XMLString::replicate(fRawData);
 }
 
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLBigDecimal.hpp b/src/xercesc/util/XMLBigDecimal.hpp
index 0e0d75dc8..a3c7dadbe 100644
--- a/src/xercesc/util/XMLBigDecimal.hpp
+++ b/src/xercesc/util/XMLBigDecimal.hpp
@@ -65,6 +65,8 @@
 #include <xercesc/util/XMLNumber.hpp>
 #include <xercesc/util/XMLBigInteger.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLBigDecimal : public XMLNumber
 {
 public:
@@ -140,7 +142,7 @@ private:
     //     the number of digits to the right of the decimal point
     //
 	//  fRawData
-	//     to preserve the original string used to construct this object, 
+	//     to preserve the original string used to construct this object,
 	//     needed for pattern matching.
 	//
     // -----------------------------------------------------------------------
@@ -182,4 +184,6 @@ inline bool XMLBigDecimal::operator==(const XMLBigDecimal& toCompare) const
     return ( XMLBigInteger::compareValues(this->fIntVal, toCompare.fIntVal) == 0 ? true : false);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLBigInteger.cpp b/src/xercesc/util/XMLBigInteger.cpp
index fcfc79a9b..35b7aadad 100644
--- a/src/xercesc/util/XMLBigInteger.cpp
+++ b/src/xercesc/util/XMLBigInteger.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/13 22:11:23  peiyongz
  * Fix to Bug#9442
  *
@@ -96,6 +99,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/Janitor.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /***
    *
    *  Leading and trailing whitespaces are allowed, and trimmed
@@ -221,7 +226,7 @@ XMLBigInteger::XMLBigInteger(const XMLCh* const strValue)
         fMagnitude = XMLString::replicate(XMLUni::fgZeroLenString);
     else
         fMagnitude = XMLString::replicate(ret_value);
-   
+
 	fRawData = XMLString::replicate(strValue);
 
 }
@@ -350,3 +355,4 @@ int XMLBigInteger::intValue() const
     return retVal * getSign();
 }
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLBigInteger.hpp b/src/xercesc/util/XMLBigInteger.hpp
index 8d66bc180..9967c73d2 100644
--- a/src/xercesc/util/XMLBigInteger.hpp
+++ b/src/xercesc/util/XMLBigInteger.hpp
@@ -64,6 +64,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLBigInteger
 {
 public:
@@ -146,7 +148,7 @@ private:
     //     the buffer holding the number.
     //
 	//  fRawData
-	//     to preserve the original string used to construct this object, 
+	//     to preserve the original string used to construct this object,
 	//     needed for pattern matching.
 	//
     // -----------------------------------------------------------------------
@@ -185,4 +187,6 @@ inline XMLCh*  XMLBigInteger::toString() const
     return XMLString::replicate(fRawData);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLChTranscoder.cpp b/src/xercesc/util/XMLChTranscoder.cpp
index 8f3ca3b97..864e1c68e 100644
--- a/src/xercesc/util/XMLChTranscoder.cpp
+++ b/src/xercesc/util/XMLChTranscoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -62,7 +62,7 @@
 #include <xercesc/util/XMLChTranscoder.hpp>
 #include <string.h>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLChTranscoder: Constructors and Destructor
@@ -133,7 +133,7 @@ XMLChTranscoder::transcodeTo(const  XMLCh* const    srcData
     checkBlockSize(maxBytes);
     #endif
 
-    
+
     //
     //  Calculate the max chars we can do here. Its the lesser of the
     //  max chars we can store in the output byte buffer, and the number
@@ -159,6 +159,8 @@ XMLChTranscoder::transcodeTo(const  XMLCh* const    srcData
 
 bool XMLChTranscoder::canTranscodeTo(const unsigned int toCheck) const
 {
-    // We can handle anything 
+    // We can handle anything
     return true;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLChTranscoder.hpp b/src/xercesc/util/XMLChTranscoder.hpp
index bb8c4a4c0..e4a7f8240 100644
--- a/src/xercesc/util/XMLChTranscoder.hpp
+++ b/src/xercesc/util/XMLChTranscoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -118,4 +119,6 @@ private :
     void operator=(const XMLChTranscoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLDateTime.cpp b/src/xercesc/util/XMLDateTime.cpp
index c5d493c2e..489ee420b 100644
--- a/src/xercesc/util/XMLDateTime.cpp
+++ b/src/xercesc/util/XMLDateTime.cpp
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:14  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz
+ * sane_include
  *
  * Revision 1.4  2001/11/14 22:04:03  peiyongz
  * Patch to apply check on Year and more rigorous on other fields as well.
@@ -84,12 +87,14 @@
 #include <xercesc/util/XMLUni.hpp>
 #include <xercesc/util/Janitor.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 // constants used to process raw data (fBuffer)
 //
 // [-]{CCYY-MM-DD}'T'{HH:MM:SS.MS}['Z']
 //                                [{+|-}hh:mm']
-//                                  
+//
 
 static const XMLCh DURATION_STARTER     = chLatin_P;              // 'P'
 static const XMLCh DURATION_Y           = chLatin_Y;              // 'Y'
@@ -120,23 +125,23 @@ static const int TIMEZONE_SIZE   = 5;    // hh:mm
 static const int DAY_SIZE        = 5;    // ---DD
 static const int MONTH_SIZE      = 6;    // --MM--
 static const int MONTHDAY_SIZE   = 7;    // --MM-DD
-static const int NOT_FOUND       = -1;   
+static const int NOT_FOUND       = -1;
 
-//define constants to be used in assigning default values for 
+//define constants to be used in assigning default values for
 //all date/time excluding duration
 static const int YEAR_DEFAULT  = 2000;
 static const int MONTH_DEFAULT = 01;
 static const int DAY_DEFAULT   = 15;
 
-// order-relation on duration is a partial order. The dates below are used to 
+// order-relation on duration is a partial order. The dates below are used to
 // for comparison of 2 durations, based on the fact that
 // duration x and y is x<=y iff s+x<=s+y
 // see 3.2.6 duration W3C schema datatype specs
 //
-// the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone}  
-static const int DATETIMES[][XMLDateTime::TOTAL_SIZE] = 
+// the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone}
+static const int DATETIMES[][XMLDateTime::TOTAL_SIZE] =
 {
-    {1696, 9, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},     
+    {1696, 9, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},
 	{1697, 2, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},
 	{1903, 3, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD},
 	{1903, 7, 1, 0, 0, 0, 0, XMLDateTime::UTC_STD}
@@ -151,19 +156,19 @@ static inline int fQuotient(int a, int b)
     return div_result.quot;
 }
 
-static inline int fQuotient(int temp, int low, int high) 
+static inline int fQuotient(int temp, int low, int high)
 {
     return fQuotient(temp - low, high - low);
 }
 
-static inline int mod(int a, int b, int quotient) 
+static inline int mod(int a, int b, int quotient)
 {
 	return (a - quotient*b) ;
 }
 
-static inline int modulo (int temp, int low, int high) 
+static inline int modulo (int temp, int low, int high)
 {
-    //modulo(a - low, high - low) + low 
+    //modulo(a - low, high - low) + low
     int a = temp - low;
     int b = high - low;
     return (mod (a, b, fQuotient(a, b)) + low) ;
@@ -171,21 +176,21 @@ static inline int modulo (int temp, int low, int high)
 
 static inline bool isLeapYear(int year)
 {
-    return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0))); 
+    return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0)));
 }
 
-static int maxDayInMonthFor(int year, int month) 
+static int maxDayInMonthFor(int year, int month)
 {
 
-    if ( month == 4 || month == 6 || month == 9 || month == 11 ) 
+    if ( month == 4 || month == 6 || month == 9 || month == 11 )
     {
         return 30;
     }
-    else if ( month==2 ) 
+    else if ( month==2 )
     {
-        if ( isLeapYear(year) ) 
+        if ( isLeapYear(year) )
             return 29;
-        else 
+        else
             return 28;
     }
     else
@@ -203,13 +208,13 @@ static int maxDayInMonthFor(int year, int month)
  *
  * 3.2.6.2 Order relation on duration
  *
- *     In general, the order-relation on duration is a partial order since there is no 
- *  determinate relationship between certain durations such as one month (P1M) and 30 days (P30D). 
- *  The order-relation of two duration values x and y is x < y iff s+x < s+y for each qualified 
- *  dateTime s in the list below. 
+ *     In general, the order-relation on duration is a partial order since there is no
+ *  determinate relationship between certain durations such as one month (P1M) and 30 days (P30D).
+ *  The order-relation of two duration values x and y is x < y iff s+x < s+y for each qualified
+ *  dateTime s in the list below.
  *
  *     These values for s cause the greatest deviations in the addition of dateTimes and durations
- * 
+ *
  **/
 int XMLDateTime::compare(const XMLDateTime* const pDate1
                        , const XMLDateTime* const pDate2
@@ -232,14 +237,14 @@ int XMLDateTime::compare(const XMLDateTime* const pDate1
     addDuration(pTempA, pDate1, 0);
     addDuration(pTempB, pDate2, 0);
     resultA = compareOrder(pTempA, pTempB);
-    if ( resultA == INDETERMINATE )  
+    if ( resultA == INDETERMINATE )
         return INDETERMINATE;
 
     addDuration(pTempA, pDate1, 1);
     addDuration(pTempB, pDate2, 1);
     resultB = compareOrder(pTempA, pTempB);
     resultA = compareResult(resultA, resultB, strict);
-    if ( resultA == INDETERMINATE ) 
+    if ( resultA == INDETERMINATE )
         return INDETERMINATE;
 
     addDuration(pTempA, pDate1, 2);
@@ -265,7 +270,7 @@ int XMLDateTime::compare(const XMLDateTime* const pDate1
 //       fDuration  date
 //
 
-void XMLDateTime::addDuration(XMLDateTime*             fNewDate 
+void XMLDateTime::addDuration(XMLDateTime*             fNewDate
                             , const XMLDateTime* const fDuration
                             , int index)
 
@@ -289,10 +294,10 @@ void XMLDateTime::addDuration(XMLDateTime*             fNewDate
     carry = fQuotient (temp, 60);
     fNewDate->fValue[Second] =  mod(temp, 60, carry);
 		
-    //add minutes 
-    temp = DATETIMES[index][Minute] + fDuration->fValue[Minute] + carry; 
-    carry = fQuotient(temp, 60); 
-    fNewDate->fValue[Minute] = mod(temp, 60, carry);         
+    //add minutes
+    temp = DATETIMES[index][Minute] + fDuration->fValue[Minute] + carry;
+    carry = fQuotient(temp, 60);
+    fNewDate->fValue[Minute] = mod(temp, 60, carry);
 
     //add hours
     temp = DATETIMES[index][Hour] + fDuration->fValue[Hour] + carry;
@@ -301,20 +306,20 @@ void XMLDateTime::addDuration(XMLDateTime*             fNewDate
 		
     fNewDate->fValue[Day] = DATETIMES[index][Day] + fDuration->fValue[Day] + carry;
 
-    while ( true ) 
+    while ( true )
     {
         temp = maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]);
-        if ( fNewDate->fValue[Day] < 1 ) 
+        if ( fNewDate->fValue[Day] < 1 )
         { //original fNewDate was negative
             fNewDate->fValue[Day] += maxDayInMonthFor(fNewDate->fValue[CentYear], fNewDate->fValue[Month]-1);
             carry = -1;
         }
-        else if ( fNewDate->fValue[Day] > temp ) 
+        else if ( fNewDate->fValue[Day] > temp )
         {
             fNewDate->fValue[Day] -= temp;
             carry = 1;
         }
-        else 
+        else
         {
             break;
         }
@@ -333,24 +338,24 @@ int XMLDateTime::compareResult(short resultA
                              , bool strict)
 {
 
-    if ( resultB == INDETERMINATE ) 
+    if ( resultB == INDETERMINATE )
     {
         return INDETERMINATE;
     }
-    else if ( (resultA != resultB) && 
-              strict                ) 
+    else if ( (resultA != resultB) &&
+              strict                )
     {
         return INDETERMINATE;
     }
-    else if ( (resultA != resultB) && 
-              !strict               ) 
+    else if ( (resultA != resultB) &&
+              !strict               )
     {
-        if ( (resultA != EQUAL) && 
-             (resultB != EQUAL)  ) 
+        if ( (resultA != EQUAL) &&
+             (resultB != EQUAL)  )
         {
             return INDETERMINATE;
         }
-        else 
+        else
         {
             return (resultA != EQUAL)? resultA : resultB;
         }
@@ -369,18 +374,18 @@ int XMLDateTime::compare(const XMLDateTime* const pDate1
 
     if (pDate1->fValue[utc] == pDate2->fValue[utc])
     {
-        return XMLDateTime::compareOrder(pDate1, pDate2);    
+        return XMLDateTime::compareOrder(pDate1, pDate2);
     }
 
     short c1, c2;
 
-    if ( pDate1->isNormalized()) 
+    if ( pDate1->isNormalized())
     {
         c1 = compareResult(pDate1, pDate2, false, UTC_POS);
         c2 = compareResult(pDate1, pDate2, false, UTC_NEG);
         return getRetVal(c1, c2);
     }
-    else if ( pDate2->isNormalized()) 
+    else if ( pDate2->isNormalized())
     {
         c1 = compareResult(pDate1, pDate2, true, UTC_POS);
         c2 = compareResult(pDate1, pDate2, true, UTC_NEG);
@@ -408,9 +413,9 @@ int XMLDateTime::compareResult(const XMLDateTime* const pDate1
 
 int XMLDateTime::compareOrder(const XMLDateTime* const lValue
                             , const XMLDateTime* const rValue)
-{  
+{
     //
-    // If any of the them is not normalized() yet, 
+    // If any of the them is not normalized() yet,
     // we need to do something here.
     //
     XMLDateTime lTemp = *lValue;
@@ -419,13 +424,13 @@ int XMLDateTime::compareOrder(const XMLDateTime* const lValue
     lTemp.normalize();
     rTemp.normalize();
 
-    for ( int i = 0 ; i < TOTAL_SIZE; i++ ) 
+    for ( int i = 0 ; i < TOTAL_SIZE; i++ )
     {
-        if ( lTemp.fValue[i] < rTemp.fValue[i] ) 
+        if ( lTemp.fValue[i] < rTemp.fValue[i] )
         {
             return LESS_THAN;
         }
-        else if ( lTemp.fValue[i] > rTemp.fValue[i] ) 
+        else if ( lTemp.fValue[i] > rTemp.fValue[i] )
         {
             return GREATER_THAN;
         }
@@ -480,7 +485,7 @@ XMLDateTime& XMLDateTime::operator=(const XMLDateTime& rhs)
 
 //
 // We may simply return the handle to fBuffer, but
-// for the sake of consistency, we return a duplicated copy 
+// for the sake of consistency, we return a duplicated copy
 // and the caller is responsible for the release of the buffer
 // just like any other things in the XMLNumber family.
 //
@@ -555,30 +560,30 @@ void XMLDateTime::parseDay()
 {
     initParser();
 
-    if (fBuffer[0] != DATE_SEPARATOR || 
-        fBuffer[1] != DATE_SEPARATOR || 
-        fBuffer[2] != DATE_SEPARATOR  ) 
+    if (fBuffer[0] != DATE_SEPARATOR ||
+        fBuffer[1] != DATE_SEPARATOR ||
+        fBuffer[2] != DATE_SEPARATOR  )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_gDay_invalid
                 , fBuffer);
     }
 
-    //initialize values 
+    //initialize values
     fValue[CentYear] = YEAR_DEFAULT;
-    fValue[Month]    = MONTH_DEFAULT;  
+    fValue[Month]    = MONTH_DEFAULT;
     fValue[Day]      = parseInt(fStart+3, fStart+5);
 
-    if ( DAY_SIZE < fEnd ) 
+    if ( DAY_SIZE < fEnd )
     {
         int sign = findUTCSign(DAY_SIZE);
-        if ( sign < 0 ) 
+        if ( sign < 0 )
         {
             ThrowXML1(SchemaDateTimeException
                     , XMLExcepts::DateTime_gDay_invalid
                     , fBuffer);
         }
-        else 
+        else
         {
             getTimeZone(sign);
         }
@@ -596,8 +601,8 @@ void XMLDateTime::parseMonth()
 {
     initParser();
 
-    if (fBuffer[0] != DATE_SEPARATOR || 
-        fBuffer[1] != DATE_SEPARATOR || 
+    if (fBuffer[0] != DATE_SEPARATOR ||
+        fBuffer[1] != DATE_SEPARATOR ||
         fBuffer[4] != DATE_SEPARATOR ||
         fBuffer[5] != DATE_SEPARATOR  )
     {
@@ -611,16 +616,16 @@ void XMLDateTime::parseMonth()
     fValue[Day]      = DAY_DEFAULT;
     fValue[Month]    = parseInt(2, 4);
 
-    if ( MONTH_SIZE < fEnd ) 
+    if ( MONTH_SIZE < fEnd )
     {
         int sign = findUTCSign(MONTH_SIZE);
-        if ( sign < 0 ) 
+        if ( sign < 0 )
         {
             ThrowXML1(SchemaDateTimeException
                     , XMLExcepts::DateTime_gMth_invalid
                     , fBuffer);
         }
-        else 
+        else
         {
             getTimeZone(sign);
         }
@@ -642,17 +647,17 @@ void XMLDateTime::parseYear()
     //
     int sign = findUTCSign((fBuffer[0] == chDash) ? 1 : 0);
 
-    if (sign == NOT_FOUND) 
+    if (sign == NOT_FOUND)
     {
         fValue[CentYear] = parseIntYear(fEnd);
     }
-    else 
+    else
     {
         fValue[CentYear] = parseIntYear(sign);
         getTimeZone(sign);
     }
 
-    //initialize values 
+    //initialize values
     fValue[Month] = MONTH_DEFAULT;
     fValue[Day]   = DAY_DEFAULT;   //java is 1
 
@@ -668,8 +673,8 @@ void XMLDateTime::parseMonthDay()
 {
     initParser();
 
-    if (fBuffer[0] != DATE_SEPARATOR || 
-        fBuffer[1] != DATE_SEPARATOR || 
+    if (fBuffer[0] != DATE_SEPARATOR ||
+        fBuffer[1] != DATE_SEPARATOR ||
         fBuffer[4] != DATE_SEPARATOR )
     {
         ThrowXML1(SchemaDateTimeException
@@ -678,21 +683,21 @@ void XMLDateTime::parseMonthDay()
     }
 
 
-    //initialize 
+    //initialize
     fValue[CentYear] = YEAR_DEFAULT;
     fValue[Month]    = parseInt(2, 4);	
     fValue[Day]      = parseInt(5, 7);
 
-    if ( MONTHDAY_SIZE < fEnd ) 
+    if ( MONTHDAY_SIZE < fEnd )
     {
         int sign = findUTCSign(MONTHDAY_SIZE);
-        if ( sign<0 ) 
+        if ( sign<0 )
         {
             ThrowXML1(SchemaDateTimeException
                     , XMLExcepts::DateTime_gMthDay_invalid
                     , fBuffer);
         }
-        else 
+        else
         {
             getTimeZone(sign);
         }
@@ -716,7 +721,7 @@ void XMLDateTime::parseYearMonth()
 }
 
 //
-//PnYn MnDTnH nMnS: -P1Y2M3DT10H30M        
+//PnYn MnDTnH nMnS: -P1Y2M3DT10H30M
 //
 // [-]{'P'{[n'Y'][n'M'][n'D']['T'][n'H'][n'M'][n'S']}}
 //
@@ -730,8 +735,8 @@ void XMLDateTime::parseDuration()
     // must start with '-' or 'P'
     //
     XMLCh c = fBuffer[fStart++];
-    if ( (c != DURATION_STARTER) && 
-         (c != chDash)            ) 
+    if ( (c != DURATION_STARTER) &&
+         (c != chDash)            )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_dur_Start_dashP
@@ -739,7 +744,7 @@ void XMLDateTime::parseDuration()
     }
 
     // 'P' must ALWAYS be present in either case
-    if ( (c == chDash) && 
+    if ( (c == chDash) &&
          (fBuffer[fStart++]!= DURATION_STARTER ))
     {
         ThrowXML1(SchemaDateTimeException
@@ -749,12 +754,12 @@ void XMLDateTime::parseDuration()
 
     // java code
     //date[utc]=(c=='-')?'-':0;
-    //fValue[utc] = UTC_STD; 
+    //fValue[utc] = UTC_STD;
     fValue[utc] = (fBuffer[0] == chDash? UTC_NEG : UTC_STD);
 
     int negate = ( fBuffer[0] == chDash ? -1 : 1);
 
-    // 
+    //
     // No negative value is allowed after 'P'
     //
     // eg P-1234, invalid
@@ -769,15 +774,15 @@ void XMLDateTime::parseDuration()
     //at least one number and designator must be seen after P
     bool designator = false;
 
-    int endDate = indexOf(fStart, fEnd, DATETIME_SEPARATOR); 
-    if ( endDate == NOT_FOUND ) 
+    int endDate = indexOf(fStart, fEnd, DATETIME_SEPARATOR);
+    if ( endDate == NOT_FOUND )
     {
         endDate = fEnd;  // 'T' absent
     }
 
-    //find 'Y'        
+    //find 'Y'
     int end = indexOf(fStart, endDate, DURATION_Y);
-    if ( end != NOT_FOUND ) 
+    if ( end != NOT_FOUND )
     {
         //scan year
         fValue[CentYear] = negate * parseInt(fStart, end);
@@ -786,7 +791,7 @@ void XMLDateTime::parseDuration()
     }
 
     end = indexOf(fStart, endDate, DURATION_M);
-    if ( end != NOT_FOUND ) 
+    if ( end != NOT_FOUND )
     {
         //scan month
         fValue[Month] = negate * parseInt(fStart, end);
@@ -795,7 +800,7 @@ void XMLDateTime::parseDuration()
     }
 
     end = indexOf(fStart, endDate, DURATION_D);
-    if ( end != NOT_FOUND ) 
+    if ( end != NOT_FOUND )
     {
         //scan day
         fValue[Day] = negate * parseInt(fStart,end);
@@ -814,11 +819,11 @@ void XMLDateTime::parseDuration()
     if ( fEnd != endDate ) // 'T' present
     {
         //scan hours, minutes, seconds
-        //         
+        //
 
         // skip 'T' first
         end = indexOf(++fStart, fEnd, DURATION_H);
-        if ( end != NOT_FOUND ) 
+        if ( end != NOT_FOUND )
         {
             //scan hours
             fValue[Hour] = negate * parseInt(fStart, end);
@@ -827,7 +832,7 @@ void XMLDateTime::parseDuration()
         }
 
         end = indexOf(fStart, fEnd, DURATION_M);
-        if ( end != NOT_FOUND ) 
+        if ( end != NOT_FOUND )
         {
             //scan min
             fValue[Minute] = negate * parseInt(fStart, end);
@@ -836,28 +841,28 @@ void XMLDateTime::parseDuration()
         }
 
         end = indexOf(fStart, fEnd, DURATION_S);
-        if ( end != NOT_FOUND ) 
+        if ( end != NOT_FOUND )
         {
             //scan seconds
             int mlsec = indexOf (fStart, end, MILISECOND_SEPARATOR);
-            if ( mlsec != NOT_FOUND ) 
+            if ( mlsec != NOT_FOUND )
             {
                 fValue[Second]     = negate * parseInt(fStart, mlsec);
                 fValue[MiliSecond] = negate * parseInt(mlsec+1, end);
             }
-            else 
+            else
             {
                 fValue[Second] = negate * parseInt(fStart,end);
             }
-   
+
             fStart = end+1;
             designator = true;
         }
 
         // no additional data should appear after last item
         // P1Y1M1DT is illigal value as well
-        if ( (fStart != fEnd) || 
-              fBuffer[--fStart] == DATETIME_SEPARATOR ) 
+        if ( (fStart != fEnd) ||
+              fBuffer[--fStart] == DATETIME_SEPARATOR )
         {
             ThrowXML1(SchemaDateTimeException
                     , XMLExcepts::DateTime_dur_NoTimeAfterT
@@ -865,7 +870,7 @@ void XMLDateTime::parseDuration()
         }
     }
 
-    if ( !designator ) 
+    if ( !designator )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_dur_NoElementAtAll
@@ -895,10 +900,10 @@ void XMLDateTime::getDate()
                 , XMLExcepts::DateTime_date_incomplete
                 , fBuffer);
 
-    getYearMonth();    // Scan YearMonth and 
-                       // fStart point to the next '-' 
+    getYearMonth();    // Scan YearMonth and
+                       // fStart point to the next '-'
 
-    if (fBuffer[fStart++] != DATE_SEPARATOR) 
+    if (fBuffer[fStart++] != DATE_SEPARATOR)
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_date_invalid
@@ -945,7 +950,7 @@ void XMLDateTime::getTime()
     // get hours, minute and second
     //
     fValue[Hour]   = parseInt(fStart + 0, fStart + 2);
-    fValue[Minute] = parseInt(fStart + 3, fStart + 5);            
+    fValue[Minute] = parseInt(fStart + 3, fStart + 5);
     fValue[Second] = parseInt(fStart + 6, fStart + 8);
     fStart += 8;
 
@@ -956,7 +961,7 @@ void XMLDateTime::getTime()
     //find UTC sign if any
     int sign = findUTCSign(fStart);
 
-    //parse miliseconds 
+    //parse miliseconds
     int milisec = (fBuffer[fStart] == MILISECOND_SEPARATOR)? fStart : NOT_FOUND;
     if ( milisec != NOT_FOUND )
     {
@@ -970,18 +975,18 @@ void XMLDateTime::getTime()
             //("ms shall be present once '.' is present" );
         }
 
-        if ( sign == NOT_FOUND ) 
+        if ( sign == NOT_FOUND )
         {
             fValue[MiliSecond] = parseInt(fStart, fEnd);  //get ms between '.' and fEnd
             fStart = fEnd;
         }
-        else 
+        else
         {
             fValue[MiliSecond] = parseInt(fStart, sign);  //get ms between UTC sign and fEnd
         }
 	}
 
-    //parse UTC time zone (hh:mm)        
+    //parse UTC time zone (hh:mm)
     if ( sign > 0 ) {
         getTimeZone(sign);
     }
@@ -1011,7 +1016,7 @@ void XMLDateTime::getYearMonth()
     // search for year separator '-'
     //
     int yearSeparator = indexOf(start, fEnd, DATE_SEPARATOR);
-    if ( yearSeparator == NOT_FOUND) 
+    if ( yearSeparator == NOT_FOUND)
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_ym_invalid
                 , fBuffer);
@@ -1037,17 +1042,17 @@ void XMLDateTime::getYearMonth()
 
 void XMLDateTime::parseTimeZone()
 {
-    if ( fStart < fEnd ) 
+    if ( fStart < fEnd )
     {
         int sign = findUTCSign(fStart);
-        if ( sign < 0 ) 
+        if ( sign < 0 )
         {
             ThrowXML1(SchemaDateTimeException
                     , XMLExcepts::DateTime_tz_noUTCsign
                     , fBuffer);
             //("Error in month parsing");
         }
-        else 
+        else
         {
             getTimeZone(sign);
         }
@@ -1106,12 +1111,12 @@ void XMLDateTime::getTimeZone(const int sign)
 
 /**
  * If timezone present - normalize dateTime  [E Adding durations to dateTimes]
- * 
+ *
  * @param date   CCYY-MM-DDThh:mm:ss+03
  * @return CCYY-MM-DDThh:mm:ssZ
  */
 void XMLDateTime::normalize()
-{  
+{
 
     if ((fValue[utc] == UTC_UNKNOWN) ||
         (fValue[utc] == UTC_STD)      )
@@ -1123,7 +1128,7 @@ void XMLDateTime::normalize()
     int temp = fValue[Minute] + negate * fTimeZone[mm];
     int carry = fQuotient(temp, 60);
     fValue[Minute] = mod(temp, 60, carry);
-       
+
     //add hours
     temp = fValue[Hour] + negate * fTimeZone[hh] + carry;
     carry = fQuotient(temp, 24);
@@ -1134,17 +1139,17 @@ void XMLDateTime::normalize()
     while (1)
     {
         temp = maxDayInMonthFor(fValue[CentYear], fValue[Month]);
-        if (fValue[Day] < 1) 
+        if (fValue[Day] < 1)
         {
             fValue[Day] += maxDayInMonthFor(fValue[CentYear], fValue[Month] - 1);
             carry = -1;
         }
-        else if ( fValue[Day] > temp ) 
+        else if ( fValue[Day] > temp )
         {
             fValue[Day] -= temp;
             carry = 1;
         }
-        else 
+        else
         {
             break;
         }
@@ -1164,8 +1169,8 @@ void XMLDateTime::validateDateTime() const
 {
 
     //REVISIT: should we throw an exception for not valid dates
-    //          or reporting an error message should be sufficient?  
-    if ( fValue[CentYear] == 0 ) 
+    //          or reporting an error message should be sufficient?
+    if ( fValue[CentYear] == 0 )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_year_zero
@@ -1173,8 +1178,8 @@ void XMLDateTime::validateDateTime() const
         //"The year \"0000\" is an illegal year value");
     }
 
-    if ( fValue[Month] < 1  || 
-         fValue[Month] > 12  ) 
+    if ( fValue[Month] < 1  ||
+         fValue[Month] > 12  )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_mth_invalid
@@ -1184,7 +1189,7 @@ void XMLDateTime::validateDateTime() const
 
     //validate days
     if ( fValue[Day] > maxDayInMonthFor( fValue[CentYear], fValue[Month]) ||
-         fValue[Day] == 0 ) 
+         fValue[Day] == 0 )
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_day_invalid
@@ -1193,11 +1198,11 @@ void XMLDateTime::validateDateTime() const
     }
 
     //validate hours
-    if ((fValue[Hour] < 0)  || 
-        (fValue[Hour] > 23) || 
-        ((fValue[Hour] == 24) && ((fValue[Minute] !=0) || 
+    if ((fValue[Hour] < 0)  ||
+        (fValue[Hour] > 23) ||
+        ((fValue[Hour] == 24) && ((fValue[Minute] !=0) ||
                                   (fValue[Second] !=0) ||
-                                  (fValue[MiliSecond] !=0)))) 
+                                  (fValue[MiliSecond] !=0))))
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_hour_invalid
@@ -1252,8 +1257,8 @@ void XMLDateTime::validateDateTime() const
 // -----------------------------------------------------------------------
 int XMLDateTime::indexOf(const int start, const int end, const XMLCh ch) const
 {
-    for ( int i = start; i < end; i++ ) 
-        if ( fBuffer[i] == ch ) 
+    for ( int i = start; i < end; i++ )
+        if ( fBuffer[i] == ch )
             return i;
 
     return NOT_FOUND;
@@ -1262,7 +1267,7 @@ int XMLDateTime::indexOf(const int start, const int end, const XMLCh ch) const
 int XMLDateTime::findUTCSign (const int start)
 {
     int  pos;
-    for ( int index = start; index < fEnd; index++ ) 
+    for ( int index = start; index < fEnd; index++ )
     {
         pos = XMLString::indexOf(UTC_SET, fBuffer[index]);
         if ( pos != NOT_FOUND)
@@ -1296,7 +1301,7 @@ int XMLDateTime::parseInt(const int start, const int end) const
 
 //
 // [-]CCYY
-// 
+//
 // Note: start from fStart
 //       end (exclusive)
 //       fStart NOT updated
@@ -1307,20 +1312,20 @@ int XMLDateTime::parseIntYear(const int end) const
     int start = ( fBuffer[0] == chDash ) ? fStart + 1 : fStart;
 
     int length = end - start;
-    if (length < 4) 
+    if (length < 4)
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_year_tooShort
                 , fBuffer);
         //"Year must have 'CCYY' format");
     }
-    else if (length > 4 && 
+    else if (length > 4 &&
              fBuffer[start] == chDigit_0)
     {
         ThrowXML1(SchemaDateTimeException
                 , XMLExcepts::DateTime_year_leadingZero
                 , fBuffer);
-        //"Leading zeros are required if the year value would otherwise have fewer than four digits; 
+        //"Leading zeros are required if the year value would otherwise have fewer than four digits;
         // otherwise they are forbidden");
     }
 
@@ -1329,4 +1334,4 @@ int XMLDateTime::parseIntYear(const int end) const
     return ( negative ? (-1) * yearVal : yearVal );
 }
 
-
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLDateTime.hpp b/src/xercesc/util/XMLDateTime.hpp
index 361c40350..e4df55e07 100644
--- a/src/xercesc/util/XMLDateTime.hpp
+++ b/src/xercesc/util/XMLDateTime.hpp
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:14  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz
+ * sane_include
  *
  * Revision 1.4  2001/11/22 20:23:00  peiyongz
  * _declspec(dllimport) and inline warning C4273
@@ -83,12 +86,14 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/SchemaDateTimeException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLDateTime : public XMLNumber
 {
 public:
 
     // to be moved to XMLNumber
-    enum 
+    enum
     {
         LESS_THAN     = -1,
         EQUAL         = 0,
@@ -106,10 +111,10 @@ public:
         Second     ,
         MiliSecond ,
         utc        ,
-        TOTAL_SIZE   
+        TOTAL_SIZE
     };
 
-    enum utcType 
+    enum utcType
     {
         UTC_UNKNOWN = 0,
         UTC_STD        ,          // set in parse() or normalize()
@@ -135,7 +140,7 @@ public:
 
     XMLDateTime(const XMLDateTime&);
 
-    XMLDateTime&          operator=(const XMLDateTime&);   
+    XMLDateTime&          operator=(const XMLDateTime&);
 
     // -----------------------------------------------------------------------
     // Implementation of Abstract Interface
@@ -168,12 +173,12 @@ public:
     void                  parseDuration();       //duration
 
     // -----------------------------------------------------------------------
-    // Comparison 
+    // Comparison
     // -----------------------------------------------------------------------
-    static int            compare(const XMLDateTime* const 
+    static int            compare(const XMLDateTime* const
                                 , const XMLDateTime* const);
 
-    static int            compare(const XMLDateTime* const 
+    static int            compare(const XMLDateTime* const
                                 , const XMLDateTime* const
                                 , bool                    );
 
@@ -186,7 +191,7 @@ private:
     // Constant data
     // -----------------------------------------------------------------------
 	//
-    enum timezoneIndex 
+    enum timezoneIndex
     {
         hh = 0,
         mm ,
@@ -194,10 +199,10 @@ private:
     };
 
     // -----------------------------------------------------------------------
-    // Comparison 
+    // Comparison
     // -----------------------------------------------------------------------
-    static int            compareResult(short 
-                                      , short 
+    static int            compareResult(short
+                                      , short
                                       , bool);
 
     static void           addDuration(XMLDateTime*             pDuration
@@ -219,7 +224,7 @@ private:
     inline  void          reset();
 
     inline  void          assertBuffer()               const;
-   
+
     inline  void          copy(const XMLDateTime&);
 
     // allow multiple parsing
@@ -228,7 +233,7 @@ private:
     inline  bool          isNormalized()               const;
 
     // -----------------------------------------------------------------------
-    // scaners 
+    // scaners
     // -----------------------------------------------------------------------
 
     void                  getDate();
@@ -287,7 +292,7 @@ private:
     //
     // -----------------------------------------------------------------------
 
-    int          fValue[TOTAL_SIZE];    
+    int          fValue[TOTAL_SIZE];
     int          fTimeZone[TIMEZONE_ARRAYSIZE];
     int          fStart;
     int          fEnd;
@@ -306,7 +311,7 @@ inline void XMLDateTime::setBuffer(const XMLCh* const aString)
 
 inline void XMLDateTime::reset()
 {
-    for ( int i=0; i < TOTAL_SIZE; i++ ) 
+    for ( int i=0; i < TOTAL_SIZE; i++ )
         fValue[i] = 0;
 
     fTimeZone[hh] = fTimeZone[mm] = 0;
@@ -322,7 +327,7 @@ inline void XMLDateTime::reset()
 
 inline void XMLDateTime::copy(const XMLDateTime& rhs)
 {
-    for ( int i = 0; i < TOTAL_SIZE; i++ ) 
+    for ( int i = 0; i < TOTAL_SIZE; i++ )
         fValue[i] = rhs.fValue[i];
 
     fTimeZone[hh] = rhs.fTimeZone[hh];
@@ -343,7 +348,7 @@ inline void XMLDateTime::copy(const XMLDateTime& rhs)
 
 inline void XMLDateTime::assertBuffer() const
 {
-    if ( ( !fBuffer )            || 
+    if ( ( !fBuffer )            ||
          ( fBuffer[0] == chNull ) )
     {
         ThrowXML(SchemaDateTimeException
@@ -367,12 +372,14 @@ inline bool XMLDateTime::isNormalized() const
 inline int XMLDateTime::getRetVal(int c1, int c2)
 {
     if ((c1 == LESS_THAN    && c2 == GREATER_THAN) ||
-        (c1 == GREATER_THAN && c2 == LESS_THAN)      ) 
+        (c1 == GREATER_THAN && c2 == LESS_THAN)      )
     {
-        return INDETERMINATE; 
+        return INDETERMINATE;
     }
 
     return ( c1 != INDETERMINATE ) ? c1 : c2;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLDeleterFor.c b/src/xercesc/util/XMLDeleterFor.c
index f05c2d314..a91d23a8a 100644
--- a/src/xercesc/util/XMLDeleterFor.c
+++ b/src/xercesc/util/XMLDeleterFor.c
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:14  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz
+ * sane_include
  *
  * Revision 1.1  2000/03/02 19:54:48  roddey
  * This checkin includes many changes done while waiting for the
@@ -74,6 +77,7 @@
 #include <xercesc/util/XMLDeleterFor.hpp>
 #endif
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLDeleterFor: Constructors and Destructor
@@ -88,3 +92,5 @@ template <class T> XMLDeleterFor<T>::~XMLDeleterFor()
 {
    delete fToDelete;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLDeleterFor.hpp b/src/xercesc/util/XMLDeleterFor.hpp
index 4ac7de7a5..1f6cd9b37 100644
--- a/src/xercesc/util/XMLDeleterFor.hpp
+++ b/src/xercesc/util/XMLDeleterFor.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:14  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:14  peiyongz
+ * sane_include
  *
  * Revision 1.2  2000/03/09 22:38:08  abagchi
  * Changed copy constructor to make it work on SunOS 5.7
@@ -76,8 +79,9 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/PlatformUtils.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
-// 
+//
 //  For internal use only.
 //
 //  This class is used by the platform utilities class to support cleanup
@@ -115,6 +119,7 @@ private :
     T*  fToDelete;
 };
 
+XERCES_CPP_NAMESPACE_END
 
 #if !defined(XERCES_TMPLSINC)
 #include <xercesc/util/XMLDeleterFor.c>
diff --git a/src/xercesc/util/XMLDouble.cpp b/src/xercesc/util/XMLDouble.cpp
index 95ce40cbb..be8fc716b 100644
--- a/src/xercesc/util/XMLDouble.cpp
+++ b/src/xercesc/util/XMLDouble.cpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/09/24 19:51:24  tng
  * Performance: use XMLString::equals instead of XMLString::compareString
  *
@@ -125,6 +128,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/NumberFormatException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //---------
 // TODO:
 //
@@ -322,3 +327,5 @@ void XMLDouble::reinitXMLDouble() {
     maxPositiveValue = 0;
 
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLDouble.hpp b/src/xercesc/util/XMLDouble.hpp
index 287b5d5e8..e9c30628b 100644
--- a/src/xercesc/util/XMLDouble.hpp
+++ b/src/xercesc/util/XMLDouble.hpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/02/20 18:17:02  tng
  * [Bug 5977] Warnings on generating apiDocs.
  *
@@ -100,6 +103,8 @@
 
 #include <xercesc/util/XMLAbstractDoubleFloat.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLDouble : public XMLAbstractDoubleFloat
 {
 public:
@@ -161,5 +166,7 @@ inline int XMLDouble::compareValues(const XMLDouble* const lValue
                                                  (const XMLAbstractDoubleFloat* const) rValue );
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
 
diff --git a/src/xercesc/util/XMLEBCDICTranscoder.cpp b/src/xercesc/util/XMLEBCDICTranscoder.cpp
index 9967bcd17..bbc9aa6b1 100644
--- a/src/xercesc/util/XMLEBCDICTranscoder.cpp
+++ b/src/xercesc/util/XMLEBCDICTranscoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,7 +60,7 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/XMLEBCDICTranscoder.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local const data
@@ -238,3 +238,5 @@ XMLEBCDICTranscoder::XMLEBCDICTranscoder(const  XMLCh* const    encodingName
 XMLEBCDICTranscoder::~XMLEBCDICTranscoder()
 {
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLEBCDICTranscoder.hpp b/src/xercesc/util/XMLEBCDICTranscoder.hpp
index 358dc785c..e6e986be5 100644
--- a/src/xercesc/util/XMLEBCDICTranscoder.hpp
+++ b/src/xercesc/util/XMLEBCDICTranscoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XML256TableTranscoder.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -101,4 +102,6 @@ private :
     void operator=(const XMLEBCDICTranscoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLEnumerator.hpp b/src/xercesc/util/XMLEnumerator.hpp
index 98c047c3e..15d69b098 100644
--- a/src/xercesc/util/XMLEnumerator.hpp
+++ b/src/xercesc/util/XMLEnumerator.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/08/21 17:45:00  tng
  * [Bug 7087] compiler warnings when using gcc.
  *
@@ -87,6 +90,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 template <class TElem> class XMLEnumerator
 {
 public :
@@ -103,4 +108,6 @@ public :
     virtual void Reset() = 0;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLExceptMsgs.hpp b/src/xercesc/util/XMLExceptMsgs.hpp
index 280205ada..75b4d9c0e 100644
--- a/src/xercesc/util/XMLExceptMsgs.hpp
+++ b/src/xercesc/util/XMLExceptMsgs.hpp
@@ -3,6 +3,10 @@
 #if !defined(ERRHEADER_XMLExcepts)
 #define ERRHEADER_XMLExcepts
 
+#include <xercesc/util/XercesDefs.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLExcepts
 {
 public :
@@ -371,5 +375,8 @@ public :
     };
 
 };
+
+XERCES_CPP_NAMESPACE_END
+
 #endif
 
diff --git a/src/xercesc/util/XMLException.cpp b/src/xercesc/util/XMLException.cpp
index f2aa398a9..96a962e51 100644
--- a/src/xercesc/util/XMLException.cpp
+++ b/src/xercesc/util/XMLException.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -71,6 +71,7 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLUni.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local data
@@ -79,7 +80,7 @@
 //      For now, if we cannot load an exception message, we load up the
 //      default.
 // ---------------------------------------------------------------------------
-static const XMLCh  gDefErrMsg[] = 
+static const XMLCh  gDefErrMsg[] =
 {
         chLatin_C, chLatin_o, chLatin_u, chLatin_l, chLatin_d
     ,   chSpace, chLatin_n, chLatin_o, chLatin_t, chSpace
@@ -122,7 +123,7 @@ static XMLMutex& gMsgMutex()
             // This is the real mutex.  Register it for cleanup at Termination.
 			msgMutexCleanup.registerCleanup(XMLException::reinitMsgMutex);
         }
-        
+
     }
 
     return *sMsgMutex;
@@ -150,7 +151,7 @@ static XMLMsgLoader& gGetMsgLoader()
         //
         msgLoaderCleanup.registerCleanup(XMLException::reinitMsgLoader);
     }
-    
+
     // We got it, so return it
     return *sMsgLoader;
 }
@@ -327,3 +328,5 @@ void XMLException::reinitMsgLoader()
 	delete sMsgLoader;
 	sMsgLoader = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLException.hpp b/src/xercesc/util/XMLException.hpp
index d852a4eb7..54ab501f9 100644
--- a/src/xercesc/util/XMLException.hpp
+++ b/src/xercesc/util/XMLException.hpp
@@ -66,6 +66,7 @@
 #include <xercesc/util/XMLUni.hpp>
 #include <xercesc/framework/XMLErrorReporter.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  This is the base class from which all the XML parser exceptions are
@@ -298,4 +299,6 @@ private : \
 
 #define ThrowXML4(type,code,p1,p2,p3,p4) throw type(__FILE__, __LINE__, code, p1, p2, p3, p4)
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLFloat.cpp b/src/xercesc/util/XMLFloat.cpp
index 075db9d0e..84a06de8f 100644
--- a/src/xercesc/util/XMLFloat.cpp
+++ b/src/xercesc/util/XMLFloat.cpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.4  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.3  2002/09/24 19:51:24  tng
  * Performance: use XMLString::equals instead of XMLString::compareString
  *
@@ -117,6 +120,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/NumberFormatException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  local data member
 // ---------------------------------------------------------------------------
@@ -296,3 +301,5 @@ void XMLFloat::reinitXMLFloat() {
     maxPositiveValue = 0;
 
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLFloat.hpp b/src/xercesc/util/XMLFloat.hpp
index 52c7cd62f..97855deae 100644
--- a/src/xercesc/util/XMLFloat.hpp
+++ b/src/xercesc/util/XMLFloat.hpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.3  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.2  2002/02/20 18:17:02  tng
  * [Bug 5977] Warnings on generating apiDocs.
  *
@@ -95,6 +98,8 @@
 
 #include <xercesc/util/XMLAbstractDoubleFloat.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLFloat : public XMLAbstractDoubleFloat
 {
 public:
@@ -155,5 +160,7 @@ inline int XMLFloat::compareValues(const XMLFloat* const lValue
                                                  (const XMLAbstractDoubleFloat* const) rValue );
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
 
diff --git a/src/xercesc/util/XMLIBM1140Transcoder.cpp b/src/xercesc/util/XMLIBM1140Transcoder.cpp
index 561b1862f..c70aa7a8f 100644
--- a/src/xercesc/util/XMLIBM1140Transcoder.cpp
+++ b/src/xercesc/util/XMLIBM1140Transcoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,7 +60,7 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/XMLIBM1140Transcoder.hpp>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local const data
@@ -240,3 +240,4 @@ XMLIBM1140Transcoder::~XMLIBM1140Transcoder()
 {
 }
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLIBM1140Transcoder.hpp b/src/xercesc/util/XMLIBM1140Transcoder.hpp
index 037d00bf4..3c97a0841 100644
--- a/src/xercesc/util/XMLIBM1140Transcoder.hpp
+++ b/src/xercesc/util/XMLIBM1140Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
- * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights 
+ *
+ * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XML256TableTranscoder.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -99,4 +100,6 @@ private :
     void operator=(const XMLIBM1140Transcoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLInteger.hpp b/src/xercesc/util/XMLInteger.hpp
index d8d1fd922..76e25677e 100644
--- a/src/xercesc/util/XMLInteger.hpp
+++ b/src/xercesc/util/XMLInteger.hpp
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:15  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
+ * sane_include
  *
  * Revision 1.1  2001/08/16 21:53:52  peiyongz
  * new class creation
@@ -68,14 +71,18 @@
 #ifndef XML_INTEGER_HPP
 #define XML_INTEGER_HPP
 
+#include <xercesc/util/XercesDefs.hpp>
+
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLInteger
 {
 public:
 
 	/**
-	 * Constructs a newly allocated <code>XMLInteger</code> object 
+	 * Constructs a newly allocated <code>XMLInteger</code> object
      *
-	 * @param      intVal   the <code>integer</code> 
+	 * @param      intVal   the <code>integer</code>
 	 */
 
 	XMLInteger(const int intVal);
@@ -114,4 +121,6 @@ inline int XMLInteger::intValue() const
     return fData;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLMsgLoader.hpp b/src/xercesc/util/XMLMsgLoader.hpp
index caa91a490..7a43d1d37 100644
--- a/src/xercesc/util/XMLMsgLoader.hpp
+++ b/src/xercesc/util/XMLMsgLoader.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:15  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
+ * sane_include
  *
  * Revision 1.5  2000/03/28 19:43:20  roddey
  * Fixes for signed/unsigned warnings. New work for two way transcoding
@@ -88,6 +91,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 //  This header defines an abstract message loading API. This is the API via
 //  which the parser system loads translatable text, and there can be multiple
@@ -233,4 +238,6 @@ inline void XMLMsgLoader::setLanguageName(XMLCh* const nameToAdopt)
     fLanguage = nameToAdopt;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLNetAccessor.hpp b/src/xercesc/util/XMLNetAccessor.hpp
index 7777db59e..de99612c4 100644
--- a/src/xercesc/util/XMLNetAccessor.hpp
+++ b/src/xercesc/util/XMLNetAccessor.hpp
@@ -65,6 +65,7 @@
 #include <xercesc/util/XMLURL.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class BinInputStream;
 
@@ -124,5 +125,6 @@ private :
 
 MakeXMLException(NetAccessorException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
 
 #endif
diff --git a/src/xercesc/util/XMLNumber.cpp b/src/xercesc/util/XMLNumber.cpp
index 0c4342e3b..29a70c8b7 100644
--- a/src/xercesc/util/XMLNumber.cpp
+++ b/src/xercesc/util/XMLNumber.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:15  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
+ * sane_include
  *
  * Revision 1.2  2001/10/09 21:28:28  peiyongz
  * explicit ctor/dtor defined.
@@ -73,6 +76,7 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/XMLNumber.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 XMLNumber::XMLNumber()
 {}
@@ -80,3 +84,4 @@ XMLNumber::XMLNumber()
 XMLNumber::~XMLNumber()
 {}
 
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLNumber.hpp b/src/xercesc/util/XMLNumber.hpp
index f3f963688..310ce4518 100644
--- a/src/xercesc/util/XMLNumber.hpp
+++ b/src/xercesc/util/XMLNumber.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:15  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
+ * sane_include
  *
  * Revision 1.2  2001/10/09 21:28:28  peiyongz
  * explicit ctor/dtor defined.
@@ -73,6 +76,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLUTIL_EXPORT XMLNumber
 {
 public:
@@ -81,12 +86,12 @@ public:
 
 	/**
 	 *  Return string representation of the decimal value.
-     *  A decimal point will be included as necessary, 
-     *  the caller of this method is responsible for the 
+     *  A decimal point will be included as necessary,
+     *  the caller of this method is responsible for the
      *  de-allocation of the memory.
 	 */
     virtual XMLCh*     toString() const = 0;
-        
+
 	/**
 	 * Returns the sign of this number
      *
@@ -103,4 +108,6 @@ protected:
 
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLRegisterCleanup.hpp b/src/xercesc/util/XMLRegisterCleanup.hpp
index b4cad91e7..e4f916030 100644
--- a/src/xercesc/util/XMLRegisterCleanup.hpp
+++ b/src/xercesc/util/XMLRegisterCleanup.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -57,8 +57,11 @@
 /*
  * $Id$
  * $Log$
- * Revision 1.1  2002/02/01 22:22:15  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:15  peiyongz
+ * sane_include
  *
  * Revision 1.4  2001/10/25 21:55:29  peiyongz
  * copy ctor explicity declared private to prevent supprise.
@@ -74,6 +77,8 @@
 
 #include <xercesc/util/Mutexes.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // This is a mutex for exclusive use by this class
 extern XMLMutex* gXMLCleanupListMutex;
 
@@ -83,11 +88,11 @@ extern XMLMutex* gXMLCleanupListMutex;
 class XMLRegisterCleanup;
 extern XMLRegisterCleanup* gXMLCleanupList;
 
-// 
+//
 //  For internal use only.
 //
-//  This class is used by the platform utilities class to support 
-//  reinitialisation of global/static data which is lazily created. 
+//  This class is used by the platform utilities class to support
+//  reinitialisation of global/static data which is lazily created.
 //  Since that data is widely spread out the platform utilities
 //  class cannot know about them directly. So, the code that creates such
 //  objects creates an registers a cleanup for the object. The platform
@@ -105,7 +110,7 @@ public :
 	void doCleanup() {
 		// When performing cleanup, we only do this once, but we can
 		// cope if somehow we have been called twice.
-		if (m_cleanupFn) 
+		if (m_cleanupFn)
             m_cleanupFn();
 
         // We need to remove "this" from the list
@@ -121,7 +126,7 @@ public :
 		// Store the cleanup function
 		m_cleanupFn = cleanupFn;
 		
-		// Add this object to the list head, if it is not already 
+		// Add this object to the list head, if it is not already
 		// present - which it shouldn't be.
 		// This is done under a mutex to ensure thread safety.
 		gXMLCleanupListMutex->lock();
@@ -129,7 +134,7 @@ public :
 			m_nextCleanup = gXMLCleanupList;
 			gXMLCleanupList = this;
 
-			if (m_nextCleanup) 
+			if (m_nextCleanup)
 				m_nextCleanup->m_prevCleanup = this;
 		}
 		gXMLCleanupListMutex->unlock();
@@ -146,9 +151,9 @@ public :
         // To protect against some compiler's (eg hp11) optimization
         // to change "this" as they update gXMLCleanupList
         //
-        // refer to 
+        // refer to
         // void XMLPlatformUtils::Terminate()
-        //       ... 
+        //       ...
         //       while (gXMLCleanupList)
 		//            gXMLCleanupList->doCleanup();
         //
@@ -196,4 +201,6 @@ private:
 	}
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLString.cpp b/src/xercesc/util/XMLString.cpp
index 83b9b29f9..cc87784ce 100644
--- a/src/xercesc/util/XMLString.cpp
+++ b/src/xercesc/util/XMLString.cpp
@@ -80,6 +80,7 @@
 #include <xercesc/util/XMLUni.hpp>
 #include <xercesc/internal/XMLReader.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  Local static data
@@ -1819,3 +1820,5 @@ void XMLString::termString()
     delete gTranscoder;
     gTranscoder = 0;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLString.hpp b/src/xercesc/util/XMLString.hpp
index f2d6e8e56..32e4da3a7 100644
--- a/src/xercesc/util/XMLString.hpp
+++ b/src/xercesc/util/XMLString.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.7  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.6  2002/10/01 19:45:22  tng
  * Performance in XMLString::equals, only need to check one string for null as they are equal already.
  *
@@ -205,6 +208,8 @@
 #include <xercesc/util/RefVectorOf.hpp>
 #include <xercesc/framework/XMLBuffer.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class XMLLCPTranscoder;
 
 /**
@@ -1481,5 +1486,6 @@ inline bool XMLString::equals(   const   XMLCh* const    str1
     return false;
 }
 
+XERCES_CPP_NAMESPACE_END
 
 #endif
diff --git a/src/xercesc/util/XMLStringTokenizer.cpp b/src/xercesc/util/XMLStringTokenizer.cpp
index 30d0b7ccb..cd4492c3b 100644
--- a/src/xercesc/util/XMLStringTokenizer.cpp
+++ b/src/xercesc/util/XMLStringTokenizer.cpp
@@ -56,8 +56,11 @@
 
 /*
  * $Log$
- * Revision 1.1  2002/02/01 22:22:16  peiyongz
- * Initial revision
+ * Revision 1.2  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
+ * Revision 1.1.1.1  2002/02/01 22:22:16  peiyongz
+ * sane_include
  *
  * Revision 1.1  2001/06/11 15:15:46  knoaman
  * StringTokenizer renamed to XMLStringTokenizer.
@@ -70,6 +73,7 @@
 #include <xercesc/util/XMLStringTokenizer.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLStringTokenizer: Local const data
@@ -179,6 +183,7 @@ bool XMLStringTokenizer::hasMoreTokens() {
 	return false;
 }
 
+XERCES_CPP_NAMESPACE_END
 
 /**
   * End of file XMLStringTokenizer.cpp
diff --git a/src/xercesc/util/XMLStringTokenizer.hpp b/src/xercesc/util/XMLStringTokenizer.hpp
index f8b15c511..ab764c9b3 100644
--- a/src/xercesc/util/XMLStringTokenizer.hpp
+++ b/src/xercesc/util/XMLStringTokenizer.hpp
@@ -64,6 +64,8 @@
 #include <xercesc/util/RefVectorOf.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /**
   * The string tokenizer class breaks a string into tokens.
   *
@@ -242,6 +244,8 @@ inline int XMLStringTokenizer::countTokens() {
     return tokCount;
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
 
 /**
diff --git a/src/xercesc/util/XMLUCS4Transcoder.hpp b/src/xercesc/util/XMLUCS4Transcoder.hpp
index 40ad1cf7d..1d547129e 100644
--- a/src/xercesc/util/XMLUCS4Transcoder.hpp
+++ b/src/xercesc/util/XMLUCS4Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,7 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -132,4 +133,6 @@ private :
     bool    fSwapped;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLUCSTranscoder.cpp b/src/xercesc/util/XMLUCSTranscoder.cpp
index 77ef96e42..366b4662e 100644
--- a/src/xercesc/util/XMLUCSTranscoder.cpp
+++ b/src/xercesc/util/XMLUCSTranscoder.cpp
@@ -63,7 +63,7 @@
 #include <xercesc/util/TranscodingException.hpp>
 #include <string.h>
 
-
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLUCS4Transcoder: Constructors and Destructor
@@ -283,3 +283,5 @@ bool XMLUCS4Transcoder::canTranscodeTo(const unsigned int toCheck) const
     // We can handle anything
     return true;
 }
+
+XERCES_CPP_NAMESPACE_END
diff --git a/src/xercesc/util/XMLURL.cpp b/src/xercesc/util/XMLURL.cpp
index ebc50115a..39bb8fe22 100644
--- a/src/xercesc/util/XMLURL.cpp
+++ b/src/xercesc/util/XMLURL.cpp
@@ -73,6 +73,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLUni.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 
 // ---------------------------------------------------------------------------
@@ -1208,3 +1210,6 @@ void XMLURL::weavePaths(const XMLCh* const basePart)
     janBuf.orphan();
     fPath = tmpBuf;
 }
+
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLURL.hpp b/src/xercesc/util/XMLURL.hpp
index 161455b42..13349b648 100644
--- a/src/xercesc/util/XMLURL.hpp
+++ b/src/xercesc/util/XMLURL.hpp
@@ -64,6 +64,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XMLException.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 class BinInputStream;
 
 //
@@ -304,5 +306,7 @@ inline const XMLCh* XMLURL::getURLText() const
 
 MakeXMLException(MalformedURLException, XMLUTIL_EXPORT)
 
+XERCES_CPP_NAMESPACE_END
+
 
 #endif
diff --git a/src/xercesc/util/XMLUTF16Transcoder.cpp b/src/xercesc/util/XMLUTF16Transcoder.cpp
index 2a2169133..f1f24c7af 100644
--- a/src/xercesc/util/XMLUTF16Transcoder.cpp
+++ b/src/xercesc/util/XMLUTF16Transcoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -63,6 +63,8 @@
 #include <xercesc/util/TranscodingException.hpp>
 #include <string.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 
 // ---------------------------------------------------------------------------
@@ -238,3 +240,6 @@ bool XMLUTF16Transcoder::canTranscodeTo(const unsigned int toCheck) const
     // We can handle anything
     return true;
 }
+
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLUTF16Transcoder.hpp b/src/xercesc/util/XMLUTF16Transcoder.hpp
index d7aaf8b7e..57d09b03f 100644
--- a/src/xercesc/util/XMLUTF16Transcoder.hpp
+++ b/src/xercesc/util/XMLUTF16Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -132,4 +134,6 @@ private :
     bool    fSwapped;
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLUTF8Transcoder.cpp b/src/xercesc/util/XMLUTF8Transcoder.cpp
index f0dc15a97..3d921b72b 100644
--- a/src/xercesc/util/XMLUTF8Transcoder.cpp
+++ b/src/xercesc/util/XMLUTF8Transcoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -68,6 +68,8 @@
 #include <xercesc/util/UTFDataFormatException.hpp>
 
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  Local static data
 //
@@ -159,8 +161,8 @@ XMLUTF8Transcoder::transcodeFrom(const  XMLByte* const          srcData
     XMLCh*          outEnd = outPtr + maxChars;
     unsigned char*  sizePtr = charSizes;
 
- 
-    
+
+
     //
     //  We now loop until we either run out of input data, or room to store
     //  output chars.
@@ -402,3 +404,6 @@ bool XMLUTF8Transcoder::canTranscodeTo(const unsigned int toCheck) const
     // We can represent anything in the Unicode (with surrogates) range
     return (toCheck <= 0x10FFFF);
 }
+
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLUTF8Transcoder.hpp b/src/xercesc/util/XMLUTF8Transcoder.hpp
index 6dee037b1..a68d4b8cf 100644
--- a/src/xercesc/util/XMLUTF8Transcoder.hpp
+++ b/src/xercesc/util/XMLUTF8Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/TransService.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 //
 //  This class provides an implementation of the XMLTranscoder interface
 //  for a simple UTF8 transcoder. The parser does some encodings
@@ -120,4 +122,6 @@ private :
     void operator=(const XMLUTF8Transcoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLUni.cpp b/src/xercesc/util/XMLUni.cpp
index 5834e8bbc..d148af072 100644
--- a/src/xercesc/util/XMLUni.cpp
+++ b/src/xercesc/util/XMLUni.cpp
@@ -66,6 +66,7 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLUni.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 // ---------------------------------------------------------------------------
 //  XMLUni: Static data
@@ -1197,3 +1198,6 @@ const XMLCh XMLUni::fgDOMWRTWhitespaceInElementContent[] =
 	chLatin_e, chLatin_n, chLatin_t, chDash,    chLatin_c, chLatin_o,
 	chLatin_n, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
 };
+
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLUni.hpp b/src/xercesc/util/XMLUni.hpp
index ccbb7792f..97595b481 100644
--- a/src/xercesc/util/XMLUni.hpp
+++ b/src/xercesc/util/XMLUni.hpp
@@ -72,6 +72,7 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
 
 class XMLUTIL_EXPORT XMLUni
 {
@@ -266,4 +267,6 @@ public :
 
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLUniDefs.hpp b/src/xercesc/util/XMLUniDefs.hpp
index 6da58dfb6..c8e9a4588 100644
--- a/src/xercesc/util/XMLUniDefs.hpp
+++ b/src/xercesc/util/XMLUniDefs.hpp
@@ -62,6 +62,8 @@
 
 #include <xercesc/util/XercesDefs.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  Constants for the Unicode characters of interest to us in an XML parser
 //  We don't put these inside the class because then they could not be const
@@ -185,4 +187,6 @@ const XMLCh chWonSign               = 0x20A9;
 const XMLCh chLineSeparator         = 0x2028;
 const XMLCh chParagraphSeparator    = 0x2029;
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLUri.cpp b/src/xercesc/util/XMLUri.cpp
index 5bb147b43..ec71810c1 100644
--- a/src/xercesc/util/XMLUri.cpp
+++ b/src/xercesc/util/XMLUri.cpp
@@ -69,6 +69,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLUni.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 // ---------------------------------------------------------------------------
 //  XMLUri: static data
 // ---------------------------------------------------------------------------
@@ -1441,3 +1443,5 @@ void XMLUri::buildFullText()
     *outPtr = 0;
 }
 
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLUri.hpp b/src/xercesc/util/XMLUri.hpp
index 917d8d507..acf64547b 100644
--- a/src/xercesc/util/XMLUri.hpp
+++ b/src/xercesc/util/XMLUri.hpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.5  2002/11/04 15:22:05  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.4  2002/09/23 18:41:00  tng
  * DOM L3: Support baseURI.   Add fURIText to XMLUri.   Added by Gareth Reakes and Thomas Ford.
  *
@@ -89,6 +92,8 @@
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLString.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 /*
  * This class is a direct port of Java's URI class, to distinguish
  * itself from the XMLURL, we use the name XMLUri instead of
@@ -531,4 +536,6 @@ inline bool XMLUri::isUnreservedCharacter(const XMLCh theChar)
             XMLString::indexOf(MARK_CHARACTERS, theChar) != -1);
 }
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/src/xercesc/util/XMLWin1252Transcoder.cpp b/src/xercesc/util/XMLWin1252Transcoder.cpp
index 1924bcb7e..17ae5d5db 100644
--- a/src/xercesc/util/XMLWin1252Transcoder.cpp
+++ b/src/xercesc/util/XMLWin1252Transcoder.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,8 @@
 // ---------------------------------------------------------------------------
 #include <xercesc/util/XMLWin1252Transcoder.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 // ---------------------------------------------------------------------------
 //  Local const data
@@ -228,3 +230,5 @@ XMLWin1252Transcoder::~XMLWin1252Transcoder()
 {
 }
 
+XERCES_CPP_NAMESPACE_END
+
diff --git a/src/xercesc/util/XMLWin1252Transcoder.hpp b/src/xercesc/util/XMLWin1252Transcoder.hpp
index 3958f01c0..98796488a 100644
--- a/src/xercesc/util/XMLWin1252Transcoder.hpp
+++ b/src/xercesc/util/XMLWin1252Transcoder.hpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -60,6 +60,8 @@
 #include <xercesc/util/XercesDefs.hpp>
 #include <xercesc/util/XML256TableTranscoder.hpp>
 
+XERCES_CPP_NAMESPACE_BEGIN
+
 
 //
 //  This class provides an implementation of the XMLTranscoder interface
@@ -90,4 +92,6 @@ private :
     void operator=(const XMLWin1252Transcoder&);
 };
 
+XERCES_CPP_NAMESPACE_END
+
 #endif
diff --git a/tests/DOM/DOMTest/DTest.h b/tests/DOM/DOMTest/DTest.h
index 58a73fcda..8d1493fcf 100644
--- a/tests/DOM/DOMTest/DTest.h
+++ b/tests/DOM/DOMTest/DTest.h
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.10  2002/11/04 15:23:43  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.9  2002/09/23 20:09:23  tng
  * DOM L3: Test baseURI with different parser's setting.
  *
@@ -92,7 +95,9 @@
 //  define null for compatibility with original Java source code.
 #define null 0
 
+XERCES_CPP_NAMESPACE_BEGIN
 class XercesDOMParser;
+XERCES_CPP_NAMESPACE_END
 
 class DOMTest {
 public:
diff --git a/tests/DOM/DeprecatedDOMCount/DeprecatedDOMCount.hpp b/tests/DOM/DeprecatedDOMCount/DeprecatedDOMCount.hpp
index e08875c51..108198f46 100644
--- a/tests/DOM/DeprecatedDOMCount/DeprecatedDOMCount.hpp
+++ b/tests/DOM/DeprecatedDOMCount/DeprecatedDOMCount.hpp
@@ -64,7 +64,9 @@
 #include <xercesc/sax/ErrorHandler.hpp>
 #include <iostream.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
 class SAXParseException;
+XERCES_CPP_NAMESPACE_END
 
 
 // ---------------------------------------------------------------------------
diff --git a/tests/InitTermTest/InitTermTest.hpp b/tests/InitTermTest/InitTermTest.hpp
index aa8bd6617..f1b50c241 100644
--- a/tests/InitTermTest/InitTermTest.hpp
+++ b/tests/InitTermTest/InitTermTest.hpp
@@ -64,7 +64,9 @@
 #include <xercesc/sax/ErrorHandler.hpp>
 #include <iostream.h>
 
+XERCES_CPP_NAMESPACE_BEGIN
 class SAXParseException;
+XERCES_CPP_NAMESPACE_END
 
 
 // ---------------------------------------------------------------------------
diff --git a/tests/ThreadTest/ThreadTest.cpp b/tests/ThreadTest/ThreadTest.cpp
index 27599e5d7..f01335722 100644
--- a/tests/ThreadTest/ThreadTest.cpp
+++ b/tests/ThreadTest/ThreadTest.cpp
@@ -288,7 +288,7 @@ private:
     int           fCheckSum;
     SAXParser*    fSAXParser;
     XercesDOMParser*    fXercesDOMParser;
-    DOMDocument * fDoc;
+    XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * fDoc;
 
 
 public:                               //  This is the API used by the rest of the test program
diff --git a/tools/IANACharset/IANACharset.cpp b/tools/IANACharset/IANACharset.cpp
index f520b16a9..7948029d8 100644
--- a/tools/IANACharset/IANACharset.cpp
+++ b/tools/IANACharset/IANACharset.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 2002 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -57,6 +57,9 @@
 
 /*
  * $Log$
+ * Revision 1.2  2002/11/04 15:24:50  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.1  2002/07/18 20:15:32  knoaman
  * Initial checkin: feature to control strict IANA encoding name.
  *
@@ -210,6 +213,10 @@ static void startOutput(const XMLCh* const outPath)
           L"//  This file was generated from the IANA charset source.\n"
           L"//  so do not edit this file directly!!\n"
           L"// ----------------------------------------------------------------\n\n"
+          L"#if !defined(IANAENCODINGS_HPP)\n"
+          L"#define IANAENCODINGS_HPP\n\n"
+          L"#include <xercesc/util/XercesDefs.hpp>\n\n"
+          L"XERCES_CPP_NAMESPACE_BEGIN\n\n"
     );
 
     //
@@ -252,6 +259,13 @@ static void endOutput(const unsigned int encCount)
     // Output the const size value
     fwprintf(gOutFile, L"const unsigned int gEncodingArraySize = %d;\n\n", encCount);
 
+    fwprintf
+    (
+        gOutFile
+        , L"XERCES_CPP_NAMESPACE_END\n\n"
+          L"#endif\n\n"
+    );
+
     // Close the output file
     fclose(gOutFile);
 }
diff --git a/tools/NLS/Xlat/Xlat.cpp b/tools/NLS/Xlat/Xlat.cpp
index 7b1b8020c..b7bc990a1 100644
--- a/tools/NLS/Xlat/Xlat.cpp
+++ b/tools/NLS/Xlat/Xlat.cpp
@@ -57,6 +57,9 @@
 
 /*
  * $Log$
+ * Revision 1.14  2002/11/04 15:24:50  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.13  2002/09/30 22:09:58  peiyongz
  * To generate icu resource file (in text) for error message.
  *
@@ -405,7 +408,7 @@ extern "C" int wmain(int argC, XMLCh** argV)
 
     {
         //  Nest entire code in an inner block.
-        
+
         DOMDocument* srcDoc;
         const unsigned int bufSize = 4095;
         XMLCh tmpFileBuf[bufSize + 1];
@@ -459,7 +462,7 @@ extern "C" int wmain(int argC, XMLCh** argV)
                 case OutFormat_MsgCatalog :
                     formatter = new MsgCatFormatter;
                     break;
-                
+
                 case OutFormat_ResBundle:
                     formatter = new ICUResBundFormatter;
                     break;
@@ -579,8 +582,13 @@ extern "C" int wmain(int argC, XMLCh** argV)
 
                 // If its not the exception domain, then we need a header included
                 if (XMLString::compareString(domainStr, XMLUni::fgExceptDomain))
-                    fwprintf(outHeader, L"#include <xercesc/framework/XMLErrorReporter.hpp>\n\n");
+                    fwprintf(outHeader, L"#include <xercesc/framework/XMLErrorReporter.hpp>\n");
 
+                //  Write out the namespace declaration
+                fwprintf(outHeader, L"#include <xercesc/util/XercesDefs.hpp>\n\n");
+                fwprintf(outHeader, L"XERCES_CPP_NAMESPACE_BEGIN\n\n");
+
+                //  Now the message codes
                 fwprintf(outHeader, L"class %s\n{\npublic :\n    enum Codes\n    {\n", errNameSpace);
 
                 // Tell the formatter that a new domain is starting
@@ -747,8 +755,11 @@ extern "C" int wmain(int argC, XMLCh** argV)
                     );
                 }
 
-                // And close out the class declaration and the header file
-                fwprintf(outHeader, L"};\n#endif\n\n");
+
+                // And close out the class declaration, the namespace declaration and the header file
+                fwprintf(outHeader, L"};\n\n");
+                fwprintf(outHeader, L"XERCES_CPP_NAMESPACE_END\n\n");
+                fwprintf(outHeader, L"#endif\n\n");
                 fclose(outHeader);
             }
 
diff --git a/tools/NLS/Xlat/Xlat_CppSrc.cpp b/tools/NLS/Xlat/Xlat_CppSrc.cpp
index 4b72a70c2..fc1a44052 100644
--- a/tools/NLS/Xlat/Xlat_CppSrc.cpp
+++ b/tools/NLS/Xlat/Xlat_CppSrc.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2002/11/04 15:24:50  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2002/07/31 18:39:53  tng
  * [Bug 3788] very long lines in CppErrMsgs_EN_US.hpp causes problems for OS390 compiler.
  *
@@ -127,6 +130,11 @@ void CppSrcFormatter::endMsgType(const MsgTypes type)
 
 void CppSrcFormatter::endOutput()
 {
+    fwprintf
+    (
+        fOutFl,
+          L"XERCES_CPP_NAMESPACE_END\n\n"
+    );
     // Close the output file
     fclose(fOutFl);
 }
@@ -261,5 +269,7 @@ void CppSrcFormatter::startOutput(  const   XMLCh* const    locale
           L"//  This file was generated from the XML error message source.\n"
           L"//  so do not edit this file directly!!\n"
           L"// ----------------------------------------------------------------\n\n"
+          L"#include <xercesc/util/XercesDefs.hpp>\n\n"
+          L"XERCES_CPP_NAMESPACE_BEGIN\n\n"
     );
 }
diff --git a/tools/NLS/Xlat/Xlat_MsgCatalog.cpp b/tools/NLS/Xlat/Xlat_MsgCatalog.cpp
index 9c8cfaa3b..1a33b075d 100644
--- a/tools/NLS/Xlat/Xlat_MsgCatalog.cpp
+++ b/tools/NLS/Xlat/Xlat_MsgCatalog.cpp
@@ -1,37 +1,37 @@
 /*
  * The Apache Software License, Version 1.1
- * 
+ *
  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  * reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- * 
+ *    notice, this list of conditions and the following disclaimer.
+ *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:  
+ *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "Xerces" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written 
+ *    software without prior written permission. For written
  *    permission, please contact apache\@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation, and was
  * originally based on software copyright (c) 1999, International
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2002/11/04 15:24:50  tng
+ * C++ Namespace Support.
+ *
  * Revision 1.5  2000/03/02 19:55:53  roddey
  * This checkin includes many changes done while waiting for the
  * 1.1.0 code to be finished. I can't list them all here, but a list is
@@ -133,6 +136,12 @@ void MsgCatFormatter::endMsgType(const MsgTypes type)
 
 void MsgCatFormatter::endOutput()
 {
+    fwprintf
+    (
+        fOutHpp
+        , L"\nXERCES_CPP_NAMESPACE_END\n\n"
+    );
+
     // Close the output files
     fclose(fOutFl);
     fclose(fOutHpp);
@@ -213,6 +222,17 @@ void MsgCatFormatter::startOutput(  const   XMLCh* const    locale
         throw ErrReturn_OutFileOpenFailed;
     }
 
+    fwprintf
+    (
+        fOutHpp
+        , L"// ----------------------------------------------------------------\n"
+          L"//  This file was generated from the XML error message source.\n"
+          L"//  so do not edit this file directly!!\n"
+          L"// ----------------------------------------------------------------\n\n"
+          L"#include <xercesc/util/XercesDefs.hpp>\n\n"
+          L"XERCES_CPP_NAMESPACE_BEGIN\n\n"
+    );
+
     // Reset the sequence id
     fSeqId = 1;
 }
-- 
GitLab