orderedContent PyXB return empty lists

79 Views Asked by At

I am trying to parse and XML file with simple and complex types using pyxb library. The following is the XML structure :

            </Requirement>
            <Section name="Electrical Characteristics">                     
            </Section>
        </Section>
    </Source>
</Requirements>

After reading writing it through pyxb I am getting the XML in following order where the order of Requirement and section is changed.

            <Section name="Electrical Characteristics">                     
            </Section>

            </Requirement>
        </Section>
    </Source>
</Requirements>

I have written a script which dumps XML to pyxb object and I used orderedContent() to preserve order in the following way.

ordered_instance = instance.orderedContent()

I am getting empty list in ordered_instance variable.

0

There are 0 best solutions below