utils
Supporting utilities for working with XML & SOAP
generate_xml_array ¶
generate_xml_array(values: List[Any]) -> xsd.ComplexType
xmlmap_to_model ¶
xmlmap_to_model(
xmlmap: etree.Element,
model_type: Type[T],
*,
strict: bool = True
) -> T
Converts XML ns2:Map to a model of type model_type
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xmlmap |
etree.Element
|
xml subtree (ns2:Map) representing a model |
required |
model_type |
Type[T]
|
model type to map data into |
required |
strict |
bool
|
fail if the returned data doesn't match the model. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
if |
ValueError
|
if the model_type is not an attrs-based model. |
Returns:
Name | Type | Description |
---|---|---|
T |
T
|
generated model instance |