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; }