dbertoni    2003/06/30 18:10:39

  Modified:    c/src/xalanc/XercesParserLiaison
                        FormatterToDeprecatedXercesDOM.cpp
                        FormatterToDeprecatedXercesDOM.hpp
                        FormatterToXercesDOM.cpp FormatterToXercesDOM.hpp
                        XercesDOMException.cpp XercesDOMException.hpp
  Log:
  Make sure we can and translate all Xerces exceptions.  Also, use new 
general-purpose code in DOMServices to resolve prefixes.  Fixes Bugzilla 21025.
  
  Revision  Changes    Path
  1.2       +107 -73   
xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToDeprecatedXercesDOM.cpp
  
  Index: FormatterToDeprecatedXercesDOM.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToDeprecatedXercesDOM.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatterToDeprecatedXercesDOM.cpp        29 Jun 2003 03:58:24 -0000      
1.1
  +++ FormatterToDeprecatedXercesDOM.cpp        1 Jul 2003 01:10:39 -0000       
1.2
  @@ -91,6 +91,14 @@
   
   
   
  +#include <xalanc/DOMSupport/DOMServices.hpp>
  +
  +
  +
  +#include "XercesDOMException.hpp"
  +
  +
  +
   XALAN_CPP_NAMESPACE_BEGIN
   
   
  @@ -180,15 +188,22 @@
                        const   XMLCh* const    name,
                        AttributeListType&              attrs)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     DOM_ElementType elem = createElement(name, attrs);
  +             DOM_ElementType elem = createElement(name, attrs);
   
  -     append(elem);
  +             append(elem);
   
  -     m_elemStack.push_back(m_currentElem);
  +             m_elemStack.push_back(m_currentElem);
   
  -     m_currentElem = elem;
  +             m_currentElem = elem;
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -196,17 +211,24 @@
   void
   FormatterToDeprecatedXercesDOM::endElement(const     XMLCh* const    /* name 
*/)
   {
  -     processAccumulatedText();
  -
  -     if(m_elemStack.empty() == false)
  +     try
        {
  -             m_currentElem = m_elemStack.back();
  +             processAccumulatedText();
   
  -             m_elemStack.pop_back();
  +             if(m_elemStack.empty() == false)
  +             {
  +                     m_currentElem = m_elemStack.back();
  +
  +                     m_elemStack.pop_back();
  +             }
  +             else
  +             {
  +                     m_currentElem = 0;
  +             }
        }
  -     else
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
        {
  -             m_currentElem = 0;
  +             throw XercesDOMException(theException);
        }
   }
   
  @@ -227,9 +249,16 @@
                const XMLCh* const      chars,
                const unsigned int      length)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     cdata(chars, length);
  +             cdata(chars, length);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }            
   
   
  @@ -237,14 +266,21 @@
   void
   FormatterToDeprecatedXercesDOM::entityReference(const XMLCh* const   name)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     DOM_EntityReferenceType  theXercesNode =
  -             m_doc.createEntityReference(name);
  +             DOM_EntityReferenceType  theXercesNode =
  +                     m_doc.createEntityReference(name);
   
  -     assert(theXercesNode.isNull() == false);
  +             assert(theXercesNode.isNull() == false);
   
  -     append(theXercesNode);
  +             append(theXercesNode);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -254,16 +290,23 @@
                        const XMLCh* const      chars,
                        const unsigned int      length)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     assign(m_buffer, chars, length);
  +             assign(m_buffer, chars, length);
   
  -     DOM_TextType theXercesNode = 
  -             m_doc.createTextNode(m_buffer.c_str());
  +             DOM_TextType theXercesNode = 
  +                     m_doc.createTextNode(m_buffer.c_str());
   
  -     assert(theXercesNode.isNull() == false);
  +             assert(theXercesNode.isNull() == false);
   
  -     append(theXercesNode);
  +             append(theXercesNode);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -273,14 +316,21 @@
                        const XMLCh* const      target,
                        const XMLCh* const      data)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     DOM_ProcessingInstructionType theXercesNode = 
  -             m_doc.createProcessingInstruction(target, data);
  +             DOM_ProcessingInstructionType theXercesNode = 
  +                     m_doc.createProcessingInstruction(target, data);
   
  -     assert(theXercesNode.isNull() == false);
  +             assert(theXercesNode.isNull() == false);
   
  -     append(theXercesNode);
  +             append(theXercesNode);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -295,16 +345,21 @@
   void
   FormatterToDeprecatedXercesDOM::comment(const XMLCh* const   data)
   {
  -     processAccumulatedText();
  -
  -     DOM_CommentType theXercesNode =
  -             m_doc.createComment(data);
  -
  -     assert(theXercesNode.isNull() == false);
  +     try
  +     {
  +             processAccumulatedText();
   
  -     append(theXercesNode);
  +             DOM_CommentType theXercesNode =
  +                     m_doc.createComment(data);
   
  +             assert(theXercesNode.isNull() == false);
   
  +             append(theXercesNode);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -314,17 +369,23 @@
                        const XMLCh* const      ch,
                        const unsigned int      length)
   {
  -     processAccumulatedText();
  -
  -     assign(m_buffer, ch, length);
  +     try
  +     {
  +             processAccumulatedText();
   
  -     DOM_CDATASectionType theXercesNode = 
  -             m_doc.createCDATASection(m_buffer.c_str());
  +             assign(m_buffer, ch, length);
   
  -     assert(theXercesNode.isNull() == false);
  +             DOM_CDATASectionType theXercesNode = 
  +                     m_doc.createCDATASection(m_buffer.c_str());
   
  -     append(theXercesNode);
  +             assert(theXercesNode.isNull() == false);
   
  +             append(theXercesNode);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -367,7 +428,7 @@
        {
                // Check for the namespace...
                const XalanDOMString* const             theNamespace =
  -                                     getNamespaceForPrefix(theElementName, 
*m_prefixResolver, m_buffer);
  +                             
DOMServices::getNamespaceForPrefix(theElementName, *m_prefixResolver, false , 
m_buffer);
   
                if (theNamespace == 0 || length(*theNamespace) == 0)
                {
  @@ -409,7 +470,7 @@
   
                        // Check for the namespace...
                        const XalanDOMString* const             theNamespace =
  -                                     getNamespaceForPrefix(theName, 
*m_prefixResolver, m_buffer);
  +                                     
DOMServices::getNamespaceForPrefix(theName, *m_prefixResolver, true, m_buffer);
   
                        if (theNamespace == 0 || length(*theNamespace) == 0)
                        {
  @@ -420,33 +481,6 @@
                                
theElement.setAttributeNS(theNamespace->c_str(), theName, attrs.getValue(i));
                        }
                }
  -     }
  -}
  -
  -
  -
  -const XalanDOMString*
  -FormatterToDeprecatedXercesDOM::getNamespaceForPrefix(
  -                     const XalanDOMChar*             theName,
  -                     const PrefixResolver&   thePrefixResolver,
  -                     XalanDOMString&                 thePrefix)
  -{
  -     const XalanDOMString::size_type         theLength = length(theName);
  -     const XalanDOMString::size_type         theColonIndex = 
indexOf(theName, XalanUnicode::charColon);
  -
  -     if (theColonIndex == theLength)
  -     {
  -             clear(thePrefix);
  -
  -             return thePrefixResolver.getNamespaceForPrefix(s_emptyString);
  -     }
  -     else
  -     {
  -             // Get the prefix from theName...
  -             assign(thePrefix, theName, theColonIndex);
  -             assert(length(thePrefix) != 0);
  -
  -             return thePrefixResolver.getNamespaceForPrefix(thePrefix);
        }
   }
   
  
  
  
  1.2       +0 -6      
xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToDeprecatedXercesDOM.hpp
  
  Index: FormatterToDeprecatedXercesDOM.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToDeprecatedXercesDOM.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatterToDeprecatedXercesDOM.hpp        29 Jun 2003 03:58:24 -0000      
1.1
  +++ FormatterToDeprecatedXercesDOM.hpp        1 Jul 2003 01:10:39 -0000       
1.2
  @@ -266,12 +266,6 @@
                        DOM_ElementType                 &theElement,
                        AttributeListType&      attrs);
   
  -     const XalanDOMString*
  -     getNamespaceForPrefix(
  -                     const XalanDOMChar*             theName,
  -                     const PrefixResolver&   thePrefixResolver,
  -                     XalanDOMString&                 thePrefix);
  -
   
        // Data members...
        DOM_Document_Type                               m_doc;
  
  
  
  1.2       +94 -57    
xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp
  
  Index: FormatterToXercesDOM.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatterToXercesDOM.cpp  29 Jun 2003 03:58:24 -0000      1.1
  +++ FormatterToXercesDOM.cpp  1 Jul 2003 01:10:39 -0000       1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -82,11 +82,19 @@
   
   
   
  +#include <xalanc/DOMSupport/DOMServices.hpp>
  +
  +
  +
   #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
   #include <xalanc/PlatformSupport/PrefixResolver.hpp>
   
   
   
  +#include "XercesDOMException.hpp"
  +
  +
  +
   XALAN_CPP_NAMESPACE_BEGIN
   
   
  @@ -163,16 +171,23 @@
                        const   XMLCh* const    name,
                        AttributeListType&              attrs)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     DOMElementType* const   elem = createElement(name, attrs);
  -     assert(elem != 0);
  +             DOMElementType* const   elem = createElement(name, attrs);
  +             assert(elem != 0);
   
  -     append(elem);
  +             append(elem);
   
  -     m_elemStack.push_back(m_currentElem);
  +             m_elemStack.push_back(m_currentElem);
   
  -     m_currentElem = elem;
  +             m_currentElem = elem;
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -180,17 +195,24 @@
   void
   FormatterToXercesDOM::endElement(const       XMLCh* const    /* name */)
   {
  -     processAccumulatedText();
  -
  -     if(m_elemStack.empty() == false)
  +     try
        {
  -             m_currentElem = m_elemStack.back();
  +             processAccumulatedText();
   
  -             m_elemStack.pop_back();
  +             if(m_elemStack.empty() == false)
  +             {
  +                     m_currentElem = m_elemStack.back();
  +
  +                     m_elemStack.pop_back();
  +             }
  +             else
  +             {
  +                     m_currentElem = 0;
  +             }
        }
  -     else
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
        {
  -             m_currentElem = 0;
  +             throw XercesDOMException(theException);
        }
   }
   
  @@ -211,9 +233,16 @@
                const XMLCh* const      chars,
                const unsigned int      length)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     cdata(chars, length);
  +             cdata(chars, length);
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }            
   
   
  @@ -221,9 +250,16 @@
   void
   FormatterToXercesDOM::entityReference(const XMLCh* const     name)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     append(m_doc->createEntityReference(name));
  +             append(m_doc->createEntityReference(name));
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -233,11 +269,18 @@
                        const XMLCh* const      chars,
                        const unsigned int      length)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     assign(m_buffer, chars, length);
  +             assign(m_buffer, chars, length);
   
  -     append(m_doc->createTextNode(m_buffer.c_str()));
  +             append(m_doc->createTextNode(m_buffer.c_str()));
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -247,9 +290,16 @@
                        const XMLCh* const      target,
                        const XMLCh* const      data)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     append(m_doc->createProcessingInstruction(target, data));
  +             append(m_doc->createProcessingInstruction(target, data));
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -264,9 +314,16 @@
   void
   FormatterToXercesDOM::comment(const XMLCh* const     data)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     append(m_doc->createComment(data));
  +             append(m_doc->createComment(data));
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -276,11 +333,18 @@
                        const XMLCh* const      ch,
                        const unsigned int      length)
   {
  -     processAccumulatedText();
  +     try
  +     {
  +             processAccumulatedText();
   
  -     assign(m_buffer, ch, length);
  +             assign(m_buffer, ch, length);
   
  -     append(m_doc->createCDATASection(m_buffer.c_str()));
  +             append(m_doc->createCDATASection(m_buffer.c_str()));
  +     }
  +     catch(const XERCES_CPP_NAMESPACE_QUALIFIER DOMException&        
theException)
  +     {
  +             throw XercesDOMException(theException);
  +     }
   }
   
   
  @@ -323,7 +387,7 @@
        {
                // Check for the namespace...
                const XalanDOMString* const             theNamespace =
  -                                     getNamespaceForPrefix(theElementName, 
*m_prefixResolver, m_buffer);
  +                             
DOMServices::getNamespaceForPrefix(theElementName, *m_prefixResolver, false, 
m_buffer);
   
                if (theNamespace == 0 || length(*theNamespace) == 0)
                {
  @@ -365,7 +429,7 @@
   
                        // Check for the namespace...
                        const XalanDOMString* const             theNamespace =
  -                                     getNamespaceForPrefix(theName, 
*m_prefixResolver, m_buffer);
  +                                     
DOMServices::getNamespaceForPrefix(theName, *m_prefixResolver, true, m_buffer);
   
                        if (theNamespace == 0 || length(*theNamespace) == 0)
                        {
  @@ -376,33 +440,6 @@
                                
theElement->setAttributeNS(theNamespace->c_str(), theName, attrs.getValue(i));
                        }
                }
  -     }
  -}
  -
  -
  -
  -const XalanDOMString*
  -FormatterToXercesDOM::getNamespaceForPrefix(
  -                     const XalanDOMChar*             theName,
  -                     const PrefixResolver&   thePrefixResolver,
  -                     XalanDOMString&                 thePrefix)
  -{
  -     const XalanDOMString::size_type         theLength = length(theName);
  -     const XalanDOMString::size_type         theColonIndex = 
indexOf(theName, XalanUnicode::charColon);
  -
  -     if (theColonIndex == theLength)
  -     {
  -             clear(thePrefix);
  -
  -             return thePrefixResolver.getNamespaceForPrefix(s_emptyString);
  -     }
  -     else
  -     {
  -             // Get the prefix from theName...
  -             assign(thePrefix, theName, theColonIndex);
  -             assert(length(thePrefix) != 0);
  -
  -             return thePrefixResolver.getNamespaceForPrefix(thePrefix);
        }
   }
   
  
  
  
  1.2       +0 -6      
xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp
  
  Index: FormatterToXercesDOM.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FormatterToXercesDOM.hpp  29 Jun 2003 03:58:24 -0000      1.1
  +++ FormatterToXercesDOM.hpp  1 Jul 2003 01:10:39 -0000       1.2
  @@ -241,12 +241,6 @@
                        DOMElementType*         theElement,
                        AttributeListType&      attrs);
   
  -     const XalanDOMString*
  -     getNamespaceForPrefix(
  -                     const XalanDOMChar*             theName,
  -                     const PrefixResolver&   thePrefixResolver,
  -                     XalanDOMString&                 thePrefix);
  -
   
        // Data members...
        DOMDocument_Type*                               m_doc;
  
  
  
  1.2       +71 -61    
xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMException.cpp
  
  Index: XercesDOMException.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMException.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XercesDOMException.cpp    29 Jun 2003 03:58:24 -0000      1.1
  +++ XercesDOMException.cpp    1 Jul 2003 01:10:39 -0000       1.2
  @@ -66,98 +66,72 @@
   
   
   
  -XercesDOMException::XercesDOMException(ExceptionCode         code) :
  -     XalanDOMException(code)
  +template<class ExceptionType>
  +static XercesDOMException::ExceptionCode
  +translateErrorCode(ExceptionType     theException)
   {
  -}
  -
  +     XercesDOMException::ExceptionCode       theXalanCode = 
XercesDOMException::UNKNOWN_ERR;
   
  -
  -XercesDOMException::XercesDOMException(const DOM_DOMExceptionType&   
theException) :
  -     XalanDOMException(translateErrorCode(theException.code))
  -{
  -}
  -
  -
  -
  -XercesDOMException::XercesDOMException(const XercesDOMException&     
theSource) :
  -     XalanDOMException(theSource)
  -{
  -}
  -
  -
  -
  -XercesDOMException::~XercesDOMException()
  -{
  -}
  -
  -
  -
  -XercesDOMException::ExceptionCode
  -XercesDOMException::translateErrorCode(DOM_DOMExceptionType::ExceptionCode   
theCode)
  -{
  -     ExceptionCode   theXalanCode = UNKNOWN_ERR;
  -
  -     switch(theCode)
  +     switch(theException.code)
        {
  -     case DOM_DOMExceptionType::INDEX_SIZE_ERR:
  -             theXalanCode = INDEX_SIZE_ERR;
  +     case ExceptionType::INDEX_SIZE_ERR:
  +             theXalanCode = XercesDOMException::INDEX_SIZE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::DOMSTRING_SIZE_ERR:
  -             theXalanCode = DOMSTRING_SIZE_ERR;
  +     case ExceptionType::DOMSTRING_SIZE_ERR:
  +             theXalanCode = XercesDOMException::DOMSTRING_SIZE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::HIERARCHY_REQUEST_ERR:
  -             theXalanCode = HIERARCHY_REQUEST_ERR;
  +     case ExceptionType::HIERARCHY_REQUEST_ERR:
  +             theXalanCode = XercesDOMException::HIERARCHY_REQUEST_ERR;
                break;
   
  -     case DOM_DOMExceptionType::WRONG_DOCUMENT_ERR:
  -             theXalanCode = WRONG_DOCUMENT_ERR;
  +     case ExceptionType::WRONG_DOCUMENT_ERR:
  +             theXalanCode = XercesDOMException::WRONG_DOCUMENT_ERR;
                break;
   
  -     case DOM_DOMExceptionType::INVALID_CHARACTER_ERR:
  -             theXalanCode = INVALID_CHARACTER_ERR;
  +     case ExceptionType::INVALID_CHARACTER_ERR:
  +             theXalanCode = XercesDOMException::INVALID_CHARACTER_ERR;
                break;
   
  -     case DOM_DOMExceptionType::NO_DATA_ALLOWED_ERR:
  -             theXalanCode = NO_DATA_ALLOWED_ERR;
  +     case ExceptionType::NO_DATA_ALLOWED_ERR:
  +             theXalanCode = XercesDOMException::NO_DATA_ALLOWED_ERR;
                break;
   
  -     case DOM_DOMExceptionType::NO_MODIFICATION_ALLOWED_ERR:
  -             theXalanCode = NO_MODIFICATION_ALLOWED_ERR;
  +     case ExceptionType::NO_MODIFICATION_ALLOWED_ERR:
  +             theXalanCode = XercesDOMException::NO_MODIFICATION_ALLOWED_ERR;
                break;
   
  -     case DOM_DOMExceptionType::NOT_FOUND_ERR:
  -             theXalanCode = NOT_FOUND_ERR;
  +     case ExceptionType::NOT_FOUND_ERR:
  +             theXalanCode = XercesDOMException::NOT_FOUND_ERR;
                break;
   
  -     case DOM_DOMExceptionType::NOT_SUPPORTED_ERR:
  -             theXalanCode = INDEX_SIZE_ERR;
  +     case ExceptionType::NOT_SUPPORTED_ERR:
  +             theXalanCode = XercesDOMException::INDEX_SIZE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::INUSE_ATTRIBUTE_ERR:
  -             theXalanCode = INUSE_ATTRIBUTE_ERR;
  +     case ExceptionType::INUSE_ATTRIBUTE_ERR:
  +             theXalanCode = XercesDOMException::INUSE_ATTRIBUTE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::INVALID_STATE_ERR:
  -             theXalanCode = INVALID_STATE_ERR;
  +     case ExceptionType::INVALID_STATE_ERR:
  +             theXalanCode = XercesDOMException::INVALID_STATE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::SYNTAX_ERR:
  -             theXalanCode = SYNTAX_ERR;
  +     case ExceptionType::SYNTAX_ERR:
  +             theXalanCode = XercesDOMException::SYNTAX_ERR;
                break;
   
  -     case DOM_DOMExceptionType::INVALID_MODIFICATION_ERR:
  -             theXalanCode = INVALID_MODIFICATION_ERR;
  +     case ExceptionType::INVALID_MODIFICATION_ERR:
  +             theXalanCode = XercesDOMException::INVALID_MODIFICATION_ERR;
                break;
   
  -     case DOM_DOMExceptionType::NAMESPACE_ERR:
  -             theXalanCode = NAMESPACE_ERR;
  +     case ExceptionType::NAMESPACE_ERR:
  +             theXalanCode = XercesDOMException::NAMESPACE_ERR;
                break;
   
  -     case DOM_DOMExceptionType::INVALID_ACCESS_ERR:
  -             theXalanCode = INVALID_ACCESS_ERR;
  +     case ExceptionType::INVALID_ACCESS_ERR:
  +             theXalanCode = XercesDOMException::INVALID_ACCESS_ERR;
                break;
   
        default:
  @@ -166,6 +140,42 @@
        };
   
        return theXalanCode;
  +}
  +
  +
  +
  +XercesDOMException::XercesDOMException(ExceptionCode         code) :
  +     XalanDOMException(code)
  +{
  +}
  +
  +
  +
  +XercesDOMException::XercesDOMException(const DOM_DOMExceptionType&   
theException) :
  +     XalanDOMException(translateErrorCode(theException))
  +{
  +}
  +
  +
  +
  +#if XERCES_VERSION_MAJOR >= 2
  +XercesDOMException::XercesDOMException(const DOMExceptionType&       
theException) :
  +     XalanDOMException(translateErrorCode(theException))
  +{
  +}
  +#endif
  +
  +
  +
  +XercesDOMException::XercesDOMException(const XercesDOMException&     
theSource) :
  +     XalanDOMException(theSource)
  +{
  +}
  +
  +
  +
  +XercesDOMException::~XercesDOMException()
  +{
   }
   
   
  
  
  
  1.2       +12 -3     
xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMException.hpp
  
  Index: XercesDOMException.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMException.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XercesDOMException.hpp    29 Jun 2003 03:58:24 -0000      1.1
  +++ XercesDOMException.hpp    1 Jul 2003 01:10:39 -0000       1.2
  @@ -65,6 +65,7 @@
   
   #if XERCES_VERSION_MAJOR >= 2
   #include <xercesc/dom/deprecated/DOM_DOMException.hpp>
  +#include <xercesc/dom/DOMException.hpp>
   #else
   #include <xercesc/dom/DOM_DOMException.hpp>
   #endif
  @@ -107,6 +108,17 @@
          */
        XercesDOMException(const DOM_DOMExceptionType&  theException);
   
  +#if XERCES_VERSION_MAJOR >= 2
  +     /**
  +       * Constructor which takes a Xerces exception and
  +       * translates it into a XercesDOMException.
  +       *
  +       * @param code The Xerces DOM_DOMException instance.
  +       */
  +     XercesDOMException(const DOMExceptionType&      theException);
  +
  +#endif
  +
        /**
          * Copy constructor.
          *
  @@ -126,9 +138,6 @@
        //@}
   
   private:
  -
  -     static ExceptionCode
  -     translateErrorCode(DOM_DOMExceptionType::ExceptionCode  theCode);
   };
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to