diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-02-19 10:22:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-02-19 10:22:39 +0200 |
commit | 63bc2f3535bb87d017cc277d7833b79e33853e08 (patch) | |
tree | 92c5a2f629ac9e31a5698dcf8c5ab8f766162355 | |
parent | f6b55dda1651ffd5221663ea4a642b6c1d49527f (diff) |
Normalize absolute schema file paths and add to context
Normalization of absolute paths consistently makes sure we don't
have duplicate schema units.
-rw-r--r-- | xsd-frontend/parser.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xsd-frontend/parser.cxx b/xsd-frontend/parser.cxx index 990f75b..b68c189 100644 --- a/xsd-frontend/parser.cxx +++ b/xsd-frontend/parser.cxx @@ -1799,7 +1799,10 @@ namespace XSDFrontend { // Enter the file into schema_map_. // - schema_map_[SchemaId (system_complete (tu), ns)] = rs.get (); + Path abs_path (system_complete (tu)); + abs_path.normalize (); + schema_map_[SchemaId (abs_path, ns)] = rs.get (); + rs->context ().set ("absolute-path", abs_path); s_ = cur_ = rs.get (); { @@ -2024,7 +2027,9 @@ namespace XSDFrontend // Check if we already have this schema. // - SchemaId schema_id (system_complete (tu), ns); + Path abs_path (system_complete (tu)); + abs_path.normalize (); + SchemaId schema_id (abs_path, ns); if (schema_map_.find (schema_id) != schema_map_.end ()) continue; @@ -2036,6 +2041,7 @@ namespace XSDFrontend // Enter the file into schema_map_. // schema_map_[schema_id] = &s; + s.context ().set ("absolute-path", abs_path); cur_ = &s; @@ -2332,6 +2338,7 @@ namespace XSDFrontend s_->new_edge<Imports> (*cur_, s, path); schema_map_[schema_id] = &s; + s.context ().set ("absolute-path", abs_path); Schema* old_cur (cur_); Boolean old_cur_chameleon (cur_chameleon_); @@ -2443,6 +2450,7 @@ namespace XSDFrontend s_->new_edge<Implies> (s, *xml_schema_, xml_schema_path_); schema_map_[schema_id] = &s; + s.context ().set ("absolute-path", abs_path); Boolean chameleon (false); |