summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjortel <devnull@localhost>2010-05-06 21:53:31 +0000
committerjortel <devnull@localhost>2010-05-06 21:53:31 +0000
commit1d2817844ed94e13899f12f1a9e6d718b7d1cb8b (patch)
tree863eeaf25a5a4962322fec6d3164b2d0f4ccd78d
parent5ed95ee57b3e9ca0b5679ada19eed36002c70e62 (diff)
downloadsuds-1d2817844ed94e13899f12f1a9e6d718b7d1cb8b.tar.gz
Update epydocs suds/xsd/schema.py
-rw-r--r--suds/mx/literal.py5
-rw-r--r--suds/xsd/schema.py18
-rw-r--r--suds/xsd/sxbase.py13
-rw-r--r--suds/xsd/sxbasic.py6
-rw-r--r--tests/rhq.py4
5 files changed, 38 insertions, 8 deletions
diff --git a/suds/mx/literal.py b/suds/mx/literal.py
index 937ad8e..b6c0c7e 100644
--- a/suds/mx/literal.py
+++ b/suds/mx/literal.py
@@ -143,7 +143,10 @@ class Typed(Core):
# by the schema (elementFormDefault).
#
ns = content.type.namespace()
- if content.type.form_qualified:
+ qualify = \
+ ( content.type.form_qualified or
+ content.type.element() == 1)
+ if qualify:
node = Element(content.tag, ns=ns)
node.addPrefix(ns[0], ns[1])
else:
diff --git a/suds/xsd/schema.py b/suds/xsd/schema.py
index a22f1c5..4194673 100644
--- a/suds/xsd/schema.py
+++ b/suds/xsd/schema.py
@@ -166,16 +166,26 @@ class Schema:
@type baseurl: str
@ivar container: A schema collection containing this schema.
@type container: L{SchemaCollection}
- @ivar types: A schema types cache.
- @type types: {name:L{SchemaObject}}
- @ivar groups: A schema groups cache.
- @type groups: {name:L{SchemaObject}}
@ivar children: A list of direct top level children.
@type children: [L{SchemaObject},...]
+ @ivar all: A children.
+ @type all: [L{SchemaObject},...]
+ @ivar groups: A schema groups cache.
+ @type groups: {name:L{SchemaObject}}
@ivar all: A list of all (includes imported) top level children.
@type all: [L{SchemaObject},...]
+ @ivar types: A schema types cache.
+ @type types: {name:L{SchemaObject}}
@ivar imports: A list of import objects.
@type imports: [L{SchemaObject},...]
+ @ivar elements: A list of <element/> objects.
+ @type elements: [L{SchemaObject},...]
+ @ivar attributes: A list of <attribute/> objects.
+ @type attributes: [L{SchemaObject},...]
+ @ivar groups: A list of group objects.
+ @type groups: [L{SchemaObject},...]
+ @ivar agrps: A list of attribute group objects.
+ @type agrps: [L{SchemaObject},...]
@ivar form_qualified: The flag indicating:
(@elementFormDefault).
@type form_qualified: bool
diff --git a/suds/xsd/sxbase.py b/suds/xsd/sxbase.py
index 1c0ba64..62c2d7f 100644
--- a/suds/xsd/sxbase.py
+++ b/suds/xsd/sxbase.py
@@ -218,10 +218,21 @@ class SchemaObject(object):
"""
return self.cache.get(nobuiltin, self)
+ def element(self):
+ """
+ Get whether this is an <xs:element/>
+ @return: code.
+ - 0=not an element
+ - 1=root,
+ - 2=non-root
+ @rtype: int
+ """
+ return 0
+
def sequence(self):
"""
Get whether this is an <xs:sequence/>
- @return: True if any, else False
+ @return: True if <xs:sequence/>, else False
@rtype: boolean
"""
return False
diff --git a/suds/xsd/sxbasic.py b/suds/xsd/sxbasic.py
index 0b536d2..d6a43af 100644
--- a/suds/xsd/sxbasic.py
+++ b/suds/xsd/sxbasic.py
@@ -387,6 +387,12 @@ class Element(TypedContent):
def childtags(self):
return ('attribute', 'simpleType', 'complexType', 'any',)
+ def element(self):
+ if self in self.schema.children:
+ return 1
+ else:
+ return 2
+
def extension(self):
for c in self.rawchildren:
if c.extension():
diff --git a/tests/rhq.py b/tests/rhq.py
index ca810e6..2b755d1 100644
--- a/tests/rhq.py
+++ b/tests/rhq.py
@@ -34,7 +34,7 @@ errors = 0
setup_logging()
-#logging.getLogger('suds.client').setLevel(logging.DEBUG)
+logging.getLogger('suds.client').setLevel(logging.DEBUG)
#logging.getLogger('suds.metrics').setLevel(logging.DEBUG)
#logging.getLogger('suds').setLevel(logging.DEBUG)
@@ -51,7 +51,7 @@ def rhqTest():
url = 'http://localhost.localdomain:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl'
start(url)
- client = Client(url, cache=None)
+ client = Client(url)
print client
try: