xsdata.codegen.transformer module¶
-
class
xsdata.codegen.transformer.
SchemaTransformer
(print, config)[source]¶ Bases:
object
Orchestrate the code generation from a list of sources to the output format.
- Parameters
print (
bool
) – Print to stdout the generated outputconfig (
GeneratorConfig
) – Generator configuration
-
class_map
: Dict[str, List[xsdata.codegen.models.Class]]¶
-
process_schema
(uri, namespace=None)[source]¶ Parse and convert schema to codegen models.
Avoid processing the same uri twice and fail silently if anything goes wrong with fetching and parsing the schema document.
-
convert_schema
(schema)[source]¶ Convert a schema instance to codegen classes and process imports to other schemas.
- Parameters
schema (
Schema
) –
-
convert_definitions
(definitions)[source]¶ Convert a definitions instance to codegen classes.
- Parameters
definitions (
Definitions
) –
-
classmethod
parse_schema
(uri, namespace)[source]¶ Parse the given schema uri and return the schema tree object.
Optionally add the target namespace if the schema is included and is missing a target namespace.
-
parse_definitions
(uri, namespace)[source]¶ Parse recursively the given wsdl uri and return the definitions tree object.
- Raises
OSError – if it fails to load the definition uri.
- Parameters
- Return type
-
analyze_classes
(classes)[source]¶ Analyzer the given class list and simplify attributes and extensions.