From: Hiebert, D. \(MS\) <Dar...@ng...> - 2006-03-29 18:49:35
|
I have discovered that the element and attribute name objects returned by the 'name' queries of XM_ELEMENT and XM_ATTRIBUTE are of type UC_UTF8_STRING when using the XM_EXPAT_PARSER. While a proper descendent of the STRING type of these name queries, it creates the possibility of CAT calls. Consider the following snippet of code: My_attribute: STRING is "mine" foo (att: XM_ATTRIBUTE) is local s: STRING do s :=3D att.name if s.is_equal (My_attribute) then ... end end This piece of code crashes with a segmentation violation in UC_STRING.is_equal while evaluating its "trichotomy" postcondition, because it believes the type of 'other' is "like Current", causing it to crash when it cannot look up the '<' function of 'other'. The 'name' queries return objects of type STRING when using the XM_EIFFEL_PARSER. I do not think there is a way to write code that will work correctly with both parsers, as I have to be doing many string comparisons as above with objects that are of nominal type STRING, but may actually be descendents. -- Darren Hiebert Northrop Grumman XonTech Systems Engineering Phone: 256-705-0123 |