xsdata.codegen.transformer module

class xsdata.codegen.transformer.SchemaTransformer(print, output)[source]

Bases: object

Parameters
  • print (bool) –

  • output (str) –

print: bool = None
output: str = None
processed: List[str] = None
process(urls, package)[source]
Parameters
process_schemas(urls, package)[source]
Parameters
Return type

List[Class]

process_schema(url, namespace=None)[source]

Recursively parse the given schema url and the included schemas and generate a list of classes.

Parameters
Return type

Dict[str, List[Class]]

process_included(included, namespace)[source]

Prepare the given included schema location and send it for processing.

Parameters
Return type

Dict[str, List[Class]]

generate_classes(schema)[source]

Convert the given schema tree to codegen classes and use the writer factory to either generate or print the result code.

Parameters

schema (Schema) –

Return type

List[Class]

static parse_schema(url, namespace)[source]

Parse the given schema url and return the schema tree object.

Optionally add the target namespace if the schema is included and is missing a target namespace.

Parameters
Return type

Optional[Schema]

static analyze_classes(classes)[source]

Analyzer the given class list and simplify attributes and extensions.

Parameters

classes (List[Class]) –

Return type

List[Class]

count_classes(classes)[source]

Return a tuple of counters for the main and inner classes.

Parameters

classes (List[Class]) –

Return type

Tuple[int, int]

classmethod assign_packages(class_map, package)[source]

Group uris by common path and auto assign package names to all classes.

Parameters
classmethod assign_package(classes, package)[source]
Parameters