From 0e7a03c98185396928dd36715567f7727a8f1c9b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Jul 2012 10:45:18 +0200 Subject: Take into account type when resolve ref name Apparently it is legal to have an element and an attribute with the same name. --- xsd-frontend/parser.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xsd-frontend/parser.cxx b/xsd-frontend/parser.cxx index 3a0b180..a9701a4 100644 --- a/xsd-frontend/parser.cxx +++ b/xsd-frontend/parser.cxx @@ -469,8 +469,15 @@ namespace XSDFrontend m.context ().remove ("instance-ns-name"); m.context ().remove ("instance-uq-name"); - - Member& ref (resolve (ns_name, uq_name, s_, cache_)); + // Resolve the name to the same type. It is legal to have + // an element and an attribute with the same name. + // + Member& ref ( + m.is_a () + ? static_cast ( + resolve (ns_name, uq_name, s_, cache_)) + : static_cast ( + resolve (ns_name, uq_name, s_, cache_))); // Make sure the referenced member is fully resolved. // @@ Substitutes edge won't be resolved. -- cgit v1.1