diff options
Diffstat (limited to 'compiler/cpp/src/thrift/generate/t_xsd_generator.cc')
-rw-r--r-- | compiler/cpp/src/thrift/generate/t_xsd_generator.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_xsd_generator.cc b/compiler/cpp/src/thrift/generate/t_xsd_generator.cc index a10f05959..15ede750f 100644 --- a/compiler/cpp/src/thrift/generate/t_xsd_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_xsd_generator.cc @@ -262,10 +262,10 @@ void t_xsd_generator::generate_service(t_service* tservice) { f_xsd_.open(f_xsd_name.c_str()); string ns = program_->get_namespace("xsd"); - const std::map<std::string, std::string> annot = program_->get_namespace_annotations("xsd"); - const std::map<std::string, std::string>::const_iterator uri = annot.find("uri"); - if (uri != annot.end()) { - ns = uri->second; + const std::map<std::string, std::vector<std::string>> annot = program_->get_namespace_annotations("xsd"); + const std::map<std::string, std::vector<std::string>>::const_iterator uri = annot.find("uri"); + if (uri != annot.end() && !uri->second.empty()) { + ns = uri->second.back(); } if (ns.size() > 0) { ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\" " |