我正在尝试使用pyxb库解析简单和复杂类型的XML文件。以下是XML结构:
你知道吗 你知道吗
</Requirement>
<Section name="Electrical Characteristics">
</Section>
</Section>
</Source>
</Requirements>
在通过pyxb读写之后,我按照以下顺序得到了XML,其中需求和部分的顺序发生了变化
你知道吗 你知道吗
<Section name="Electrical Characteristics">
</Section>
</Requirement>
</Section>
</Source>
</Requirements>
我编写了一个脚本,将XML转储到pyxb对象,并使用orderedContent()
以以下方式保持顺序
ordered_instance = instance.orderedContent()
我在ordered_instance
变量中得到一个空列表
目前没有回答
相关问题 更多 >
编程相关推荐