Open danaki opened 2 years ago
Hello,
Spend a time learning from code to get the complete list of values described in enumeration but didnt find. Having this scheme:
schema = xsd.Schema( load_xml( """ <?xml version="1.0"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tests.python-zeep.org/" targetNamespace="http://tests.python-zeep.org/" elementFormDefault="qualified"> <simpleType name="CountryNameType"> <list> <simpleType> <restriction base="string"> <enumeration value="None"/> <enumeration value="AlternateName"/> <enumeration value="City"/> <enumeration value="Code"/> <enumeration value="Country"/> </restriction> </simpleType> </list> </simpleType> <element name="something" type="tns:CountryNameType"/> </schema> """ ) )
How do I get the list ['None', 'AlternateName', 'City', 'Code', 'Country']?
['None', 'AlternateName', 'City', 'Code', 'Country']
>>> element_cls = schema.get_element("{http://tests.python-zeep.org/}something") >>> element_cls <Element(name='something', type=<zeep.xsd.types.collection.ListType object at 0x7fb056073ac0>)>
Which is a ListType of strings with possible values that should be exposed I guess.
Hello,
Spend a time learning from code to get the complete list of values described in enumeration but didnt find. Having this scheme:
How do I get the list
['None', 'AlternateName', 'City', 'Code', 'Country']
?Which is a ListType of strings with possible values that should be exposed I guess.