diff options
author | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-15 22:21:36 +0000 |
---|---|---|
committer | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-15 22:21:36 +0000 |
commit | a4636be6a25c38dbd6e28519383324301e6c7175 (patch) | |
tree | 2b6857e552e9ee9ac02b074a28baa99b0ebc3d8e /ACEXML/parser/parser | |
parent | 56194729036ba549a82869904ffcdf96d1caf43d (diff) | |
download | ATCD-a4636be6a25c38dbd6e28519383324301e6c7175.tar.gz |
ChangeLogTag: Tue Oct 15 17:17:44 2002 Krishnakumar B <kitty@cse.wustl.edu>
Diffstat (limited to 'ACEXML/parser/parser')
-rw-r--r-- | ACEXML/parser/parser/Makefile | 1 | ||||
-rw-r--r-- | ACEXML/parser/parser/Parser.cpp | 24 |
2 files changed, 21 insertions, 4 deletions
diff --git a/ACEXML/parser/parser/Makefile b/ACEXML/parser/parser/Makefile index e9089cb5d23..91aaf5bf525 100644 --- a/ACEXML/parser/parser/Makefile +++ b/ACEXML/parser/parser/Makefile @@ -183,6 +183,7 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU $(ACE_ROOT)/ACEXML/common/ContentHandler.h \ $(ACE_ROOT)/ACEXML/common/Env.h \ $(ACE_ROOT)/ACEXML/common/XML_Macros.h \ + $(ACE_ROOT)/ace/Exception_Macros.h \ $(ACE_ROOT)/ACEXML/common/Exception.h \ $(ACE_ROOT)/ACEXML/common/XML_Types.h \ $(ACE_ROOT)/ace/OS.h \ diff --git a/ACEXML/parser/parser/Parser.cpp b/ACEXML/parser/parser/Parser.cpp index 4b9cec81de8..4b49b5ed895 100644 --- a/ACEXML/parser/parser/Parser.cpp +++ b/ACEXML/parser/parser/Parser.cpp @@ -294,9 +294,22 @@ ACEXML_Parser::parse_xml_prolog (ACEXML_ENV_SINGLE_ARG_DECL) return; } else + { seen_encoding = 1; - // @@ Handle encoding here. We don't handle - // various encodings for this parser. + if (ACE_OS::strcmp (astring, + this->instream_->getEncoding()) != 0) + { + if (ACE_OS::strstr (astring, + this->instream_->getEncoding()) != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Detected Encoding is %s : Declared Encoding is %s"), + this->instream_->getEncoding(), astring)); + this->report_fatal_error (ACE_TEXT ("Encoding declaration doesn't match detected encoding") ACEXML_ENV_ARG_PARAMETER); + return; + } + } + } continue; } else @@ -1815,8 +1828,11 @@ ACEXML_Parser::parse_token (const ACEXML_Char* keyword) if (keyword == 0) return -1; const ACEXML_Char* ptr = keyword; - for (; *ptr != 0 && this->get() == *ptr; ++ptr) - ; + ACEXML_Char ch; + for (; *ptr != 0 && ((ch = this->get()) == *ptr); ++ptr) + { + // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ch = %c : ptr = %c"), ch, *ptr)); + } if (*ptr == 0) return 0; else |