From 3454ba88093aec84943a96e3cf19237e62ff3803 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Tue, 10 Sep 2024 12:09:36 +0100 Subject: [PATCH] mangle: direct messages to std::cerr rather than collecting them up into a stringstream --- examples/XSLT/mangle.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/XSLT/mangle.cpp b/examples/XSLT/mangle.cpp index b3e8d6ec..575ef00d 100755 --- a/examples/XSLT/mangle.cpp +++ b/examples/XSLT/mangle.cpp @@ -20,11 +20,10 @@ int main(int argc, const char* argv[]) return 0; } // if ... - Arabica::XSLT::StylesheetCompiler compiler; - std::ostringstream errors; - try + try { Arabica::SAX::InputSource source(argv[2]); + Arabica::XSLT::StylesheetCompiler compiler; std::unique_ptr > stylesheet = compiler.compile(source); if(stylesheet.get() == 0) { @@ -32,7 +31,7 @@ int main(int argc, const char* argv[]) return -1; } // if ... - stylesheet->set_error_output(errors); + stylesheet->set_error_output(std::cerr); Arabica::DOM::Document document = buildDOM(argv[1]); if(document == 0) @@ -47,8 +46,6 @@ int main(int argc, const char* argv[]) std::cerr << ex.what() << std::endl; } // catch - std::cerr << "\n\n" << errors.str() << std::endl; - return 0; } // main