Index: src/xercesc/parsers/SAX2XMLReaderImpl.cpp
===================================================================
--- src/xercesc/parsers/SAX2XMLReaderImpl.cpp	(revision 2469)
+++ src/xercesc/parsers/SAX2XMLReaderImpl.cpp	(working copy)
@@ -39,6 +39,7 @@
 #include <xercesc/framework/XMLSchemaDescription.hpp>
 #include <xercesc/util/OutOfMemoryException.hpp>
 #include <xercesc/util/XMLEntityResolver.hpp>
+#include <xercesc/util/XMLExceptMsgs.hpp>
 #include <string.h>
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -1207,7 +1208,7 @@
 }
 
 
-void SAX2XMLReaderImpl::error(  const   unsigned int
+void SAX2XMLReaderImpl::error(  const   unsigned int        originalExceptCode
                         , const XMLCh* const
                         , const XMLErrorReporter::ErrTypes  errType
                         , const XMLCh* const                errorText
@@ -1218,7 +1219,8 @@
 {
     SAXParseException toThrow = SAXParseException
     (
-        errorText
+        static_cast<XMLExcepts::Codes>(originalExceptCode)
+        , errorText
         , publicId
         , systemId
         , lineNum
Index: src/xercesc/parsers/XercesDOMParser.cpp
===================================================================
--- src/xercesc/parsers/XercesDOMParser.cpp	(revision 2469)
+++ src/xercesc/parsers/XercesDOMParser.cpp	(working copy)
@@ -41,6 +41,7 @@
 #include <xercesc/util/Janitor.hpp>
 #include <xercesc/util/OutOfMemoryException.hpp>
 #include <xercesc/util/XMLEntityResolver.hpp>
+#include <xercesc/util/XMLExceptMsgs.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
 
@@ -176,7 +177,7 @@
 // ---------------------------------------------------------------------------
 //  XercesDOMParser: Implementation of the XMLErrorReporter interface
 // ---------------------------------------------------------------------------
-void XercesDOMParser::error( const   unsigned int
+void XercesDOMParser::error( const   unsigned int                originalExceptCode
                              , const XMLCh* const
                              , const XMLErrorReporter::ErrTypes  errType
                              , const XMLCh* const                errorText
@@ -187,7 +188,8 @@
 {
     SAXParseException toThrow = SAXParseException
         (
-        errorText
+        static_cast<XMLExcepts::Codes>(originalExceptCode)
+        , errorText
         , publicId
         , systemId
         , lineNum
Index: src/xercesc/parsers/SAXParser.cpp
===================================================================
--- src/xercesc/parsers/SAXParser.cpp	(revision 2469)
+++ src/xercesc/parsers/SAXParser.cpp	(working copy)
@@ -38,6 +38,7 @@
 #include <xercesc/util/Janitor.hpp>
 #include <xercesc/util/OutOfMemoryException.hpp>
 #include <xercesc/util/XMLEntityResolver.hpp>
+#include <xercesc/util/XMLExceptMsgs.hpp>
 #include <string.h>
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -1153,7 +1154,7 @@
 }
 
 
-void SAXParser::error(  const   unsigned int
+void SAXParser::error(  const   unsigned int                originalExceptCode
                         , const XMLCh* const
                         , const XMLErrorReporter::ErrTypes  errType
                         , const XMLCh* const                errorText
@@ -1164,7 +1165,8 @@
 {
     SAXParseException toThrow = SAXParseException
     (
-        errorText
+        static_cast<XMLExcepts::Codes>(originalExceptCode)
+        , errorText
         , publicId
         , systemId
         , lineNum
Index: src/xercesc/dom/deprecated/DOMParser.cpp
===================================================================
--- src/xercesc/dom/deprecated/DOMParser.cpp	(revision 2469)
+++ src/xercesc/dom/deprecated/DOMParser.cpp	(working copy)
@@ -41,6 +41,7 @@
 #include <xercesc/framework/XMLGrammarPool.hpp>
 #include <xercesc/framework/XMLSchemaDescription.hpp>
 #include <xercesc/util/Janitor.hpp>
+#include <xercesc/util/XMLExceptMsgs.hpp>
 
 #include "DOMParser.hpp"
 #include "ElementImpl.hpp"
@@ -549,7 +550,7 @@
 // ---------------------------------------------------------------------------
 //  DOMParser: Implementation of the XMLErrorReporter interface
 // ---------------------------------------------------------------------------
-void DOMParser::error(  const   unsigned int              /*code*/
+void DOMParser::error(  const   unsigned int              code
                       , const XMLCh* const                /*msgDomain*/
                       , const XMLErrorReporter::ErrTypes  errType
                       , const XMLCh* const                errorText
@@ -560,7 +561,8 @@
 {
     SAXParseException toThrow = SAXParseException
         (
-        errorText
+        static_cast<XMLExcepts::Codes>(code)
+        , errorText
         , publicId
         , systemId
         , lineNum
Index: src/xercesc/sax/SAXParseException.cpp
===================================================================
--- src/xercesc/sax/SAXParseException.cpp	(revision 2469)
+++ src/xercesc/sax/SAXParseException.cpp	(working copy)
@@ -32,10 +32,11 @@
 // ---------------------------------------------------------------------------
 //  SAXParseException: Constructors and Destructor
 // ---------------------------------------------------------------------------
-SAXParseException::SAXParseException(const  XMLCh* const    message
-                                    , const Locator&        locator
-                                    , MemoryManager* const  manager) :
+SAXParseException::SAXParseException(const  XMLCh* const        message
+                                    , const Locator&            locator
+                                    , MemoryManager* const      manager) :
     SAXException(message, manager)
+    , fOriginalExceptCode(XMLExcepts::NoError)
     , fColumnNumber(locator.getColumnNumber())
     , fLineNumber(locator.getLineNumber())
     , fPublicId(XMLString::replicate(locator.getPublicId(), manager))
@@ -43,13 +44,15 @@
 {
 }
 
-SAXParseException::SAXParseException(const  XMLCh* const    message
-                                    , const XMLCh* const    publicId
-                                    , const XMLCh* const    systemId
-                                    , const XMLSSize_t      lineNumber
-                                    , const XMLSSize_t      columnNumber
-                                    , MemoryManager* const  manager) :
+SAXParseException::SAXParseException(const XMLExcepts::Codes    originalExceptCode
+                                    , const  XMLCh* const       message
+                                    , const XMLCh* const        publicId
+                                    , const XMLCh* const        systemId
+                                    , const XMLSSize_t          lineNumber
+                                    , const XMLSSize_t          columnNumber
+                                    , MemoryManager* const      manager) :
     SAXException(message, manager)
+    , fOriginalExceptCode(originalExceptCode)
     , fColumnNumber(columnNumber)
     , fLineNumber(lineNumber)
     , fPublicId(XMLString::replicate(publicId, manager))
@@ -60,6 +63,7 @@
 SAXParseException::SAXParseException(const SAXParseException& toCopy) :
 
     SAXException(toCopy)
+    , fOriginalExceptCode(toCopy.fOriginalExceptCode)
     , fColumnNumber(toCopy.fColumnNumber)
     , fLineNumber(toCopy.fLineNumber)
     , fPublicId(0)
@@ -102,6 +106,11 @@
 // ---------------------------------------------------------------------------
 //  SAXParseException: Getter methods
 // ---------------------------------------------------------------------------
+XMLExcepts::Codes SAXParseException::getOriginalExceptionCode() const
+{
+    return fOriginalExceptCode;
+}
+
 const XMLCh* SAXParseException::getPublicId() const
 {
     return fPublicId;
Index: src/xercesc/sax/SAXParseException.hpp
===================================================================
--- src/xercesc/sax/SAXParseException.hpp	(revision 2469)
+++ src/xercesc/sax/SAXParseException.hpp	(working copy)
@@ -24,6 +24,7 @@
 #define SAXPARSEEXCEPTION_HPP
 
 #include <xercesc/sax/SAXException.hpp>
+#include <xercesc/util/XMLExceptMsgs.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
 
@@ -92,7 +93,8 @@
     */
     SAXParseException
     (
-        const   XMLCh* const    message
+        const XMLExcepts::Codes originalExceptCode
+        , const XMLCh* const    message
         , const XMLCh* const    publicId
         , const XMLCh* const    systemId
         , const XMLSSize_t      lineNumber
@@ -128,6 +130,13 @@
     /** @name Getter methods */
     //@{
    /**
+    * The original code of the exception.
+    *
+    * @return a value from the XMLExcepts::Codes enumeration representing
+    *         the original code of the exception.
+    */
+    XMLExcepts::Codes getOriginalExceptionCode() const;
+   /**
     * The column number of the end of the text where the exception occurred.
     *
     * <p>The first column in a line is position 1.</p>
@@ -169,13 +178,15 @@
 private:
     /* Data Members */
 
-    /* The column in the source text where the error occured. */
+    /* The original code of the exception. */
+    XMLExcepts::Codes fOriginalExceptCode;
+    /* The column in the source text where the error occurred. */
     XMLSSize_t      fColumnNumber;
-    /* The line in the source text where the error occured. */
+    /* The line in the source text where the error occurred. */
     XMLSSize_t      fLineNumber;
-    /* The public id of the file where the error occured. */
+    /* The public id of the file where the error occurred. */
     XMLCh*          fPublicId;
-    /* The system id of the file where the error occured. */
+    /* The system id of the file where the error occurred. */
     XMLCh*          fSystemId;
 
 
