martinblech/xmltodict

force datatype

Opened this issue · 1 comments

Currently parsing a XML renders string values only, so xmltodict cannot be used e.g. as input of fastavro if the avro schema has a mix of data types.

Enhancement request is to have a optional argument like forced_list but for (key, datatype) tuples or similar syntax. The comment #104 (comment) would actually meet both requirements.

Alternative: write complex post-processing function.

Note another library, xmlschema, uses the datatypes defined in a xml schema file, if available. But this is much slower than xmltodict especially if only a few fields should be force-converted.

Facing same issue.