diff options
author | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-06-24 22:59:20 +0000 |
---|---|---|
committer | kitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-06-24 22:59:20 +0000 |
commit | 9b8ffd6ffcd39feb5546358eb911e942b12fbe92 (patch) | |
tree | 7d1f6721277089989b2ca1fa694852cfa4727428 /ACEXML | |
parent | 2e7e619596ccf0fb4e3dfc541a57d32917e2a14b (diff) | |
download | ATCD-9b8ffd6ffcd39feb5546358eb911e942b12fbe92.tar.gz |
ChangeLogTag: Mon Jun 24 17:55:58 2002 Krishnakumar B <kitty@cs.wustl.edu>
Diffstat (limited to 'ACEXML')
-rw-r--r-- | ACEXML/parser/parser/Parser.cpp | 102 | ||||
-rw-r--r-- | ACEXML/parser/parser/Parser.h | 1 |
2 files changed, 63 insertions, 40 deletions
diff --git a/ACEXML/parser/parser/Parser.cpp b/ACEXML/parser/parser/Parser.cpp index 1ceed61c971..0834ce4d7a9 100644 --- a/ACEXML/parser/parser/Parser.cpp +++ b/ACEXML/parser/parser/Parser.cpp @@ -756,9 +756,16 @@ ACEXML_Parser::parse_element (int is_root, ACEXML_Env &xmlenv) else { this->xml_namespace_.processName(startname, ns_uri, ns_lname, 0); - const ACEXML_Char* prefix = this->xml_namespace_.getPrefix (ns_uri); + ACEXML_Char* temp (ACE::strnew (startname)); + ACE_Auto_Basic_Array_Ptr<ACEXML_Char> cleanup_temp (temp); + ACE_Tokenizer ns_att (temp); + ns_att.delimiter_replace (':', 0); + ACEXML_Char* prefix = ns_att.next (); + ACEXML_Char* name = ns_att.next(); if (this->namespaces_) { + if (name == 0) + prefix = 0; this->content_handler_->startPrefixMapping (prefix, ns_uri, xmlenv); @@ -788,9 +795,16 @@ ACEXML_Parser::parse_element (int is_root, ACEXML_Env &xmlenv) case '>': { this->xml_namespace_.processName (startname, ns_uri, ns_lname, 0); - const ACEXML_Char* prefix = this->xml_namespace_.getPrefix (ns_uri); + ACEXML_Char* temp (ACE::strnew (startname)); + ACE_Auto_Basic_Array_Ptr<ACEXML_Char> cleanup_temp (temp); + ACE_Tokenizer ns_att (temp); + ns_att.delimiter_replace (':', 0); + ACEXML_Char* prefix = ns_att.next (); + ACEXML_Char* name = ns_att.next(); if (this->namespaces_) { + if (name == 0) + prefix = 0; this->content_handler_->startPrefixMapping (prefix, ns_uri, xmlenv); @@ -987,44 +1001,52 @@ ACEXML_Parser::parse_element (int is_root, ACEXML_Env &xmlenv) ACEXML_CHECK; break; case '/': // an ETag. - this->get (); // consume '/' - endname = this->read_name (); - if (endname == 0 || - ACE_OS_String::strcmp (startname, endname) != 0) - { - ACE_NEW_NORETURN (exception, - ACEXML_SAXParseException - (ACE_LIB_TEXT - ("Mismatched End-tag encountered"))); - xmlenv.exception (exception); - this->report_fatal_error(*exception, xmlenv); - return ; - } - if (this->skip_whitespace (0) != '>') - { - ACE_NEW_NORETURN (exception, - ACEXML_SAXParseException - (ACE_LIB_TEXT - ("Expecting '>' in an end-tag"))); - xmlenv.exception (exception); - this->report_fatal_error(*exception, xmlenv); - return; - } - this->content_handler_->endElement (ns_uri, - ns_lname, - endname, - xmlenv); - ACEXML_CHECK; - if (this->namespaces_) - { - const ACEXML_Char* prefix = this->xml_namespace_.getPrefix (ns_uri); - this->content_handler_->endPrefixMapping (prefix, xmlenv); - ACEXML_CHECK; - } - if (new_namespace != 0) - this->xml_namespace_.popContext (); - return; - + { + this->get (); // consume '/' + endname = this->read_name (); + if (endname == 0 || + ACE_OS_String::strcmp (startname, endname) != 0) + { + ACE_NEW_NORETURN (exception, + ACEXML_SAXParseException + (ACE_LIB_TEXT + ("Mismatched End-tag encountered"))); + xmlenv.exception (exception); + this->report_fatal_error(*exception, xmlenv); + return ; + } + if (this->skip_whitespace (0) != '>') + { + ACE_NEW_NORETURN (exception, + ACEXML_SAXParseException + (ACE_LIB_TEXT + ("Expecting '>' in an end-tag"))); + xmlenv.exception (exception); + this->report_fatal_error(*exception, xmlenv); + return; + } + this->content_handler_->endElement (ns_uri, + ns_lname, + endname, + xmlenv); + ACEXML_CHECK; + ACEXML_Char* temp (ACE::strnew (startname)); + ACE_Auto_Basic_Array_Ptr<ACEXML_Char> cleanup_temp (temp); + ACE_Tokenizer ns_att (temp); + ns_att.delimiter_replace (':', 0); + ACEXML_Char* prefix = ns_att.next (); + ACEXML_Char* name = ns_att.next(); + if (this->namespaces_) + { + if (name == 0) + prefix = 0; + this->content_handler_->endPrefixMapping (prefix, xmlenv); + ACEXML_CHECK; + } + if (new_namespace != 0) + this->xml_namespace_.popContext (); + return; + } default: // a new nested element? this->parse_element (0, xmlenv); ACEXML_CHECK; diff --git a/ACEXML/parser/parser/Parser.h b/ACEXML/parser/parser/Parser.h index c1eb8680bd7..84aabd11e74 100644 --- a/ACEXML/parser/parser/Parser.h +++ b/ACEXML/parser/parser/Parser.h @@ -23,6 +23,7 @@ #include "ace/SString.h" #include "ace/Hash_Map_Manager.h" #include "ace/Containers_T.h" +#include "ace/Auto_Ptr.h" #include "ACEXML/parser/parser/Entity_Manager.h" /** |