From 7f6c962faf8e67688065263291d16ae191c5b467 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Jan 2010 15:12:09 +0200 Subject: Pass the file path even for the schema being compiled --- NEWS | 4 ++ xsd-frontend/transformations/anonymous.cxx | 63 +++++++++++++----------------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/NEWS b/NEWS index a8e8dae..0306607 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,10 @@ Version 1.17.0 * Add support for resolving default/fixed values of QName type. Now the qualified value is represented in the # form. + * Anonymous transformation now passes the actual file path instead of + the empty string to the AnonymousNameTranslator::translate() function + for the translation unit. + Version 1.16.0 * New transformation: simplifier. It simplifies the schema graph diff --git a/xsd-frontend/transformations/anonymous.cxx b/xsd-frontend/transformations/anonymous.cxx index 19ffb44..4663c1d 100644 --- a/xsd-frontend/transformations/anonymous.cxx +++ b/xsd-frontend/transformations/anonymous.cxx @@ -265,19 +265,16 @@ namespace XSDFrontend SemanticGraph::Path file (path (l)); String file_str; - if (file != schema_path) + // Try to use the portable representation of the path. If that + // fails, fall back to the native representation. + // + try + { + file_str = file.string (); + } + catch (SemanticGraph::InvalidPath const&) { - // Try to use the portable representation of the path. If that - // fails, fall back to the native representation. - // - try - { - file_str = file.string (); - } - catch (SemanticGraph::InvalidPath const&) - { - file_str = file.native_file_string (); - } + file_str = file.native_file_string (); } String name ( @@ -349,19 +346,16 @@ namespace XSDFrontend SemanticGraph::Path file (path (c)); String file_str; - if (file != schema_path) + // Try to use the portable representation of the path. If that + // fails, fall back to the native representation. + // + try { - // Try to use the portable representation of the path. If that - // fails, fall back to the native representation. - // - try - { - file_str = file.string (); - } - catch (SemanticGraph::InvalidPath const&) - { - file_str = file.native_file_string (); - } + file_str = file.string (); + } + catch (SemanticGraph::InvalidPath const&) + { + file_str = file.native_file_string (); } String name ( @@ -550,19 +544,16 @@ namespace XSDFrontend SemanticGraph::Path file (path (m)); String file_str; - if (file != schema_path) + // Try to use the portable representation of the path. If that + // fails, fall back to the native representation. + // + try { - // Try to use the portable representation of the path. If that - // fails, fall back to the native representation. - // - try - { - file_str = file.string (); - } - catch (SemanticGraph::InvalidPath const&) - { - file_str = file.native_file_string (); - } + file_str = file.string (); + } + catch (SemanticGraph::InvalidPath const&) + { + file_str = file.native_file_string (); } String name ( -- cgit v1.1