From 72c8c02e5c841da2ec07a74d0a385c89209937a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jul 2011 11:58:50 +0200 Subject: Make sure we don't process sourced schemas more than once --- xsd/processing/inheritance/processor.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'xsd/processing/inheritance') diff --git a/xsd/processing/inheritance/processor.cxx b/xsd/processing/inheritance/processor.cxx index 91ab627..318e3e4 100644 --- a/xsd/processing/inheritance/processor.cxx +++ b/xsd/processing/inheritance/processor.cxx @@ -391,6 +391,21 @@ namespace Processing }; + // Sources traverser that goes into each schema only once. + // + struct Sources: Traversal::Sources + { + virtual void + traverse (SemanticGraph::Sources& s) + { + if (schemas_.insert (&s.schema ()).second) + Traversal::Sources::traverse (s); + } + + private: + Cult::Containers::Set schemas_; + }; + // Go into included/imported schemas while making sure we don't // process the same stuff more than once. // @@ -420,7 +435,7 @@ namespace Processing if (!s.context ().count ("processing-inheritance-seen")) { Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; schema >> sources >> schema; schema >> *this; @@ -456,7 +471,7 @@ namespace Processing // rely on the order of types in the schema. // Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; Uses uses (tu, failed); schema >> sources >> schema; -- cgit v1.1