aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/support/error_capacitor.cc65
-rw-r--r--src/support/error_capacitor.h15
2 files changed, 49 insertions, 31 deletions
diff --git a/src/support/error_capacitor.cc b/src/support/error_capacitor.cc
index e83ba9a..1a536ed 100644
--- a/src/support/error_capacitor.cc
+++ b/src/support/error_capacitor.cc
@@ -2,6 +2,8 @@
#include <xercesc/sax/SAXParseException.hpp>
+#include <xalanc/PlatformSupport/DOMStringPrintWriter.hpp>
+
#include <iostream>
#include "support/xalan_string.h"
@@ -58,42 +60,57 @@ void ErrorCapacitor::fatalError(const xercesc::SAXParseException& exception) {
void ErrorCapacitor::resetErrors() { }
void ErrorCapacitor::problem(
- xalan::ProblemListenerBase::eSource,
- xalan::ProblemListenerBase::eClassification,
- const xalan::XalanDOMString& message,
- const xalan::Locator*,
- const xalan::XalanNode*
+ xalan::ProblemListenerBase::eSource source,
+ xalan::ProblemListenerBase::eClassification classification,
+ const xalan::XalanDOMString& message,
+ const xalan::Locator* locator,
+ const xalan::XalanNode* node
) {
- this->error_cache_->emplace_back(
- "XSLT problem: " + toString(message)
+ xalan::XalanDOMString problemSummary;
+ xalan::DOMStringPrintWriter writer(problemSummary);
+
+ defaultFormat(
+ writer,
+ source,
+ classification,
+ message,
+ locator,
+ node
);
+
+ this->error_cache_->emplace_back(toString(problemSummary));
}
void ErrorCapacitor::problem(
- xalan::ProblemListenerBase::eSource,
- xalan::ProblemListenerBase::eClassification,
- const xalan::XalanNode*,
- const xalan::ElemTemplateElement*,
- const xalan::XalanDOMString& message,
- const xalan::XalanDOMChar*,
- xalan::XalanFileLoc,
- xalan::XalanFileLoc
+ xalan::ProblemListenerBase::eSource source,
+ xalan::ProblemListenerBase::eClassification classification,
+ const xalan::XalanDOMString& message,
+ const xalan::XalanNode* node
) {
- this->error_cache_->emplace_back(
- "XSLT problem: " + toString(message)
+ xalan::XalanDOMString problemSummary;
+ xalan::DOMStringPrintWriter writer(problemSummary);
+
+ defaultFormat(
+ writer,
+ source,
+ classification,
+ message,
+ node
);
+
+ this->error_cache_->emplace_back(toString(problemSummary));
}
void ErrorCapacitor::problem(
xalan::ProblemListenerBase::eSource,
xalan::ProblemListenerBase::eClassification,
- const xalan::XalanDOMString& message,
- const xalan::XalanNode*
-) {
- this->error_cache_->emplace_back(
- "XSLT problem: " + toString(message)
- );
-}
+ const xalan::XalanNode*,
+ const xalan::ElemTemplateElement*,
+ const xalan::XalanDOMString&,
+ const xalan::XalanDOMChar*,
+ xalan::XalanFileLoc,
+ xalan::XalanFileLoc
+) { }
void ErrorCapacitor::setPrintWriter(xalan::PrintWriter*) { }
diff --git a/src/support/error_capacitor.h b/src/support/error_capacitor.h
index d89b5ae..b94d5f8 100644
--- a/src/support/error_capacitor.h
+++ b/src/support/error_capacitor.h
@@ -2,6 +2,7 @@
#define INPUTXSLT_SRC_SUPPORT_ERROR_CAPACITOR_H_
#include <xercesc/sax/ErrorHandler.hpp>
+
#include <xalanc/XSLT/ProblemListener.hpp>
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
@@ -14,7 +15,7 @@
namespace InputXSLT {
class ErrorCapacitor : public xercesc::ErrorHandler,
- public xalan::ProblemListener {
+ public xalan::ProblemListener {
public:
class exception;
@@ -42,19 +43,19 @@ class ErrorCapacitor : public xercesc::ErrorHandler,
virtual void problem(
xalan::ProblemListenerBase::eSource,
xalan::ProblemListenerBase::eClassification,
- const xalan::XalanNode*,
- const xalan::ElemTemplateElement*,
const xalan::XalanDOMString&,
- const xalan::XalanDOMChar*,
- xalan::XalanFileLoc,
- xalan::XalanFileLoc
+ const xalan::XalanNode*
);
virtual void problem(
xalan::ProblemListenerBase::eSource,
xalan::ProblemListenerBase::eClassification,
+ const xalan::XalanNode*,
+ const xalan::ElemTemplateElement*,
const xalan::XalanDOMString&,
- const xalan::XalanNode*
+ const xalan::XalanDOMChar*,
+ xalan::XalanFileLoc,
+ xalan::XalanFileLoc
);
virtual void setPrintWriter(xalan::PrintWriter*);