not_angle_bracket_start_exception() : xml_parse_exception("Not angle bracket start.") {} };
struct root_cant_have_text_exception : public xml_parse_exception{
- root_cant_have_text_exception() : xml_parse_exception("Root can't have text.") {} };
+ root_cant_have_text_exception() : xml_parse_exception("The text cannot be included top-level.") {} };//do not include a top level of the text.
struct processing_instruction_end_invalid : public xml_parse_exception{
processing_instruction_end_invalid() : xml_parse_exception("The end of processing_instruction should be \"?>\"") {} };
}
template <int _EvtCode>
- void operator << (const rule::error_event<_EvtCode>& evt)
+ /*__forceinline*/ void operator << (const rule::error_event<_EvtCode>& evt)
{
+ using namespace rule;
+
+ if ( _EvtCode == pcode::not_angle_bracket_start )
+ {
+ //if ( m_code == rule::pcode::_null )
+ if ( _ValidateCheck )
+ if ( m_element_name_stack.size() == 0 )
+ throw rule::root_cant_have_text_exception();
+ }
throw typename rule::error_event_to_exception<_EvtCode>::type();
}
};