我有一個XML的結構有點像這樣失去了:爲了解析的元素是在XMLBeans的
<root>
<a/>
<b/>
<b/>
<a/>
<a/>
</root>
我的XSD看起來是這樣的:
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element ref="a"/>
<xs:element ref="b"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="a" type="xs:string" />
<xs:element name="b" type="xs:string" />
即我有兩個不同的子標籤的隨機序列。
使用的XMLBeans我得到一個根對象訪問方法: getAArray(),getBArray()
而且這裏是我的問題:
標籤由名字和原來的順序(A,B,B分組,a,a)丟失。
但我需要知道這些元素的順序。
用XMLBeans做到這一點的最佳/最簡單的方法是什麼?
正是我想要的。返回解析的XMLBeans。非常感謝你。 – Stroboskop 2009-06-10 14:55:35