aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-01-12 15:12:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-01-12 15:12:09 +0200
commit7f6c962faf8e67688065263291d16ae191c5b467 (patch)
tree2dcb17e9e36f5a450d24c2ad852069b02e1232a8
parent448760cbdb8f1ee1f3eb3559c7b05e7a61e37a88 (diff)
Pass the file path even for the schema being compiled
-rw-r--r--NEWS4
-rw-r--r--xsd-frontend/transformations/anonymous.cxx63
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 <namespace>#<qname> 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 (