You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2008/09/01 08:42:13 UTC

svn commit: r690861 [4/6] - in /xalan/c/trunk: Projects/Win32/VC8/AllInOne/ Projects/Win32/VC9/AllInOne/ Tests/Conf/ samples/ExternalFunction/ src/xalanc/DOMSupport/ src/xalanc/Harness/ src/xalanc/ICUBridge/ src/xalanc/Include/ src/xalanc/NLS/en_US/ sr...

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemTemplateElement.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemTemplateElement.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemTemplateElement.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemTemplateElement.cpp Sun Aug 31 23:42:06 2008
@@ -528,7 +528,7 @@
     }
     else
     {
-        StylesheetExecutionContext::GetAndReleaseCachedString   theResult(executionContext);
+        const StylesheetExecutionContext::GetCachedString   theResult(executionContext);
 
         childrenToString(executionContext, theResult.get());
 
@@ -656,12 +656,14 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetExecutionContext::eXSLTProcessor,
+        StylesheetExecutionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode),
-        theContext.getCurrentNode(),
-        getLocator());
+        getLocator(),
+        theContext.getCurrentNode());
 }
 
 
@@ -674,13 +676,15 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetExecutionContext::eXSLTProcessor,
+        StylesheetExecutionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken),
-        theContext.getCurrentNode(),
-        getLocator());
+        getLocator(),
+        theContext.getCurrentNode());
 }
 
 
@@ -693,12 +697,14 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+            StylesheetExecutionContext::eXSLTProcessor,
+            StylesheetExecutionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode),
-        theContext.getCurrentNode(),
-        theLocator);
+        theLocator,
+        theContext.getCurrentNode());
 }
 
 
@@ -710,12 +716,14 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.warn(
+    theContext.problem(
+        StylesheetExecutionContext::eXSLTProcessor,
+        StylesheetExecutionContext::eWarning,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode),
-        theContext.getCurrentNode(),
-        getLocator());
+        getLocator(),
+        theContext.getCurrentNode());
 }
 
 
@@ -728,12 +736,14 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.warn(
+    theContext.problem(
+        StylesheetExecutionContext::eXSLTProcessor,
+        StylesheetExecutionContext::eWarning,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode),
-        theContext.getCurrentNode(),
-        theLocator);
+        theLocator,
+        theContext.getCurrentNode());
 }
 
 
@@ -746,13 +756,15 @@
 {
     const ECGetCachedString     theGuard(theContext);
 
-    theContext.warn(
+    theContext.problem(
+        StylesheetExecutionContext::eXSLTProcessor,
+        StylesheetExecutionContext::eWarning,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken),
-        theContext.getCurrentNode(),
-        getLocator());
+        getLocator(),
+        theContext.getCurrentNode());
 }
 
 
@@ -767,15 +779,17 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.warn(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eWarning,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken1,
             theToken2,
             theToken3),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 
@@ -787,12 +801,14 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 
@@ -806,13 +822,15 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken),
-        0,
-        theLocator);
+        theLocator,
+        0);
 }
 
 
@@ -825,13 +843,15 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 
@@ -845,14 +865,16 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken1,
             theToken2),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 
@@ -866,14 +888,16 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken1,
             theToken2),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 
@@ -888,15 +912,17 @@
 {
     const CCGetCachedString     theGuard(theContext);
 
-    theContext.error(
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
         XalanMessageLoader::getMessage(
             theGuard.get(),
             theCode,
             theToken1,
             theToken2,
             theToken3),
-        0,
-        getLocator());
+        getLocator(),
+        0);
 }
 
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemValueOf.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemValueOf.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemValueOf.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemValueOf.cpp Sun Aug 31 23:42:06 2008
@@ -269,7 +269,7 @@
 
         if (0 != executionContext.getTraceListeners())
         {
-            const StylesheetExecutionContext::GetAndReleaseCachedString     theString(executionContext);
+            const StylesheetExecutionContext::GetCachedString   theString(executionContext);
 
             DOMServices::getNodeData(*sourceNode, executionContext, theString.get());
 
@@ -324,7 +324,7 @@
 
         if (0 != executionContext.getTraceListeners())
         {
-            const StylesheetExecutionContext::GetAndReleaseCachedString     theString(executionContext);
+            const StylesheetExecutionContext::GetCachedString   theString(executionContext);
 
             DOMServices::getNodeData(*sourceNode, executionContext, theString.get());
 
@@ -392,7 +392,7 @@
     }
     else
     {
-        const StylesheetExecutionContext::GetAndReleaseCachedString     thePattern(executionContext);
+        const StylesheetExecutionContext::GetCachedString   thePattern(executionContext);
 
         thePattern.get() = ".";
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemWithParam.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemWithParam.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemWithParam.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemWithParam.cpp Sun Aug 31 23:42:06 2008
@@ -162,7 +162,7 @@
     
         if (0 != executionContext.getTraceListeners())
         {
-            const StylesheetExecutionContext::GetAndReleaseCachedString     theGuard(executionContext);
+            const StylesheetExecutionContext::GetCachedString   theGuard(executionContext);
 
             XalanDOMString&     theString = theGuard.get();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.hpp Sun Aug 31 23:42:06 2008
@@ -56,19 +56,23 @@
 class XALAN_XSLT_EXPORT ExtensionNSHandler : public ExtensionFunctionHandler
 {	 
 public:	
-	/**
+
+    /**
 	 * Construct a new extension namespace handler for a given extension NS.
 	 * This doesn't do anything - just hang on to the namespace URI.
 	 * 
 	 * @param namespaceUri extension namespace URI being implemented
 	 */
-	ExtensionNSHandler(const XalanDOMString&	namespaceUri,
-                        MemoryManagerType& theManager);
+	ExtensionNSHandler(
+            const XalanDOMString&	namespaceUri,
+            MemoryManager&          theManager);
 
 	static ExtensionNSHandler*
-    create(const XalanDOMString&	namespaceUri,
-                        MemoryManagerType& theManager);
-	/**
+    create(
+            const XalanDOMString&	namespaceUri,
+            MemoryManager&          theManager);
+
+    /**
 	 * Construct a new extension namespace handler given all the information
 	 * needed. 
 	 * 
@@ -82,7 +86,7 @@
 	 * @param scriptSrc    the actual script code (if any)
 	 */
 	ExtensionNSHandler(
-            MemoryManagerType&      theManager,
+            MemoryManager&          theManager,
 			const XalanDOMString&	namespaceUri,
 			const XalanDOMString&	elemNames,
 			const XalanDOMString&	funcNames,
@@ -173,7 +177,6 @@
 	virtual void
 	startupComponent();
 
-
 private:
 
 	typedef XalanSet<XalanDOMString>	ExtensionSetType;

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionDocument.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionDocument.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionDocument.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionDocument.cpp Sun Aug 31 23:42:06 2008
@@ -19,6 +19,11 @@
 
 
 
+#include "xercesc/SAX/ErrorHandler.hpp"
+#include "xercesc/SAX/SAXParseException.hpp"
+
+
+
 #include <xalanc/XalanDOM/XalanNode.hpp>
 #include <xalanc/XalanDOM/XalanDocument.hpp>
 
@@ -54,42 +59,111 @@
 
 
 typedef XPathExecutionContext::BorrowReturnMutableNodeRefList   BorrowReturnMutableNodeRefList;
+typedef Function::GetCachedString   GetCachedString;
 
 
 
 inline void
 doWarn(
-            XPathExecutionContext&              executionContext,
-            const XalanDOMString&               uri,
-            const XalanDOMString&               base,
-            const XalanNode*                    sourceNode,
-            const LocatorType*                  locator)
+            XPathExecutionContext&  executionContext,
+            const XalanDOMString&   uri,
+            const XalanDOMString&   base,
+            const XalanNode*        sourceNode,
+            const Locator*          locator)
 {
-    XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
+    const GetCachedString   theGuard(executionContext);
 
-    XalanDOMString& theMessage = theGuard.get();
+    XalanDOMString&     theMessage = theGuard.get();
+
+    const XalanMessages::Codes  theMessageID = base.empty() ?
+            XalanMessages::CantLoadReqDocument_1Param :
+            XalanMessages::CantLoadReqDocument_2Param;
 
     XalanMessageLoader::getMessage(
         theMessage,
-        XalanMessages::CantLoadReqDocument_1Param,
-        uri);
+        theMessageID,
+        uri,
+        base);
+
+    executionContext.problem(
+        XPathExecutionContext::eXPath,
+        XPathExecutionContext::eWarning,
+        theMessage,
+        locator,
+        sourceNode);
+}
+
+
+
+class LocalErrorHandler : public ErrorHandler
+{
+public:
+
+    LocalErrorHandler(
+            XPathExecutionContext&  theExecutionContext,
+            const Locator*          theLocator,
+            const XalanNode*        theSourceNode) :
+        m_executionContext(theExecutionContext),
+        m_locator(theLocator),
+        m_sourceNode(theSourceNode),
+        m_fatal(false)
+    {
+    }
 
-    if (length(base) > 0)
+    virtual void
+    warning(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& exc)
     {
-        XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
-        XalanDOMString& theTmpString = theGuard.get();
+        const GetCachedString   theGuard(m_executionContext);
 
-        TranscodeFromLocalCodePage(" (Base URI: ", theTmpString);
+        XalanDOMString&     theMessage = theGuard.get();
 
-        theMessage+= (theTmpString);
-        theMessage += base;
+        theMessage = exc.getMessage();
 
-        TranscodeFromLocalCodePage(")", theTmpString);
-        theMessage += theTmpString;
+        m_executionContext.problem(
+            XPathExecutionContext::eXMLParser,
+            XPathExecutionContext::eWarning,
+            theMessage,
+            m_locator,
+            m_sourceNode);
     }
 
-    executionContext.warn(theMessage, sourceNode, locator);
-}
+    virtual void
+    error(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& exc)
+    {
+        warning(exc);
+    }
+
+    virtual void
+    fatalError(const XERCES_CPP_NAMESPACE_QUALIFIER SAXParseException& exc)
+    {
+        m_fatal = true;
+
+        warning(exc);
+
+        throw exc;
+    }
+
+    virtual void
+    resetErrors()
+    {
+    }
+
+    bool
+    getFatalError() const
+    {
+        return m_fatal;
+    }
+
+private:
+
+    XPathExecutionContext&  m_executionContext;
+
+    const Locator* const    m_locator;
+
+    const XalanNode* const  m_sourceNode;
+
+    bool                    m_fatal;
+};
 
 
 
@@ -99,15 +173,24 @@
             const XalanDOMString&   uri,
             const XalanDOMString&   base,
             const XalanNode*        sourceNode,
-            const LocatorType*      locator)
+            const Locator*          locator)
 {
+    LocalErrorHandler   theErrorHandler(executionContext, locator, sourceNode);
+
     try
     {
-        return executionContext.parseXML(executionContext.getMemoryManager(), uri, base);
+        return executionContext.parseXML(
+                    executionContext.getMemoryManager(),
+                    uri,
+                    base,
+                    &theErrorHandler);
     }
     catch(...)
     {
-        doWarn(executionContext, uri, base, sourceNode, locator);
+        if (theErrorHandler.getFatalError())
+        {
+            doWarn(executionContext, uri, base, sourceNode, locator);
+        }
     }
 
     return 0;
@@ -126,9 +209,9 @@
 {
     XalanDocument*  newDoc = executionContext.getSourceDocument(uri);
 
-    if(newDoc == 0)
+    if (newDoc == 0)
     {
-        if(length(uri) != 0)
+        if (uri.length() != 0)
         {
             newDoc = parseDoc(executionContext, uri, base, sourceNode, locator);
         }
@@ -146,7 +229,7 @@
         }
     }
 
-    if(newDoc != 0)
+    if (newDoc != 0)
     {
         mnl->addNodeInDocOrder(newDoc, executionContext);
     }
@@ -213,7 +296,9 @@
     }
     else
     {
-        XalanDOMString              base(executionContext.getMemoryManager());
+        const GetCachedString   theGuard(executionContext);
+
+        XalanDOMString&     base = theGuard.get();
 
         assert(executionContext.getPrefixResolver() != 0);
 
@@ -235,7 +320,7 @@
 {
     assert(arg1.null() == false && arg2.null() == false);
 
-    XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+    const GetCachedString   theGuard(executionContext);
 
     XalanDOMString& base = theGuard.get();
 
@@ -243,31 +328,35 @@
 
     if (context == 0)
     {
-        XPathExecutionContext::GetAndReleaseCachedString theGuard1(executionContext);
+        const GetCachedString   theGuard1(executionContext);
 
-        executionContext.error(
+        executionContext.problem(
+            XPathExecutionContext::eXPath,
+            XPathExecutionContext::eError,
             XalanMessageLoader::getMessage(
                 theGuard1.get(),
                 XalanMessages::FunctionRequiresNonNullContextNode_1Param,
                 "document"),
-            context,
-            locator);
+            locator,
+            context);
 
         return XObjectPtr();
     }
     else
     {
-        if(XObject::eTypeNodeSet != arg2->getType())
+        if (XObject::eTypeNodeSet != arg2->getType())
         {
-            XPathExecutionContext::GetAndReleaseCachedString theGuard1(executionContext);
+            const GetCachedString   theGuard1(executionContext);
 
-            executionContext.error(
+            executionContext.problem(
+                XPathExecutionContext::eXPath,
+                XPathExecutionContext::eError,
                 XalanMessageLoader::getMessage(
                     theGuard1.get(),
                     XalanMessages::SecondArgumentToFunctionMustBeNode_set_1Param,
                     "document"),
-                context,
-                locator);
+                locator,
+                context);
         }
         else
         {
@@ -305,7 +394,7 @@
             const XObjectPtr&       arg,
             XalanDOMString*         base,
             int                     argCount,
-            const LocatorType*      locator,
+            const Locator*          locator,
             bool                    fNoRelativeURI) const
 {
     // This list will hold the nodes...
@@ -317,14 +406,14 @@
                                                 arg->nodeset().getLength()
                                                 : 1;
 
-    for(NodeRefListBase::size_type i = 0; i < nRefs; i++)
+    for (NodeRefListBase::size_type i = 0; i < nRefs; i++)
     {
         assert(XObject::eTypeNodeSet != theType ||
                             arg->nodeset().item(i) != 0);
 
         const XalanNode*    resolver = 0;
 
-        XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+        const GetCachedString   theGuard(executionContext);
 
         XalanDOMString&     ref = theGuard.get();
 
@@ -342,17 +431,17 @@
 
         // This is the case where the function was called with
         // an empty string, which refers to the stylesheet itself.
-        if (nRefs == 1 && isEmpty(ref) == true && argCount == 1)
+        if (nRefs == 1 && ref.empty() == true && argCount == 1)
         {
             if (base != 0)
             {
-                clear(*base);
+                base->clear();
             }
 
             ref = executionContext.getPrefixResolver()->getURI();
         }
 
-        if(!isEmpty(ref))
+        if (!ref.empty())
         {
             // From http://www.ics.uci.edu/pub/ietf/uri/rfc1630.txt
             // A partial form can be distinguished from an absolute form in that the
@@ -360,7 +449,7 @@
             // characters. Systems not requiring partial forms should not use any
             // unencoded slashes in their naming schemes.  If they do, absolute URIs
             // will still work, but confusion may result.
-            const XalanDOMString::size_type     theLength = length(ref);
+            const XalanDOMString::size_type     theLength = ref.length();
 
             const XalanDOMString::size_type     indexOfColon = indexOf(ref, XalanUnicode::charColon);
             XalanDOMString::size_type           indexOfSlash = indexOf(ref, XalanUnicode::charSolidus);
@@ -376,9 +465,9 @@
             }
 #endif              
 
-            if(indexOfColon < theLength &&
-               indexOfSlash < theLength &&
-               indexOfColon < indexOfSlash)
+            if (indexOfColon < theLength &&
+                indexOfSlash < theLength &&
+                indexOfColon < indexOfSlash)
             {
                 // The ref is absolute...
                 getDoc(executionContext, ref, mnl, context, locator);
@@ -389,14 +478,16 @@
                 // provided, use that...
                 if (fNoRelativeURI == true)
                 {
-                    XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+                    const GetCachedString   theGuard(executionContext);
 
-                    executionContext.warn(
+                    executionContext.problem(
+                        XPathExecutionContext::eXPath,
+                        XPathExecutionContext::eWarning,
                         XalanMessageLoader::getMessage(
                             theGuard.get(),
                             XalanMessages::CannotResolveURIInDocumentFunction),
-                        context,
-                        locator);
+                        locator,
+                        context);
                 }
                 else if (base != 0)
                 {
@@ -433,7 +524,7 @@
 #else
 FunctionDocument*
 #endif
-FunctionDocument::clone(MemoryManagerType&  theManager) const
+FunctionDocument::clone(MemoryManager&  theManager) const
 {
     return XalanCopyConstruct(theManager, *this);
 }

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionFormatNumber.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionFormatNumber.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionFormatNumber.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionFormatNumber.cpp Sun Aug 31 23:42:06 2008
@@ -53,9 +53,7 @@
     const double            theNumber = arg1->num(executionContext);
     const XalanDOMString&   thePattern = arg2->str(executionContext);
 
-    typedef XPathExecutionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
-
-    GetAndReleaseCachedString   theString(executionContext);
+    GetCachedString     theString(executionContext);
 
     executionContext.formatNumber(
             theNumber, 
@@ -85,10 +83,8 @@
 
     const XalanDOMString&               theDFSName = arg3->str(executionContext);
     assert(length(theDFSName) != 0);
-    
-    typedef XPathExecutionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
 
-    GetAndReleaseCachedString   theString(executionContext);
+    GetCachedString     theString(executionContext);
 
     executionContext.formatNumber(
         theNumber, 

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionGenerateID.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionGenerateID.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionGenerateID.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionGenerateID.cpp Sun Aug 31 23:42:06 2008
@@ -81,21 +81,23 @@
 {
     if (context == 0)
     {
-        XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
+        const GetCachedString   theGuard(executionContext);
 
-        executionContext.error(
-                XalanMessageLoader::getMessage(
-                    theGuard.get(),
-                    XalanMessages::FunctionRequiresNonNullContextNode_1Param,
-                    "generate-id()"),
-                context,
-                locator);
+        executionContext.problem(
+            XPathExecutionContext::eXPath,
+            XPathExecutionContext::eError,
+            XalanMessageLoader::getMessage(
+                theGuard.get(),
+                XalanMessages::FunctionRequiresNonNullContextNode_1Param,
+                "generate-id()"),
+            locator,
+            context);
 
         return XObjectPtr();
     }
     else
     {
-        XPathExecutionContext::GetAndReleaseCachedString    theID(executionContext);
+        GetCachedString     theID(executionContext);
 
         theID.get() = XalanUnicode::charLetter_N;
 

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionKey.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionKey.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionKey.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionKey.cpp Sun Aug 31 23:42:06 2008
@@ -104,15 +104,17 @@
 
     if (context == 0)
     {
-        XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
+        const GetCachedString   theGuard(executionContext);
 
-        executionContext.error(
+        executionContext.problem(
+            XPathExecutionContext::eXPath,
+            XPathExecutionContext::eError,
             XalanMessageLoader::getMessage(
                 theGuard.get(),
                 XalanMessages::FunctionRequiresNonNullContextNode_1Param,
                 "key()"),
-            context,
-            locator);
+            locator,
+            context);
 
         return XObjectPtr();
     }
@@ -124,10 +126,8 @@
 
         assert(arg2.null() == false);
 
-        typedef XPathExecutionContext::BorrowReturnMutableNodeRefList   BorrowReturnMutableNodeRefList;
-
         // This list will hold the nodes...
-        BorrowReturnMutableNodeRefList  theNodeRefList(executionContext);
+        GetCachedNodeList   theNodeRefList(executionContext);
 
         if (arg2->getType() != XObject::eTypeNodeSet)
         {
@@ -157,7 +157,7 @@
             }
             else if (nRefs > 1)
             {
-                XPathExecutionContext::GetAndReleaseCachedString    theResult(executionContext);
+                const GetCachedString   theResult(executionContext);
 
                 XalanDOMString&     ref = theResult.get();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionSystemProperty.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionSystemProperty.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionSystemProperty.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionSystemProperty.cpp Sun Aug 31 23:42:06 2008
@@ -78,6 +78,7 @@
 
 
 
+
 inline void
 validateNCName(
             XPathExecutionContext&  executionContext,
@@ -87,15 +88,17 @@
 {
     if (XalanQName::isValidNCName(ncname) == false)
     {
-        XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
+        const Function::GetCachedString     theGuard(executionContext);
 
-        executionContext.error(
+        executionContext.problem(
+            XPathExecutionContext::eXPath,
+            XPathExecutionContext::eError,
             XalanMessageLoader::getMessage(
                 theGuard.get(),
                 XalanMessages::PropertyIsNotValidQName_1Param,
                 "system-property()"),
-            context,
-            locator);
+            locator,
+            context);
     }
 }
 
@@ -116,7 +119,7 @@
 
     if(indexOfNSSep < fullNameLength)
     {
-        XPathExecutionContext::GetAndReleaseCachedString    guard(executionContext);
+        const GetCachedString   guard(executionContext);
 
         XalanDOMString&     theBuffer = guard.get();
 
@@ -128,15 +131,17 @@
 
         if (nspace == 0)
         {
-            XPathExecutionContext::GetAndReleaseCachedString    theGuard(executionContext);
+            const GetCachedString   theGuard(executionContext);
 
-            executionContext.error(
+            executionContext.problem(
+                XPathExecutionContext::eXPath,
+                XPathExecutionContext::eError,
                 XalanMessageLoader::getMessage(
                     theGuard.get(),
                     XalanMessages::PrefixIsNotDeclared_1Param,
                     theBuffer),
-                context,
-                locator);
+                locator,
+                context);
         }
         else
         {
@@ -182,13 +187,13 @@
 
         if (theEnvString != 0)
         {
-            XPathExecutionContext::GetAndReleaseCachedString    guard(executionContext);
+            GetCachedString     theResult(executionContext);
 
-            XalanDOMString&     result = guard.get();
+            XalanDOMString&     theString = theResult.get();
 
-            TranscodeFromLocalCodePage(theEnvString, result);
+            TranscodeFromLocalCodePage(theEnvString, theString);
 
-            return executionContext.getXObjectFactory().createString(result);
+            return executionContext.getXObjectFactory().createString(theResult);
         }
     }
 

Modified: xalan/c/trunk/src/xalanc/XSLT/FunctionUnparsedEntityURI.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/FunctionUnparsedEntityURI.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/FunctionUnparsedEntityURI.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/FunctionUnparsedEntityURI.cpp Sun Aug 31 23:42:06 2008
@@ -58,15 +58,17 @@
 
     if (context == 0)
     {
-        XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+        const GetCachedString   theGuard(executionContext);
 
-        executionContext.error(
+        executionContext.problem(
+            XPathExecutionContext::eXPath,
+            XPathExecutionContext::eError,
             XalanMessageLoader::getMessage(
                 theGuard.get(),
                 XalanMessages::FunctionRequiresNonNullContextNode_1Param,
                 "unparsed-entity-uri"),
-            context,
-            locator);
+            locator,
+            context);
 
         return XObjectPtr();
     }

Modified: xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp Sun Aug 31 23:42:06 2008
@@ -297,7 +297,7 @@
         // able to use to look up the given node.
         const NodeRefListBase::size_type    nUseValues = nl.getLength();
 
-        StylesheetExecutionContext::GetAndReleaseCachedString   theGuard(executionContext);
+        const StylesheetExecutionContext::GetCachedString   theGuard(executionContext);
 
         XalanDOMString&     nodeData = theGuard.get();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.cpp Sun Aug 31 23:42:06 2008
@@ -393,19 +393,19 @@
 
 
 
+typedef StylesheetConstructionContext::GetCachedString  GetCachedString;
+
 void
 NamespacesHandler::processExcludeResultPrefixes(
         StylesheetConstructionContext&  theConstructionContext,
         const XalanDOMChar*             theValue,
         const NamespacesStackType&      theCurrentNamespaces)
 {
-    typedef StylesheetConstructionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
-
     StringTokenizer     tokenizer(
                     theValue,
                     Constants::DEFAULT_WHITESPACE_SEPARATOR_STRING);
 
-    const GetAndReleaseCachedString     theGuard(theConstructionContext);
+    const GetCachedString   theGuard(theConstructionContext);
 
     XalanDOMString&     thePrefix = theGuard.get();
 
@@ -423,13 +423,17 @@
 
         if(theNamespaceURI == 0)
         {
-            GetAndReleaseCachedString   theGuard(theConstructionContext);
+            const GetCachedString   theGuard(theConstructionContext);
 
-            theConstructionContext.error(
+            theConstructionContext.problem(
+                StylesheetConstructionContext::eXSLTProcessor,
+                StylesheetConstructionContext::eError,
                 XalanMessageLoader::getMessage(
                     theGuard.get(),
                     XalanMessages::PrefixIsNotDeclared_1Param,
-                    thePrefix));
+                    thePrefix),
+                theConstructionContext.getLocatorFromStack(),
+                0);
         }
 
         addOrUpdateByPrefix(
@@ -451,13 +455,11 @@
             const XalanDOMChar*             theValue,
             const NamespacesStackType&      theCurrentNamespaces)
 {
-    typedef StylesheetConstructionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
-
     StringTokenizer     tokenizer(
                     theValue,
                     Constants::DEFAULT_WHITESPACE_SEPARATOR_STRING);
 
-    const GetAndReleaseCachedString     theGuard(theConstructionContext);
+    const GetCachedString   theGuard(theConstructionContext);
 
     XalanDOMString&     thePrefix = theGuard.get();
 
@@ -475,13 +477,17 @@
 
         if(theNamespace == 0)
         {
-            GetAndReleaseCachedString   theGuard(theConstructionContext);
+            const GetCachedString   theGuard(theConstructionContext);
 
-            theConstructionContext.error(
+            theConstructionContext.problem(
+                StylesheetConstructionContext::eXSLTProcessor,
+                StylesheetConstructionContext::eError,
                 XalanMessageLoader::getMessage(
                     theGuard.get(),
                     XalanMessages::PrefixIsNotDeclared_1Param,
-                    thePrefix));
+                    thePrefix),
+                theConstructionContext.getLocatorFromStack(),
+                0);
         }
 
         assert(theNamespace != 0);
@@ -513,9 +519,7 @@
     // don't exclude its prefix.
     const XalanDOMString::size_type     indexOfNSSep = indexOf(theElementName, XalanUnicode::charColon);
 
-    typedef StylesheetConstructionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
-
-    const GetAndReleaseCachedString     theGuard(theConstructionContext);
+    const GetCachedString   theGuard(theConstructionContext);
 
     XalanDOMString&     thePrefix = theGuard.get();
 
@@ -705,8 +709,8 @@
         NamespaceExtendedVectorType::iterator       i =
                 m_namespaceDeclarations.begin();
 
-        StylesheetConstructionContext::GetAndReleaseCachedString theGuard(theConstructionContext);
-        XalanDOMString& theName = theGuard.get();
+        const GetCachedString   theGuard(theConstructionContext);
+        XalanDOMString&     theName = theGuard.get();
 
         for(; i != theEnd; ++i)
         {

Modified: xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/NamespacesHandler.hpp Sun Aug 31 23:42:06 2008
@@ -206,7 +206,7 @@
 	 * Create a default, empty instance.
 	 */
 	explicit
-	NamespacesHandler(MemoryManagerType& theManager);
+	NamespacesHandler(MemoryManager&    theManager);
 
 	/**
 	 * Create an instance namespace handler using the

Modified: xalan/c/trunk/src/xalanc/XSLT/NodeSorter.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/NodeSorter.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/NodeSorter.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/NodeSorter.cpp Sun Aug 31 23:42:06 2008
@@ -242,13 +242,13 @@
 			const PrefixResolver&	thePrefixResolver,
 			XPathExecutionContext&	theExecutionContext)
 {
-	typedef XPathExecutionContext::GetAndReleaseCachedString	GetAndReleaseCachedString;
+	typedef XPathExecutionContext::GetCachedString  GetCachedString;
 
 	if (theXPath == 0)
 	{
 		assert(theNode != 0);
 
-		const GetAndReleaseCachedString		temp(theExecutionContext);
+		const GetCachedString   temp(theExecutionContext);
 
 		DOMServices::getNodeData(*theNode, theExecutionContext, temp.get());
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ProblemListener.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ProblemListener.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ProblemListener.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ProblemListener.cpp Sun Aug 31 23:42:06 2008
@@ -15,9 +15,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * @author David N. Bertoni (david_n_bertoni@lotus.com)
- */
 
 
 
@@ -26,6 +23,11 @@
 
 
 
+// Necessary for the static asserts below...
+#include "xalanc/XPath/XPathEnvSupport.hpp"
+
+
+
 XALAN_CPP_NAMESPACE_BEGIN
 
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ProblemListener.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ProblemListener.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ProblemListener.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ProblemListener.hpp Sun Aug 31 23:42:06 2008
@@ -21,11 +21,11 @@
 
 
 // Base include file.  Must be first.
-#include <xalanc/XSLT/XSLTDefinitions.hpp>
+#include "xalanc/XSLT/XSLTDefinitions.hpp"
 
 
 
-#include <xalanc/XalanDOM/XalanDOMString.hpp>
+#include "xalanc/PlatformSupport/ProblemListenerBase.hpp"
 
 
 
@@ -45,38 +45,44 @@
  * should ask the XSLTProcessor class to setProblemListener if they wish an
  * object instance to be called when a problem event occurs.
  */
-class XALAN_XSLT_EXPORT ProblemListener
+class XALAN_XSLT_EXPORT ProblemListener : public ProblemListenerBase
 {
 public:
 
-	/// Sources of problem
-	enum eProblemSource { eXMLPARSER		= 0,
-						  eXSLPROCESSOR		= 1,
-						  eXPATH			= 2,
-                          eSourceCount };
-
-	/// Severity of problem
-	enum eClassification {	eMESSAGE	= 0,
-							eWARNING	= 1,
-							eERROR		= 2,
-                            eClassificationCount };
+    // A typedef for compatibility.
+    typedef eSource    eProblemSource;
 
 	ProblemListener();
 
 	virtual
 	~ProblemListener();
 
-	/** 
-	 * Set the print writer to which the problem is reported.
-	 * 
-	 * @param pw writer to receive messages
-	 */
+    // These interfaces are inherited from ProblemListenerBase...
 	virtual void
 	setPrintWriter(PrintWriter*		pw) = 0;
 
-	/**
- 	 * Function that is called when a problem event occurs.
-     * 
+	virtual void
+	problem(
+			eSource		            source,
+			eClassification			classification,
+			const XalanDOMString&	msg,
+            const Locator*          locator,
+			const XalanNode*		sourceNode) = 0;
+
+	virtual void
+	problem(
+            eSource                 source,
+            eClassification         classification,
+			const XalanDOMString&	msg,
+			const XalanNode*		sourceNode) = 0;
+
+
+    // This interface is new to ProblemListenerBase...
+    /**
+ 	 * Function that is called when a problem event occurs.  This function
+     * is deprecated. Use the overload with the Locator parameter instead.
+     * @deprecated
+     *
      * @param   source         either eXMLPARSER, eXSLPROCESSOR, or eXPATH
      * @param   classification either eMESSAGE, eERROR or eWARNING
 	 * @param   sourceNode     source tree node where the problem occurred
@@ -90,7 +96,7 @@
 	 */
 	virtual void
 	problem(
-			eProblemSource				source,
+			eSource				        source,
 			eClassification				classification,
 			const XalanNode*			sourceNode,
 			const ElemTemplateElement*	styleNode,
@@ -98,7 +104,6 @@
 			const XalanDOMChar*			uri,
 			XalanFileLoc				lineNo,
 			XalanFileLoc				charOffset) = 0;
-
 };
 
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.cpp Sun Aug 31 23:42:06 2008
@@ -34,38 +34,21 @@
 
 
 
-#include <xalanc/XSLT/ElemTemplateElement.hpp>
+#include <xalanc/XPath/XPathEnvSupport.hpp>
 
 
 
-XALAN_CPP_NAMESPACE_BEGIN
+#include <xalanc/XSLT/ElemTemplateElement.hpp>
 
 
 
-static const XalanMessages::Codes s_messageCodes[ProblemListener::eSourceCount][ProblemListener::eClassificationCount] =
-{
-    {
-        XalanMessages::XMLMessage,
-        XalanMessages::XMLWarning,
-        XalanMessages::XMLError,
-    },
-    {
-        XalanMessages::XSLTMessage,
-        XalanMessages::XSLTWarning,
-        XalanMessages::XSLTError,
-    },
-    {
-        XalanMessages::XPathMessage,
-        XalanMessages::XPathWarning,
-        XalanMessages::XPathError,
-    }
-};
+XALAN_CPP_NAMESPACE_BEGIN
 
 
 
 ProblemListenerDefault::ProblemListenerDefault(
-            MemoryManagerType&  theManager,
-            PrintWriter*        pw) :
+            MemoryManager&  theManager,
+            PrintWriter*    pw) :
     ProblemListener(),
     m_memoryManager(theManager),
     m_pw(pw)
@@ -90,7 +73,7 @@
 
 void
 ProblemListenerDefault::problem(
-            eProblemSource              source,
+            eSource                     source,
             eClassification             classification,
             const XalanNode*            sourceNode,
             const ElemTemplateElement*  styleNode,
@@ -101,7 +84,7 @@
 {
     if (m_pw != 0)
     {
-        problem(
+        defaultFormat(
             *m_pw,
             source,
             classification,
@@ -118,8 +101,50 @@
 
 void
 ProblemListenerDefault::problem(
+            eSource                 source,
+            eClassification         classification,
+            const XalanDOMString&   msg,
+            const Locator*          locator,
+            const XalanNode*        sourceNode)
+{
+    if (m_pw != 0)
+    {
+        ProblemListener::defaultFormat(
+            *m_pw,
+            source,
+            classification,
+            msg,
+            locator,
+            sourceNode);
+    }
+}
+
+
+
+void
+ProblemListenerDefault::problem(
+            eSource                 source,
+            eClassification         classification,
+            const XalanDOMString&   msg,
+            const XalanNode*        sourceNode)
+{
+    if (m_pw != 0)
+    {
+        ProblemListener::defaultFormat(
+                *m_pw,
+                source,
+                classification,
+                msg,
+                sourceNode);
+    }
+}
+
+
+
+void
+ProblemListenerDefault::defaultFormat(
             PrintWriter&                pw,
-            eProblemSource              source,
+            eSource                     source,
             eClassification             classification,
             const XalanNode*            sourceNode,
             const ElemTemplateElement*  styleNode,

Modified: xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ProblemListenerDefault.hpp Sun Aug 31 23:42:06 2008
@@ -30,10 +30,18 @@
 
 
 
+XALAN_DECLARE_XERCES_CLASS(MemoryManager)
+
+
+
 XALAN_CPP_NAMESPACE_BEGIN
 
 
 
+XALAN_USING_XERCES(MemoryManager)
+
+
+
 /**
  * The implementation of the default error handling for Xalan.
  */
@@ -48,14 +56,30 @@
 	virtual
 	~ProblemListenerDefault();
 
-	// These methods are inherited from ProblemListener ...
+
+    // These methods are inherited from ProblemListener ...
 
 	virtual void
 	setPrintWriter(PrintWriter*		pw);
 
 	virtual void
 	problem(
-			eProblemSource				source,
+            eSource                 source,
+			eClassification			classification,
+			const XalanDOMString&	msg,
+            const Locator*          locator,
+			const XalanNode*		sourceNode);
+
+	virtual void
+	problem(
+            eSource                 source,
+            eClassification         classification,
+			const XalanDOMString&	msg,
+			const XalanNode*		sourceNode);
+
+	virtual void
+	problem(
+            eSource                     source,
 			eClassification				classification, 
 			const XalanNode*			sourceNode,
 			const ElemTemplateElement*	styleNode,
@@ -73,9 +97,9 @@
 	}
 
 	static void
-	problem(
-			PrintWriter&				pw,
-			eProblemSource				source,
+	defaultFormat(
+			PrintWriter&		        pw,
+            eSource                     source,
 			eClassification				classification,
 			const XalanNode*			sourceNode,
 			const ElemTemplateElement*	styleNode,
@@ -84,6 +108,10 @@
 			XalanFileLoc				lineNo,
 			XalanFileLoc				charOffset);
 
+#if !defined(XALAN_NO_USING_DECLARATION)
+	using ProblemListenerBase::defaultFormat;
+#endif
+
 private:
 
     MemoryManager&  m_memoryManager;

Modified: xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp Sun Aug 31 23:42:06 2008
@@ -30,11 +30,9 @@
 
 
 #include <xalanc/Include/STLHelper.hpp>
+#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
-#include <xalanc/Include/XalanMemMngArrayAllocate.hpp>
-
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 #include <xalanc/XalanDOM/XalanDOMException.hpp>
 
@@ -128,9 +126,9 @@
     {
         try
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
+            const GetCachedString   theGuard(constructionContext);
 
-            XalanDOMString& urlString = theGuard.get();
+            XalanDOMString&     urlString = theGuard.get();
 
             constructionContext.getURLStringFromString(m_baseIdent, urlString);
 
@@ -201,6 +199,32 @@
 
 
 
+void
+Stylesheet::error(
+            StylesheetConstructionContext&  theContext,
+            XalanMessages::Codes            theErrorCode,
+            const Locator*                  theLocator,
+            const XalanDOMChar*             theParam1,
+            const XalanDOMChar*             theParam2,
+            const XalanDOMChar*             theParam3) const
+{
+    const GetCachedString   theGuard(theContext);
+
+    theContext.problem(
+        StylesheetConstructionContext::eXSLTProcessor,
+        StylesheetConstructionContext::eError,
+        XalanMessageLoader::getMessage(
+            theGuard.get(),
+            theErrorCode,
+            theParam1,
+            theParam2,
+            theParam3),
+        theLocator,
+        0);
+}
+
+
+
 ElemTemplateElement*
 Stylesheet::initWrapperless(
             StylesheetConstructionContext&  constructionContext,
@@ -208,13 +232,9 @@
 {
     if (m_isWrapperless == true)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::StylesheetHasWrapperlessTemplate),
-            0,
+        error(
+            constructionContext,
+            XalanMessages::StylesheetHasWrapperlessTemplate,
             locator);
     }
 
@@ -266,25 +286,24 @@
         {
             theQName = constructionContext.createXalanQName(atts.getValue(i), m_namespaces, locator);
 
+            // $$$TODO: It's not clear of this code will ever be executed, since
+            // constructing an invalid QName is not possibly right now.
+            assert(theQName->isValid() == true);
             if (theQName->isValid() == false)
             {
-                const GetAndReleaseCachedString     theGuard(constructionContext);
-
-                constructionContext.error(
-                        XalanMessageLoader::getMessage(
-                            theGuard.get(),
-                            XalanMessages::AttributeValueNotValidQName_2Param,
-                            Constants::ATTRNAME_NAME.c_str(),
-                            atts.getValue(i)),
-                        0,
-                        locator);
+                error(
+                    constructionContext,
+                    XalanMessages::AttributeValueNotValidQName_2Param,
+                    locator,
+                    Constants::ATTRNAME_NAME.c_str(),
+                    atts.getValue(i));
             }
         }
         else if(equals(aname, Constants::ATTRNAME_MATCH))
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
+            const GetCachedString   theGuard(constructionContext);
 
-            XalanDOMString& theBuffer = theGuard.get();
+            XalanDOMString&     theBuffer = theGuard.get();
 
             theBuffer.assign(atts.getValue(i));
 
@@ -308,59 +327,43 @@
         }
         else if (isAttrOK(aname, atts, i, constructionContext) == false)
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
-
-            constructionContext.error(
-                XalanMessageLoader::getMessage(
-                    theGuard.get(),
-                    XalanMessages::ElementHasIllegalAttribute_2Param,
-                    Constants::ELEMNAME_KEY_WITH_PREFIX_STRING.c_str(),
-                    aname),
-                0,
-                locator);
+            error(
+                constructionContext,
+                XalanMessages::ElementHasIllegalAttribute_2Param,
+                locator,
+                Constants::ELEMNAME_KEY_WITH_PREFIX_STRING.c_str(),
+                aname);
         }
     }
 
     if (0 == theQName)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::ElementRequiresAttribute_2Param,
-                Constants::ELEMNAME_KEY_WITH_PREFIX_STRING,
-                Constants::ATTRNAME_NAME),
-            0,
-            locator);
+        error(
+            constructionContext,
+            XalanMessages::ElementRequiresAttribute_2Param,
+            locator,
+            Constants::ELEMNAME_KEY_WITH_PREFIX_STRING.c_str(),
+            Constants::ATTRNAME_NAME.c_str());
     }
 
     if (0 == matchAttr)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::ElementRequiresAttribute_2Param,
-                Constants::ELEMNAME_KEY_WITH_PREFIX_STRING,
-                Constants::ATTRNAME_MATCH),
-            0,
-            locator);
+        error(
+            constructionContext,
+            XalanMessages::ElementRequiresAttribute_2Param,
+            locator,
+            Constants::ELEMNAME_KEY_WITH_PREFIX_STRING.c_str(),
+            Constants::ATTRNAME_MATCH.c_str());
     }
 
     if (0 == useAttr)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::ElementRequiresAttribute_2Param,
-                Constants::ELEMNAME_KEY_WITH_PREFIX_STRING,
-                Constants::ATTRNAME_USE),
-            0,
-            locator);
+        error(
+            constructionContext,
+            XalanMessages::ElementRequiresAttribute_2Param,
+            locator,
+            Constants::ELEMNAME_KEY_WITH_PREFIX_STRING.c_str(),
+            Constants::ATTRNAME_USE.c_str());
     }
 
     m_keyDeclarations.push_back(
@@ -646,7 +649,7 @@
 
         if(indexOfNSSep < length(attrName))
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
+            const GetCachedString   theGuard(constructionContext);
 
             XalanDOMString&     prefix = theGuard.get();
 
@@ -698,13 +701,11 @@
 
     if (theURI == 0)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::PrefixIsNotDeclared_1Param,
-                prefix));
+        error(
+            constructionContext,
+            XalanMessages::PrefixIsNotDeclared_1Param,
+            constructionContext.getLocatorFromStack(),
+            prefix.c_str());
     }
 
     return theURI;
@@ -717,7 +718,7 @@
             const XalanDOMChar*             prefix,
             StylesheetConstructionContext&  constructionContext) const
 {
-    const GetAndReleaseCachedString     theGuard(constructionContext);
+    const GetCachedString   theGuard(constructionContext);
 
     XalanDOMString&     theTemp = theGuard.get();
 
@@ -730,7 +731,7 @@
 
 bool
 Stylesheet::getYesOrNo(
-            const XalanDOMChar*             /* aname */,
+            const XalanDOMChar*             aname,
             const XalanDOMChar*             val,
             StylesheetConstructionContext&  constructionContext) const
 {
@@ -744,14 +745,13 @@
     }
     else
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(), 
-                XalanMessages::AttributeMustBe_2Params,
-                Constants::ATTRVAL_YES,
-                Constants::ATTRVAL_NO));
+        error(
+            constructionContext,
+            XalanMessages::AttributeMustBe_3Params,
+            constructionContext.getLocatorFromStack(),
+            aname,
+            Constants::ATTRVAL_YES.c_str(),
+            Constants::ATTRVAL_NO.c_str());
 
         return false;
     }
@@ -770,21 +770,17 @@
     {
         if (m_firstTemplate != 0)
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
-
-            constructionContext.error(
-                XalanMessageLoader::getMessage(
-                    theGuard.get(),
-                    XalanMessages::StylesheetHasWrapperlessTemplate),
-                0,
-                theTemplate);
+            error(
+                constructionContext,
+                XalanMessages::StylesheetHasWrapperlessTemplate,
+                theTemplate->getLocator());
         }
         else
         {
             m_firstTemplate = theTemplate;
         }
     }
-    else if(0 == m_firstTemplate)
+    else if (0 == m_firstTemplate)
     {
         m_firstTemplate = theTemplate;
     }
@@ -793,9 +789,9 @@
         ElemTemplateElement*    next = m_firstTemplate;
 
         // Find the last one, then append the new one.
-        while(0 != next)
+        while (0 != next)
         {
-            if(0 == next->getNextSiblingElem())
+            if (0 == next->getNextSiblingElem())
             {
                 next->setNextSiblingElem(theTemplate);
                 theTemplate->setNextSiblingElem(0); // just to play it safe.
@@ -811,7 +807,7 @@
     // and it to the map of named templates.
     const XalanQName&   theName = theTemplate->getNameAttribute();
 
-    if(theName.isEmpty() == false)
+    if (theName.isEmpty() == false)
     {
         if (m_namedTemplates.find(theName) == m_namedTemplates.end())
         {
@@ -819,15 +815,13 @@
         }
         else
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
+            const GetCachedString   theGuard(constructionContext);
 
-            // This is an error...
-            constructionContext.error(
-                XalanMessageLoader::getMessage(
-                    theGuard.get(),
-                    XalanMessages::StylesheetHasDuplicateNamedTemplate),
-                0,
-                theTemplate);
+            error(
+                constructionContext,
+                XalanMessages::StylesheetHasDuplicateNamedTemplate_1Param,
+                theTemplate->getLocator(),
+                theName.format(theGuard.get()).c_str());
         }
     }
 
@@ -835,7 +829,7 @@
     // template.
     const XPath* const  xp = theTemplate->getMatchPattern();
 
-    if(0 != xp)
+    if (0 != xp)
     {
         /* Each string has a list of pattern tables associated with it; if the
          * string is not in the map, then create a list of pattern tables with one
@@ -851,14 +845,13 @@
         TargetDataVectorType::size_type nTargets =
                 data.size();
 
-        if(nTargets != 0)
+        if (nTargets != 0)
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
+            const GetCachedString   theGuard(constructionContext);
 
             XalanDOMString& tempString = theGuard.get();
 
-            for(TargetDataVectorType::size_type i = 0;
-                                i < nTargets; ++i) 
+            for (TargetDataVectorType::size_type i = 0; i < nTargets; ++i) 
             {
                 assert(data[i].getString() != 0);
                 
@@ -1193,7 +1186,7 @@
             const PatternTableVectorType::const_iterator    theTableEnd =
                     matchPatternList->end();
 
-            while(theCurrentEntry != theTableEnd)
+            while (theCurrentEntry != theTableEnd)
             {
                 const XalanMatchPatternData*    matchPat = *theCurrentEntry;
                 assert(matchPat != 0);
@@ -1261,7 +1254,7 @@
                 // Use a stack-based array when possible...
                 const XalanMatchPatternData*    conflictsArray[100];
 
-                XalanMemMgrAutoPtr<const XalanMatchPatternData*, true>      conflictsVector;
+                XalanVector<const XalanMatchPatternData*>   conflictsVector(executionContext.getMemoryManager());
 
                 const XalanMatchPatternData**   conflicts = 0;
 
@@ -1335,12 +1328,9 @@
                                     {
                                         if (m_patternCount > sizeof(conflictsArray) / sizeof(conflictsArray[0]))
                                         {
-                                            typedef XalanMemMngArrayAllocate<const XalanMatchPatternData*> ArrayAllocator;
-                                            //conflictsVector.reset(new const XalanMatchPatternData*[m_patternCount]);
-                                            conflictsVector.reset( &( executionContext.getMemoryManager()),
-                                                                      ArrayAllocator::allocate(m_patternCount, executionContext.getMemoryManager()));
+                                            conflictsVector.resize(m_patternCount);
 
-                                            conflicts = conflictsVector.get();
+                                            conflicts = conflictsVector.begin();
                                         }
                                         else
                                         {
@@ -1381,18 +1371,20 @@
 
                     bestMatchedRule = bestMatchedPattern->getTemplate();
 
-                    const XPathExecutionContext::GetAndReleaseCachedString  theGuard(executionContext);
+                    const StylesheetExecutionContext::GetCachedString   theGuard(executionContext);
 
-                    executionContext.warn(
+                    executionContext.problem(
+                        StylesheetExecutionContext::eXSLTProcessor,
+                        StylesheetExecutionContext::eWarning,
                         XalanMessageLoader::getMessage(
                             theGuard.get(),
                             XalanMessages::ConflictsFound),
-                        targetNode,
-                        bestMatchedRule->getLocator());
+                        bestMatchedRule->getLocator(),
+                        targetNode);
                 }
             }
 
-            if(0 == bestMatchedRule)
+            if (0 == bestMatchedRule)
             {
                 bestMatchedRule = findTemplateInImports(executionContext, targetNode, targetNodeType, mode);
             }
@@ -1430,7 +1422,7 @@
         // First, push any imports...
         const StylesheetVectorType::const_reverse_iterator  rend = m_imports.rend();
 
-        for(StylesheetVectorType::const_reverse_iterator i = m_imports.rbegin(); i != rend; ++i)
+        for (StylesheetVectorType::const_reverse_iterator i = m_imports.rbegin(); i != rend; ++i)
         {
             const Stylesheet* const stylesheet = *i;
             assert(stylesheet != 0);
@@ -1441,7 +1433,7 @@
 
     const ParamVectorType::size_type    nVars = m_topLevelVariables.size();
 
-    for(ParamVectorType::size_type i = 0; i < nVars; ++i)
+    for (ParamVectorType::size_type i = 0; i < nVars; ++i)
     {
         ElemVariable* const     var = m_topLevelVariables[i];
 
@@ -1510,42 +1502,52 @@
     {
         const XalanDOMChar* const   aname = atts.getName(i);
 
-        if (equals(aname, Constants::ATTRNAME_STYLESHEET_PREFIX) == true)
+        if (aname == Constants::ATTRNAME_STYLESHEET_PREFIX)
         {
             const XalanDOMChar* const   value = atts.getValue(i);
 
             if (equals(value, Constants::ATTRVAL_DEFAULT_PREFIX) == true)
             {
-                stylesheetNamespace = getNamespaceForPrefix(DOMServices::s_emptyString, constructionContext);
+                stylesheetNamespace =
+                    getNamespaceForPrefix(
+                        DOMServices::s_emptyString,
+                        constructionContext);
             }
             else
             {
-                stylesheetNamespace = getNamespaceForPrefix(value, constructionContext);
+                stylesheetNamespace =
+                    getNamespaceForPrefix(
+                        value,
+                        constructionContext);
             }
         }
-        else if (equals(aname, Constants::ATTRNAME_RESULT_PREFIX))
+        else if (aname == Constants::ATTRNAME_RESULT_PREFIX)
         {
             const XalanDOMChar* const   value = atts.getValue(i);
 
             if (equals(value, Constants::ATTRVAL_DEFAULT_PREFIX) == true)
             {
-                resultNamespace = getNamespaceForPrefix(DOMServices::s_emptyString, constructionContext);
+                resultNamespace =
+                    getNamespaceForPrefix(
+                        DOMServices::s_emptyString,
+                        constructionContext);
             }
             else
             {
-                resultNamespace = getNamespaceForPrefix(value, constructionContext);
+                resultNamespace =
+                    getNamespaceForPrefix(
+                        value,
+                        constructionContext);
             }
         }
         else if (!isAttrOK(aname, atts, i, constructionContext))
         {
-            const GetAndReleaseCachedString     theGuard(constructionContext);
-
-            constructionContext.error(
-                XalanMessageLoader::getMessage(
-                    theGuard.get(),
-                    XalanMessages::ElementHasIllegalAttribute_2Param,
-                    name,
-                    aname));
+            error(
+                constructionContext,
+                XalanMessages::ElementHasIllegalAttribute_2Param,
+                constructionContext.getLocatorFromStack(),
+                name,
+                aname);
         }
     }
 
@@ -1553,25 +1555,21 @@
     // value is the result uri
     if (stylesheetNamespace == 0)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::ElementMustHaveAttribute_2Param,
-                name,
-                Constants::ATTRNAME_STYLESHEET_PREFIX.c_str()));
+        error(
+            constructionContext,
+            XalanMessages::ElementMustHaveAttribute_2Param,
+            constructionContext.getLocatorFromStack(),
+            name,
+            Constants::ATTRNAME_STYLESHEET_PREFIX.c_str());
     }
     else if (resultNamespace == 0)
     {
-        const GetAndReleaseCachedString     theGuard(constructionContext);
-
-        constructionContext.error(
-            XalanMessageLoader::getMessage(
-                theGuard.get(),
-                XalanMessages::ElementMustHaveAttribute_2Param,
-                name,
-                Constants::ATTRNAME_RESULT_PREFIX.c_str()));
+        error(
+            constructionContext,
+            XalanMessages::ElementMustHaveAttribute_2Param,
+            constructionContext.getLocatorFromStack(),
+            name,
+            Constants::ATTRNAME_RESULT_PREFIX.c_str());
     }
     else
     {
@@ -1624,7 +1622,7 @@
     const ElemDecimalFormatVectorType::size_type    theSize =
         m_elemDecimalFormats.size();
 
-    if(theSize > 0)
+    if (theSize > 0)
     {
         // Start from the top of the stack
         for (ElemDecimalFormatVectorType::size_type i = theSize; i > 0; --i)
@@ -1649,13 +1647,13 @@
     // with the given name. So go up the import hierarchy
     // and see if one of the imported stylesheets declared
     // it.
-    if(dfs == 0)
+    if (dfs == 0)
     {
-        for(StylesheetVectorType::size_type i = 0; i < m_importsSize; ++i)
+        for (StylesheetVectorType::size_type i = 0; i < m_importsSize; ++i)
         {
             dfs = m_imports[i]->getDecimalFormatSymbols(theQName);
 
-            if(dfs != 0)
+            if (dfs != 0)
             {
                 break;
             }

Modified: xalan/c/trunk/src/xalanc/XSLT/Stylesheet.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/Stylesheet.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/Stylesheet.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/Stylesheet.hpp Sun Aug 31 23:42:06 2008
@@ -109,7 +109,7 @@
 
     typedef XalanMap<XalanDOMString, PatternTableVectorType> PatternTableMapType;
 
-    typedef StylesheetConstructionContext::GetAndReleaseCachedString    GetAndReleaseCachedString;
+    typedef StylesheetConstructionContext::GetCachedString  GetCachedString;
 
     /**
      * Constructor for a Stylesheet needs a Document.
@@ -744,6 +744,14 @@
     bool
     operator==(const Stylesheet&) const;
 
+    void
+    error(
+            StylesheetConstructionContext&  theContext,
+            XalanMessages::Codes            theErrorCode,
+            const Locator*                  theLocator,
+            const XalanDOMChar*             theParam1 = 0,
+            const XalanDOMChar*             theParam2 = 0,
+            const XalanDOMChar*             theParam3 = 0) const;
 
     /**
      * Given a target element, find the template that best matches in the given

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContext.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContext.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContext.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContext.hpp Sun Aug 31 23:42:06 2008
@@ -160,13 +160,39 @@
 	~StylesheetConstructionContext();
 
 
-	/**
-	 * Reset the StylesheetConstructionContext instance.  Any existing objects
-	 * created by the instance will be destroyed.
-	 */
+	// These are inherited from XPathConstructionContext...
+	virtual void
+	problem(
+			eSource		            source,
+			eClassification			classification,
+			const XalanDOMString&	msg,
+            const Locator*          locator,
+			const XalanNode*		sourceNode) = 0;
+
+	virtual void
+	problem(
+            eSource                 source,
+            eClassification         classification,
+			const XalanDOMString&	msg,
+			const XalanNode*		sourceNode) = 0;
+
 	virtual void
 	reset() = 0;
 
+	virtual const XalanDOMString&
+	getPooledString(const XalanDOMString&	theString) = 0;
+
+	virtual const XalanDOMString&
+	getPooledString(
+			const XalanDOMChar*			theString,
+			XalanDOMString::size_type	theLength = XalanDOMString::npos) = 0;
+
+	virtual XalanDOMString&
+	getCachedString() = 0;
+
+	virtual bool
+	releaseCachedString(XalanDOMString&		theString) = 0;
+
 	/**
 	 * Create a new StylesheetRoot instance.  The StylesheetConstructionContext
 	 * instance owns the StylesheetRoot instance, and will delete it when asked
@@ -406,7 +432,8 @@
 	parseXML(
 			const XalanDOMString&	urlString,
 			DocumentHandler*	    docHandler, 
-			XalanDocument*			docToRegister) = 0;
+			XalanDocument*			docToRegister,
+            ErrorHandler*           theErrorHandler = 0) = 0;
 
 	/**
 	 * Given an name, determine if it is the xml:space attribute
@@ -471,20 +498,6 @@
 	virtual double
 	getXSLTVersionSupported() const = 0;
 
-	virtual const XalanDOMString&
-	getPooledString(const XalanDOMString&	theString) = 0;
-
-	virtual const XalanDOMString&
-	getPooledString(
-			const XalanDOMChar*			theString,
-			XalanDOMString::size_type	theLength = XalanDOMString::npos) = 0;
-
-	virtual XalanDOMString&
-	getCachedString() = 0;
-
-	virtual bool
-	releaseCachedString(XalanDOMString&		theString) = 0;
-
 	/**
 	 * Allocate a vector of XalanDOMChar of the specified
 	 * size.
@@ -710,7 +723,7 @@
 			const XalanDOMChar*		name,
 			const AttributeList&	atts,
 			ExtensionNSHandler&		handler,
-			const Locator*			   locator = 0) = 0;
+			const Locator*			locator = 0) = 0;
 
 	/**
 	 * Create an instance of XalanMatchPatternData, which describes
@@ -736,45 +749,6 @@
             const XPath&            theMatchPattern,
             const XalanDOMString&   thePatternString,
             XPath::eMatchScore      thePriority) = 0;
-
-
-	// These are inherited from XPathConstructionContext...
-
-	virtual void
-	error(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement*	styleNode = 0) const = 0;
-
-	virtual void
-	error(
-			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const Locator* 		    locator) const = 0;
-
-	virtual void
-	warn(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement* 	styleNode = 0) const = 0;
-
-	virtual void
-	warn(
-			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const Locator* 		    locator) const = 0;
-
-	virtual void
-	message(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement* 	styleNode = 0) const = 0;
-
-	virtual void
-	message(
-			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const Locator* 		    locator) const = 0;
 };
 
 

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.cpp Sun Aug 31 23:42:06 2008
@@ -167,92 +167,40 @@
 
 
 void
-StylesheetConstructionContextDefault::error(
-            const XalanDOMString&       msg,
-            const XalanNode*            sourceNode,
-            const ElemTemplateElement*  styleNode) const
-{
-    m_processor.error(msg, sourceNode, styleNode);
-}
-
-
-
-void
-StylesheetConstructionContextDefault::error(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode,
-            const LocatorType*      locator) const
-{
-    if (locator != 0)
-    {
-        m_processor.error(msg, *locator, sourceNode);
-    }
-    else
-    {
-        m_processor.error(msg, sourceNode);
-    }
+StylesheetConstructionContextDefault::problem(
+			eSource		            source,
+			eClassification			classification,
+			const XalanDOMString&	msg,
+            const Locator*          locator,
+			const XalanNode*		sourceNode)
+{
+    m_processor.problem(
+        source,
+        classification,
+        msg,
+        locator,
+        sourceNode);
 }
 
 
 
-
-void
-StylesheetConstructionContextDefault::warn(
-            const XalanDOMString&       msg,
-            const XalanNode*            sourceNode,
-            const ElemTemplateElement*  styleNode) const
-{
-    m_processor.warn(msg, sourceNode, styleNode);
-}
-
-
-
-void
-StylesheetConstructionContextDefault::warn(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode,
-            const LocatorType*      locator) const
-{
-    if (locator != 0)
-    {
-        m_processor.warn(msg, *locator, sourceNode);
-    }
-    else
-    {
-        m_processor.warn(msg, sourceNode);
-    }
-}
-
-
 void
-StylesheetConstructionContextDefault::message(
-            const XalanDOMString&       msg,
-            const XalanNode*            sourceNode,
-            const ElemTemplateElement*  styleNode) const
-{
-    m_processor.message(msg, sourceNode, styleNode);
+StylesheetConstructionContextDefault::problem(
+            eSource                 source,
+            eClassification         classification,
+			const XalanDOMString&	msg,
+			const XalanNode*		sourceNode)
+{
+    m_processor.problem(
+        source,
+        classification,
+        msg,
+        sourceNode);
 }
 
 
 
 void
-StylesheetConstructionContextDefault::message(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode,
-            const LocatorType*      locator) const
-{
-    if (locator != 0)
-    {
-        m_processor.message(msg, *locator, sourceNode);
-    }
-    else
-    {
-        m_processor.message(msg, sourceNode);
-    }
-}
-
-
-void
 StylesheetConstructionContextDefault::reset()
 {
     XALAN_USING_STD(for_each)
@@ -336,7 +284,7 @@
     const XMLCh* const  theSystemID =
                 theInputSource.getSystemId();
 
-    GetAndReleaseCachedString theGuard(*this);
+    const GetCachedString   theGuard(*this);
 
     XalanDOMString& theBaseIdentifier = theGuard.get();
 
@@ -405,8 +353,9 @@
 
 
 XalanDOMString&
-StylesheetConstructionContextDefault::getURLStringFromString(const XalanDOMString&  urlString,
-                                                             XalanDOMString&        theResult)
+StylesheetConstructionContextDefault::getURLStringFromString(
+            const XalanDOMString&  urlString,
+            XalanDOMString&        theResult)
 {
     URISupport::getURLStringFromString(
             urlString,
@@ -623,12 +572,14 @@
 StylesheetConstructionContextDefault::parseXML(
             const XalanDOMString&   urlString,
             DocumentHandler*        docHandler,
-            XalanDocument*          docToRegister)
+            XalanDocument*          docToRegister,
+            ErrorHandler*           theErrorHandler)
 {
     return m_processor.parseXML(
                 urlString,
                 docHandler,
-                docToRegister);
+                docToRegister,
+                theErrorHandler);
 }
 
 
@@ -1015,18 +966,20 @@
 
     default:
         {
-            const GetAndReleaseCachedString     theGuard1(*this);
-            const GetAndReleaseCachedString     theGuard2(*this);
+            const GetCachedString   theGuard1(*this);
+            const GetCachedString   theGuard2(*this);
 
-            error(
+            problem(
+                eXSLTProcessor,
+                eError,
                 XalanMessageLoader::getMessage(
                     theGuard1.get(),
                     XalanMessages::UnknownXSLTToken_1Param,
                     NumberToDOMString(
                         token,
                         theGuard2.get())),
-                0,
-                locator);
+                locator,
+                0);
         }
         break;
     };
@@ -1083,18 +1036,20 @@
     }
     else
     {
-        const GetAndReleaseCachedString     theGuard1(*this);
-        const GetAndReleaseCachedString     theGuard2(*this);
+        const GetCachedString   theGuard1(*this);
+        const GetCachedString   theGuard2(*this);
 
-        error(
+        problem(
+            eXSLTProcessor,
+            eError,
             XalanMessageLoader::getMessage(
                 theGuard1.get(),
                 XalanMessages::UnknownXSLTToken_1Param,
                 NumberToDOMString(
                     token,
                     theGuard2.get())),
-            0,
-            locator);
+            locator,
+            0);
     }
 
     return theElement;
@@ -1418,7 +1373,7 @@
             doAllocateXalanQNamePointerVector(count);
         assert(theResult != 0);
 
-        const GetAndReleaseCachedString     theGuard(*this);
+        const GetCachedString   theGuard(*this);
 
         XalanDOMString&     qname = theGuard.get();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp Sun Aug 31 23:42:06 2008
@@ -156,46 +156,39 @@
 	~StylesheetConstructionContextDefault();
 
 
-	virtual void
-	error(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement*	styleNode = 0) const;
+    // These interfaces are inherited from StylesheetConstructionContext...
 
 	virtual void
-	error(
+	problem(
+			eSource		            source,
+			eClassification			classification,
 			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const LocatorType* 		locator) const;
-
-	virtual void
-	warn(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement* 	styleNode = 0) const;
+            const Locator*          locator,
+			const XalanNode*		sourceNode);
 
 	virtual void
-	warn(
+	problem(
+            eSource                 source,
+            eClassification         classification,
 			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const LocatorType* 		locator) const;
+			const XalanNode*		sourceNode);
 
-	virtual void
-	message(
-			const XalanDOMString&		msg,
-			const XalanNode* 			sourceNode = 0,
-			const ElemTemplateElement* 	styleNode = 0) const;
+    virtual void
+	reset();
 
-	virtual void
-	message(
-			const XalanDOMString&	msg,
-			const XalanNode* 		sourceNode,
-			const LocatorType*		locator) const;
+	virtual const XalanDOMString&
+	getPooledString(const XalanDOMString&	theString);
+
+	virtual const XalanDOMString&
+	getPooledString(
+			const XalanDOMChar*			theString,
+			XalanDOMString::size_type	theLength = XalanDOMString::npos);
 
-	// These interfaces are inherited from StylesheetConstructionContext...
+	virtual XalanDOMString&
+	getCachedString();
 
-	virtual void
-	reset();
+	virtual bool
+	releaseCachedString(XalanDOMString&		theString);
 
 	virtual StylesheetRoot*
 	create(const XalanDOMString&	theBaseIdentifier);
@@ -235,7 +228,7 @@
 
 	virtual XPath*
 	createMatchPattern(
-			const LocatorType*		locator,
+			const Locator*		    locator,
 			const XalanDOMString&	str,
 			const PrefixResolver&	resolver,
             bool                    allowVariableReferences = true,
@@ -243,7 +236,7 @@
 
 	virtual XPath*
 	createMatchPattern(
-			const LocatorType*		locator,
+			const Locator*		    locator,
 			const XalanDOMChar*		str,
 			const PrefixResolver&	resolver,
             bool                    allowVariableReferences = true,
@@ -251,7 +244,7 @@
 
 	virtual XPath*
 	createXPath(
-			const LocatorType*		locator,
+			const Locator*		    locator,
 			const XalanDOMString&	str,
 			const PrefixResolver&	resolver,
             bool                    allowVariableReferences = true,
@@ -259,7 +252,7 @@
 
 	virtual XPath*
 	createXPath(
-			const LocatorType*		locator,
+			const Locator*		    locator,
 			const XalanDOMChar*		str,
 			const PrefixResolver&	resolver,
             bool                    allowVariableReferences = true,
@@ -267,18 +260,18 @@
 
 	virtual XPath*
 	createXPath(
-			const LocatorType*			locator,
+			const Locator*			    locator,
 			const XalanDOMChar*			str,
 			XalanDOMString::size_type	len,
 			const PrefixResolver&		resolver,
             bool                        allowVariableReferences = true,
             bool                        allowKeyFunction = true);
 
-	virtual const LocatorType*
+	virtual const Locator*
 	getLocatorFromStack() const;
 
 	virtual void
-	pushLocatorOnStack(const LocatorType*	locator);
+	pushLocatorOnStack(const Locator*   locator);
 
 	virtual void
 	popLocatorStack();
@@ -290,7 +283,8 @@
 	parseXML(
 			const XalanDOMString&	urlString,
 			DocumentHandler*	    docHandler, 
-			XalanDocument*			docToRegister);
+			XalanDocument*			docToRegister,
+            ErrorHandler*           theErrorHandler = 0);
 
 	virtual bool
 	isXMLSpaceAttribute(
@@ -316,20 +310,6 @@
 	virtual double
 	getXSLTVersionSupported() const;
 
-	virtual const XalanDOMString&
-	getPooledString(const XalanDOMString&	theString);
-
-	virtual const XalanDOMString&
-	getPooledString(
-			const XalanDOMChar*			theString,
-			XalanDOMString::size_type	theLength = XalanDOMString::npos);
-
-	virtual XalanDOMString&
-	getCachedString();
-
-	virtual bool
-	releaseCachedString(XalanDOMString&		theString);
-
 	virtual XalanDOMChar*
 	allocateXalanDOMCharVector(XalanDOMString::size_type	theLength);
 

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp?rev=690861&r1=690860&r2=690861&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp Sun Aug 31 23:42:06 2008
@@ -41,11 +41,6 @@
 
 
 
-// Base class header file...
-#include <xalanc/PlatformSupport/ExecutionContext.hpp>
-
-
-
 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
 #include <xalanc/PlatformSupport/XalanNumberFormat.hpp>
 #endif
@@ -119,7 +114,9 @@
 #endif
 
     explicit
-    StylesheetExecutionContext(MemoryManagerType& m_memoryManager, XObjectFactory*  theXObjectFactory = 0);
+    StylesheetExecutionContext(
+            MemoryManager&      theMemoryManager,
+            XObjectFactory*     theXObjectFactory = 0);
 
     virtual
     ~StylesheetExecutionContext();
@@ -127,46 +124,6 @@
     // These interfaces are new...
 
     /**
-     * Report an error and throw an exception.
-     * 
-     * @param msg The text of the message.
-     * @param styleNode The stylesheet node were the error occurred.
-     * @param sourceNode The source node where the error occurred.  May be 0.
-     */
-    virtual void
-    error(
-            const XalanDOMString&       msg,
-            const ElemTemplateElement&  styleNode,
-            const XalanNode*            sourceNode = 0) const = 0;
-
-    /**
-     * Report a  warning.
-     * 
-     * @param msg The text of the message.
-     * @param styleNode The stylesheet node were the warning occurred.
-     * @param sourceNode The source node where the warning occurred.  May be 0.
-     */
-    virtual void
-    warn(
-            const XalanDOMString&       msg,
-            const ElemTemplateElement&  styleNode,
-            const XalanNode*            sourceNode = 0) const = 0;
-
-    /**
-     * Report a  message.
-     * 
-     * @param msg The text of the message.
-     * @param styleNode The stylesheet node were the message occurred.
-     * @param sourceNode The source node where the message occurred.  May be 0.
-     */
-    virtual void
-    message(
-            const XalanDOMString&       msg,
-            const ElemTemplateElement&  styleNode,
-            const XalanNode*            sourceNode = 0) const = 0;
-
-
-    /**
      * Determine whether conflicts should be reported.
      * 
      * @return true if conflicts should not be warned
@@ -1914,7 +1871,8 @@
     parseXML(
             MemoryManagerType&      theManager,
             const XalanDOMString&   urlString,
-            const XalanDOMString&   base) const = 0;
+            const XalanDOMString&   base,
+            ErrorHandler*           theErrorHandler = 0) const = 0;
 
     virtual MutableNodeRefList*
     borrowMutableNodeRefList() = 0;
@@ -2048,23 +2006,20 @@
 
     // These interfaces are inherited from ExecutionContext...
 
-    virtual void
-    error(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode,
-            const LocatorType*      locator) const = 0;
-
-    virtual void
-    warn(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode = 0,
-            const LocatorType*      locator = 0) const = 0;
-
-    virtual void
-    message(
-            const XalanDOMString&   msg,
-            const XalanNode*        sourceNode = 0,
-            const LocatorType*      locator = 0) const = 0;
+	virtual void
+	problem(
+			eSource		            source,
+			eClassification			classification,
+			const XalanDOMString&	msg,
+            const Locator*          locator,
+			const XalanNode*		sourceNode) = 0;
+
+	virtual void
+	problem(
+            eSource                 source,
+            eClassification         classification,
+			const XalanDOMString&	msg,
+			const XalanNode*		sourceNode) = 0;
 
 #if defined(XALAN_RECURSIVE_STYLESHEET_EXECUTION)
 protected:



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org