[Generateds-discuss] Single simpleType results in un-exportable enum
Brought to you by:
dkuhlman
From: David F. <fer...@gm...> - 2023-06-14 13:19:30
|
Hi, I'm trying to use generateDS to parse and generate XML documents, and am very impressed so far - it is handling some complex XSDs very well. However I seem to have run into an issue for a simple XSD, where only a single simpleType enum is defined. My XDS is as follows: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="4.1.0"> <xsi:simpleType name="MyTestXML"> <xsi:restriction base="xsd:string"> <xsi:enumeration value="ValueA"/> <xsi:enumeration value="ValueB"/> </xsi:restriction> </xsi:simpleType> </xsi:schema> And the XML documents are very simple, for example <MyTestXML>ValueA</MyTestXML>. When I run generateDS with `generateDS -o test.py test.xsd `, the output is just an enum, eg: class MyTestXML(str, Enum): VALUE_A='ValueA' VALUE_B='ValueB' And therefore I cannot parse, or export XML documents. Is this something I'm doing wrong, or a limitation in the program? Many thanks, David |