From bf73b5e10062468f15fbb4b5aa6aa2f64d0026a9 Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Thu, 13 Apr 2000 04:43:37 +0000 Subject: [PATCH] Back out earlier fix to bug 13565. I shouldn't remove the code that dumps XML error messages to the console because the browser window is not going to be around all time, for example, in the case of the profile manager window. git-svn-id: svn://10.0.0.236/trunk@65763 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsWellFormedDTD.cpp | 13 +++++++++++++ mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mozilla/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/htmlparser/src/nsWellFormedDTD.cpp index 134037b493f..88961eaf146 100644 --- a/mozilla/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/htmlparser/src/nsWellFormedDTD.cpp @@ -692,6 +692,19 @@ nsresult CWellFormedDTD::HandleErrorToken(CToken* aToken) { const nsParserError* error = errTok->GetError(); result=(mSink)? mSink->NotifyError(error):NS_OK; + // Output the error to the console + if (error) { + char* temp; + cout << "XML Error in file '" << (temp = mFilename.ToNewCString()) << "', "; + Recycle(temp); + cout << "Line Number: " << error->lineNumber << ", "; + cout << "Col Number: " << error->colNumber << ", "; + cout << "Description: " << (temp = error->description.ToNewCString()) << "\n"; + Recycle(temp); + cout << "Source Line: " << (temp = error->sourceLine.ToNewCString()) << "\n"; + Recycle(temp); + } + return result; } diff --git a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp index 134037b493f..88961eaf146 100644 --- a/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp +++ b/mozilla/parser/htmlparser/src/nsWellFormedDTD.cpp @@ -692,6 +692,19 @@ nsresult CWellFormedDTD::HandleErrorToken(CToken* aToken) { const nsParserError* error = errTok->GetError(); result=(mSink)? mSink->NotifyError(error):NS_OK; + // Output the error to the console + if (error) { + char* temp; + cout << "XML Error in file '" << (temp = mFilename.ToNewCString()) << "', "; + Recycle(temp); + cout << "Line Number: " << error->lineNumber << ", "; + cout << "Col Number: " << error->colNumber << ", "; + cout << "Description: " << (temp = error->description.ToNewCString()) << "\n"; + Recycle(temp); + cout << "Source Line: " << (temp = error->sourceLine.ToNewCString()) << "\n"; + Recycle(temp); + } + return result; }