Commits

Jason Pellerin  committed 9e747ae

Fixed some poor namespace handling

  • Participants
  • Parent commits fcfb4b3

Comments (0)

Files changed (1)

File scio/client.py

         for attr in self._attributes:
             at_val = getattr(self, attr.name, None)
             if at_val is not None:
-                e.attrib[attr.name] = unicode(at_val)
+                e.attrib["{%s}%s" % (namespace, attr.name)] = unicode(at_val)
         for child in self._children:
             # use private accessors to avoid autovivification
             # since we're potentially passing empty=True to children
 
         # short circuit for enums
         if self._is_enum(type_):
-            cls = self._make_enum(type_, client, self.nsmap[prefix], name)
+            cls = self._make_enum(type_, client, self.tns, name)
             self._typemap[name] = cls
             setattr(client_type, name, cls)
             return cls
         # short circuit for arrays
         elif self._is_array(type_):
-            cls = self._make_array(type_, client, self.nsmap[prefix], name)
+            cls = self._make_array(type_, client, self.tns, name)
             self._typemap[name] = cls
             setattr(client_type, name, cls)
             return cls
         # short circuit for unions
         elif self._is_union(type_):
-            cls = self._make_union(type_, client, self.nsmap[prefix], name)
+            cls = self._make_union(type_, client, self.tns, name)
             self._typemap[name] = cls
             setattr(client_type, name, cls)
             return cls
         # short circuit for simpleTypes
         elif self._is_simple(type_):
-            cls = self._make_simple(type_, client, self.nsmap[prefix], name)
+            cls = self._make_simple(type_, client, self.tns, name)
             self._typemap[name] = cls
             setattr(client_type, name, cls)
             return cls
         self._typemap[name] = TypeRef(name, self)
 
         # the body dict of the class
-        namespace = self.nsmap[prefix]
+        namespace = self.tns
         data = {'_attributes': [],
                 '_children': [],
                 '_substitutions': {},