Thrift: Finish namespace generation from xsd_namespace command
authordave <dev-null@apache.org>
Wed, 31 Jan 2007 02:49:01 +0000 (02:49 +0000)
committerdave <dev-null@apache.org>
Wed, 31 Jan 2007 02:49:01 +0000 (02:49 +0000)
In .thrift file:

xsd_namespace "http://api.facebook.com/v1"

Turns up in the xsd output as:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 targetNamespace="http://api.facebook.com/v1"
 xmlns="http://api.facebook.com/v1"
 elementFormDefault="qualified">

to properly accommodate our generated xml

Thank you, Slee.

Reviewed By: mcslee

Test Plan: sandbox

Revert Plan: revertible

Notes:

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664960 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_xsd_generator.cc

index 757009f..988aac8 100644 (file)
@@ -112,7 +112,8 @@ void t_xsd_generator::generate_service(t_service* tservice) {
 
   string ns = program_->get_xsd_namespace();
   if (ns.size() > 0) {
-    ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\"";
+    ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\" " + 
+      "elementFormDefault=\"qualified\"";
   }
 
   // Print the XSD header