I'm having a xsd file and need to create an xml accordingly.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="edateTimeType">
<xs:restriction base="xs:dateTime">
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="eEurocents">
<xs:restriction base="xs:int">
<xs:maxExclusive value="1000000"/>
<xs:minExclusive value="-1000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="unixTimestampType">
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="1262304000"/>
<!-- after 1.1.2010-->
</xs:restriction>
</xs:simpleType>
<xs:complexType name="timeRangeType">
<xs:sequence>
<xs:element name="start" type="edateTimeType" minOccurs="1" maxOccurs="1"/>
<xs:element name="stop" type="edateTimeType" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:element name="apiobject">
<xs:complexType>
<xs:sequence>
<xs:element name="header" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="A" type="eEurocents" minOccurs="1" maxOccurs="1"/>
<xs:element name="B" type="eEurocents" minOccurs="0" maxOccurs="1"/>
<xs:element name="unixTimestamp" type="unixTimestampType" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:choice maxOccurs="1">
<xs:element name="response" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="TableType1" minOccurs="0" maxOccurs="5">
<xs:complexType>
<xs:sequence>
<xs:element name="teid" type="unixTimestampType"/>
<xs:element name="entry" type="eEurocents" maxOccurs="192"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="request" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="TableType1" minOccurs="0" maxOccurs="5">
<xs:complexType>
<xs:sequence>
<xs:element name="timestamp" type="unixTimestampType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I've done that several time before using python3 pyxb/pyxbgen and importing the bindings lib.
Now I have tried the same with a new version of the xsd file. The new xsd has in the apiobject two type of objects, requests and responses. The type TableType1 is defined differently for response and requests. But in the binding lib, the inner types of the requests and responses are not accessible to me.
What I would like to do is to generate an xml string for an apiobject with a response containing a TableType1. But since I cannot access the TableType1 object, I neither can fill it up nor put it to the response of the apiobject.
How can I create a valid apiobject response with TableType1?
PS: Some xml Editor says the xsd is valid. But pyxb cannot import a sample xml file using the xsd scheme...