Package suds :: Package xsd :: Module schema :: Class Schema
[hide private]
[frames] | no frames]

Class Schema

source code

The schema is an objectification of a <schema/> (xsd) definition. It provides inspection, lookup and type resolution.

Instance Methods [hide private]
 
__init__(self, root, baseurl, options, container=None) source code
(prefix, uri)
mktns(self)
Make the schema's target namespace.
source code
 
build(self)
Build the schema (object graph) using the root node using the factory.
source code
Schema
merge(self, schema)
Merge the contents from the schema.
source code
 
open_imports(self, options)
Instruct all contained sxbasic.Import children to import the schema's which they reference.
source code
 
dereference(self)
Instruct all children to perform dereferencing.
source code
Schema
locate(self, ns)
Find a schema by namespace.
source code
bool
custom(self, ref, context=None)
Get whether the specified reference is not an (xs) builtin.
source code
bool
builtin(self, ref, context=None)
Get whether the specified reference is an (xs) builtin.
source code
Schema
instance(self, root, baseurl, options)
Create and return an new schema object using the specified root and url.
source code
 
str(self, indent=0) source code
 
__repr__(self) source code
 
__str__(self) source code
 
__unicode__(self) source code
Class Variables [hide private]
  Tag = 'schema'
Instance Variables [hide private]
[SchemaObject,...] agrps
A list of attribute group objects.
[SchemaObject,...] all
A list of all (includes imported) top level children.
[SchemaObject,...] attributes
A list of <attribute/> objects.
str baseurl
The base URL for this schema.
[SchemaObject,...] children
A list of direct top level children.
SchemaCollection container
A schema collection containing this schema.
[SchemaObject,...] elements
A list of <element/> objects.
bool form_qualified
The flag indicating: (@elementFormDefault).
[SchemaObject,...] groups
A list of group objects.
[SchemaObject,...] imports
A list of import objects.
sax.element.Element root
The root node.
{name:SchemaObject} types
A schema types cache.
Method Details [hide private]

__init__(self, root, baseurl, options, container=None)
(Constructor)

source code 
Parameters:

mktns(self)

source code 

Make the schema's target namespace.

Returns: (prefix, uri)
The namespace representation of the schema's targetNamespace value.

build(self)

source code 

Build the schema (object graph) using the root node using the factory.

  • Build the graph.
  • Collate the children.

merge(self, schema)

source code 

Merge the contents from the schema. Only objects not already contained in this schema's collections are merged. This is to provide for bidirectional import which produce cyclic includes.

Returns: Schema
self

open_imports(self, options)

source code 

Instruct all contained sxbasic.Import children to import the schema's which they reference. The contents of the imported schema are merged in.

Parameters:

locate(self, ns)

source code 

Find a schema by namespace. Only the URI portion of the namespace is compared to each schema's targetNamespace. The request is passed to the container.

Parameters:
  • ns ((prefix,URI)) - A namespace.
Returns: Schema
The schema matching the namesapce, else None.

custom(self, ref, context=None)

source code 

Get whether the specified reference is not an (xs) builtin.

Parameters:
  • ref ((str|qref)) - A str or qref.
Returns: bool
True if not a builtin, else False.

builtin(self, ref, context=None)

source code 

Get whether the specified reference is an (xs) builtin.

Parameters:
  • ref ((str|qref)) - A str or qref.
Returns: bool
True if builtin, else False.

instance(self, root, baseurl, options)

source code 

Create and return an new schema object using the specified root and url.

Parameters:
Returns: Schema
The newly created schema object.

Note: This is only used by Import children.