config
xsdata.formats.dataclass.parsers.config
ParserConfig
dataclass
Parsing configuration options.
Not all options are applicable for both xml and json documents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url | Optional[str] | Specify a base URL when parsing from memory, and you need support for relative links e.g. xinclude | None |
load_dtd | bool | Enable loading external dtd (lxml only) | False |
process_xinclude | bool | Enable xinclude statements processing | False |
class_factory | Callable[[Type[T], Dict[str, Any]], T] | Override default object instantiation | default_class_factory |
fail_on_unknown_properties | bool | Skip unknown properties or fail with exception | True |
fail_on_unknown_attributes | bool | Skip unknown XML attributes or fail with exception | False |
fail_on_converter_warnings | bool | Turn converter warnings to exceptions | False |
Source code in xsdata/formats/dataclass/parsers/config.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
default_class_factory(cls, params)
The default class factory.
To be used as a hook for plugins.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls | Type[T] | The target class type to instantiate | required |
params | Dict[str, Any] | The class keyword arguments | required |
Returns:
Type | Description |
---|---|
T | A new class instance with the given params. |
Source code in xsdata/formats/dataclass/parsers/config.py
7 8 9 10 11 12 13 14 15 16 17 18 19 |
|