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/11/19 01:52:47 UTC
svn commit: r718827 - in /xalan/c/trunk:
samples/SimpleXPathAPI/SimpleXPathAPI.cpp
src/xalanc/PlatformSupport/XSLException.cpp
src/xalanc/PlatformSupport/XSLException.hpp src/xalanc/XPath/Function.cpp
src/xalanc/XPath/XPathEnvSupportDefault.cpp
Author: dbertoni
Date: Tue Nov 18 16:52:46 2008
New Revision: 718827
URL: http://svn.apache.org/viewvc?rev=718827&view=rev
Log:
Fix for XALANC-684.
Modified:
xalan/c/trunk/samples/SimpleXPathAPI/SimpleXPathAPI.cpp
xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.cpp
xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.hpp
xalan/c/trunk/src/xalanc/XPath/Function.cpp
xalan/c/trunk/src/xalanc/XPath/XPathEnvSupportDefault.cpp
Modified: xalan/c/trunk/samples/SimpleXPathAPI/SimpleXPathAPI.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/samples/SimpleXPathAPI/SimpleXPathAPI.cpp?rev=718827&r1=718826&r2=718827&view=diff
==============================================================================
--- xalan/c/trunk/samples/SimpleXPathAPI/SimpleXPathAPI.cpp (original)
+++ xalan/c/trunk/samples/SimpleXPathAPI/SimpleXPathAPI.cpp Tue Nov 18 16:52:46 2008
@@ -167,8 +167,12 @@
}
catch(const XSLException& theException)
{
+ XALAN_USING_XALAN(XalanDOMString)
+
+ XalanDOMString theError;
+
cerr << "XSL exception: "
- << theException.getMessage()
+ << theException.defaultFormat(theError)
<< endl;
theResult = -1;
Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.cpp?rev=718827&r1=718826&r2=718827&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.cpp Tue Nov 18 16:52:46 2008
@@ -86,7 +86,7 @@
-void
+XalanDOMString&
XSLException::defaultFormat(XalanDOMString& theBuffer) const
{
if (m_formatted == true)
@@ -103,10 +103,13 @@
getType(),
theBuffer);
}
+
+ return theBuffer;
}
-void
+
+XalanDOMString&
XSLException::defaultFormat(
const XalanDOMChar* theMessage,
const XalanDOMString::size_type theMessageLength,
@@ -183,6 +186,8 @@
theBuffer.append(theMessageBuffer);
theBuffer += XalanDOMChar(XalanUnicode::charRightParenthesis);
+
+ return theBuffer;
}
Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.hpp?rev=718827&r1=718826&r2=718827&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XSLException.hpp Tue Nov 18 16:52:46 2008
@@ -135,10 +135,10 @@
return m_memoryManager;
}
- void
+ XalanDOMString&
defaultFormat(XalanDOMString& theBuffer) const;
- static void
+ static XalanDOMString&
defaultFormat(
const XalanDOMString& theMessage,
const XalanDOMString& theURI,
@@ -147,19 +147,19 @@
const XalanDOMChar* theType,
XalanDOMString& theBuffer)
{
- defaultFormat(
- theMessage.c_str(),
- theMessage.size(),
- theURI.c_str(),
- theURI.size(),
- theLineNumber,
- theColumnNumber,
- theType,
- XalanDOMString::length(theType),
- theBuffer);
+ return defaultFormat(
+ theMessage.c_str(),
+ theMessage.size(),
+ theURI.c_str(),
+ theURI.size(),
+ theLineNumber,
+ theColumnNumber,
+ theType,
+ XalanDOMString::length(theType),
+ theBuffer);
}
- static void
+ static XalanDOMString&
defaultFormat(
const XalanDOMChar* theMessage,
const XalanDOMChar* theURI,
@@ -170,19 +170,19 @@
{
assert(theMessage != 0);
- defaultFormat(
- theMessage,
- XalanDOMString::length(theMessage),
- theURI,
- theURI == 0 ? 0 : XalanDOMString::length(theURI),
- theLineNumber,
- theColumnNumber,
- theType,
- theType == 0 ? 0 : XalanDOMString::length(theType),
- theBuffer);
+ return defaultFormat(
+ theMessage,
+ XalanDOMString::length(theMessage),
+ theURI,
+ theURI == 0 ? 0 : XalanDOMString::length(theURI),
+ theLineNumber,
+ theColumnNumber,
+ theType,
+ theType == 0 ? 0 : XalanDOMString::length(theType),
+ theBuffer);
}
- static void
+ static XalanDOMString&
defaultFormat(
const XalanDOMChar* theMessage,
const XalanDOMString::size_type theMessageLength,
Modified: xalan/c/trunk/src/xalanc/XPath/Function.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/Function.cpp?rev=718827&r1=718826&r2=718827&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/Function.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/Function.cpp Tue Nov 18 16:52:46 2008
@@ -21,6 +21,7 @@
+#include "XalanXPathException.hpp"
#include "XObjectFactory.hpp"
@@ -157,12 +158,19 @@
{
const GetCachedString theGuard(executionContext);
+ XalanDOMString& theErrorString = theGuard.get();
+
executionContext.problem(
XPathExecutionContext::eXPath,
XPathExecutionContext::eError,
- getError(theGuard.get()),
+ getError(theErrorString),
locator,
context);
+
+ throw XalanXPathException(
+ theErrorString,
+ theErrorString.getMemoryManager(),
+ locator);
}
Modified: xalan/c/trunk/src/xalanc/XPath/XPathEnvSupportDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathEnvSupportDefault.cpp?rev=718827&r1=718826&r2=718827&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathEnvSupportDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathEnvSupportDefault.cpp Tue Nov 18 16:52:46 2008
@@ -46,6 +46,7 @@
+#include "XalanXPathException.hpp"
#include "XObject.hpp"
#include "XObjectFactory.hpp"
#include "XPath.hpp"
@@ -467,6 +468,14 @@
locator,
sourceNode);
}
+
+ if (classification == eError)
+ {
+ throw XalanXPathException(
+ msg,
+ getMemoryManager(),
+ locator);
+ }
}
@@ -487,6 +496,14 @@
msg,
sourceNode);
}
+
+ if (classification == eError)
+ {
+ throw XalanXPathException(
+ msg,
+ getMemoryManager(),
+ 0);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org