Davide Brunato
Davide Brunato
Hi, extending couldn't be an option because XMLSchema and Schematron don't have nothing in common (as i remember, conversely Relax NG uses XSD datatypes and it could have more sense)....
Hi, your case is pretty complex and 'xsi:nil' is only partly related with the case of emptystring. In fact the current python decode of 'nillstring' is correct, because `{'@xsi:nil': 'true'}`...
> I don't agree that "python decode of 'nillstring' is correct" (and I don't follow your argument, perhaps you can elaborate). Converters shape the decoded data. For default complex elements...
### More details on xsi:nil and XML Schema content types Hi @th0ger, xsi:nil is one of the four attributes defined within `"http://www.w3.org/2001/XMLSchema-instance"` namespace. The meaning of these attributes is described...
For empty tags _ElementTree_ admits also an empty string for `elem.text` instead of `None` (depends by the parser). In any case an empty string is not considered a text node...
I would add two options for decoding (*to_dict/decode/iter_decode*): - **keep_empty**: if set to `True` empty elements that are valid are decoded with an empty string value instead of a `None`...
> > * **keep_empty**: if set to `True` empty elements that are valid are decoded with an empty string value instead of a `None` > > So that would apply...
> > > * **keep_empty**: if set to `True` empty elements that are valid are decoded with an empty string value instead of a `None` > > > > >...
Hi @th0ger, the release v2.0.3 has the new options described above. For your reported case a possible usage can be: ```python schema = xmlschema.XMLSchema(xsd) def filter_nil(element_data, *args): if not element_data.attributes:...
> The performance is also unaffected. It has been the occasion of realizing that in converters the emptiness checks on `data.text` were unnecessary. Removing them balance the additional check for...