From b535f3bbfbe1835925515abb454232bc4fca1ce1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Oct 2015 15:39:26 +0200 Subject: Handle abstract elements in more places --- xsd/cxx/tree/tree-source.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'xsd/cxx/tree/tree-source.cxx') diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx index 0a936bc..fbbd1b4 100644 --- a/xsd/cxx/tree/tree-source.cxx +++ b/xsd/cxx/tree/tree-source.cxx @@ -3532,10 +3532,19 @@ namespace CXX virtual void traverse (Type& e) { - if (element_type_ && doc_root_p (e)) + SemanticGraph::Type& t (e.type ()); + + // Check if this element is abstract. + // + bool abst; { - SemanticGraph::Type& t (e.type ()); + SemanticGraph::Complex* tc; + abst = (tc = dynamic_cast (&t)) != 0 && + tc->abstract_p (); + } + if (!abst && element_type_ && doc_root_p (e)) + { bool fund (false); { IsFundamentalType test (fund); @@ -3719,7 +3728,7 @@ namespace CXX } } - if (polymorphic && e.substitutes_p () && + if (!abst && polymorphic && e.substitutes_p () && !options.suppress_parsing ()) { String const& name (ename (e)); -- cgit v1.1