Package suds :: Package mx :: Module literal :: Class Typed
[hide private]
[frames] | no frames]

Class Typed

source code

core.Core --+
            |
           Typed
Known Subclasses:

A typed marshaller. This marshaller is semi-typed as needed to support both document/literal and rpc/literal soap message styles.

Instance Methods [hide private]
 
__init__(self, schema, xstq=True) source code
 
reset(self)
Reset the marshaller.
source code
boolean
start(self, content)
Appending this content has started.
source code
 
suspend(self, content)
Appending this content has suspended.
source code
 
resume(self, content)
Appending this content has resumed.
source code
 
end(self, parent, content)
Appending this content has ended.
source code
Element
node(self, content)
Create and return an XML node.
source code
 
setnil(self, node, content)
Set the value of the node to nill.
source code
 
setdefault(self, node, content)
Set the value of the node to a default value.
source code
 
encode(self, node, content) source code
bool
skip(self, content)
Get whether to skip this content.
source code
 
optional(self, content)
Get whether the specified content is optional.
source code
Typed
translate(self, content)
Translate using the XSD type information.
source code
Typed
sort(self, content)
Sort suds object attributes based on ordering defined in the XSD type information.
source code
list
ordering(self, type)
Get the attribute ordering defined in the specified XSD type information.
source code

Inherited from core.Core: append, process

Instance Variables [hide private]
GraphResolver resolver
A schema type resolver.
xsd.schema.Schema schema
An xsd schema.

Inherited from core.Core: appender

Method Details [hide private]

__init__(self, schema, xstq=True)
(Constructor)

source code 
Parameters:
  • schema (xsd.schema.Schema) - A schema object
  • xstq (bool) - The xml schema type qualified flag indicates that the xsi:type attribute values should be qualified by namespace.
Overrides: core.Core.__init__

reset(self)

source code 

Reset the marshaller.

Overrides: core.Core.reset
(inherited documentation)

start(self, content)

source code 

Appending this content has started.

Parameters:
  • content - The content for which proccessing has started.
Returns: boolean
True to continue appending
Overrides: core.Core.start
(inherited documentation)

suspend(self, content)

source code 

Appending this content has suspended.

Parameters:
  • content - The content for which proccessing has been suspended.
Overrides: core.Core.suspend
(inherited documentation)

resume(self, content)

source code 

Appending this content has resumed.

Parameters:
  • content - The content for which proccessing has been resumed.
Overrides: core.Core.resume
(inherited documentation)

end(self, parent, content)

source code 

Appending this content has ended.

Parameters:
  • parent - The parent node ending.
  • content - The content for which proccessing has ended.
Overrides: core.Core.end
(inherited documentation)

node(self, content)

source code 

Create and return an XML node.

Parameters:
  • content - The content for which proccessing has been suspended.
Returns: Element
An element.
Overrides: core.Core.node
(inherited documentation)

setnil(self, node, content)

source code 

Set the value of the node to nill.

Parameters:
  • node - A nil node.
  • content - The content to set nil.
Overrides: core.Core.setnil
(inherited documentation)

setdefault(self, node, content)

source code 

Set the value of the node to a default value.

Parameters:
  • node - A nil node.
  • content - The content to set the default value.
Returns:
The default.
Overrides: core.Core.setdefault
(inherited documentation)

skip(self, content)

source code 

Get whether to skip this content. Should be skipped when the content is optional and either the value=None or the value is an empty list.

Parameters:
  • content (Object) - The content to skip.
Returns: bool
True if content is to be skipped.

optional(self, content)

source code 

Get whether the specified content is optional.

Parameters:
  • content - The content which to check.
Overrides: core.Core.optional
(inherited documentation)

translate(self, content)

source code 

Translate using the XSD type information. Python dict is translated to a suds object. Most importantly, primative values are translated from python types to XML types using the XSD type.

Parameters:
  • content (Object) - The content to translate.
Returns: Typed
self

sort(self, content)

source code 

Sort suds object attributes based on ordering defined in the XSD type information.

Parameters:
  • content (Object) - The content to sort.
Returns: Typed
self

ordering(self, type)

source code 

Get the attribute ordering defined in the specified XSD type information.

Parameters:
  • type (SchemaObject) - An XSD type object.
Returns: list
An ordered list of attribute names.