0
我有XML字符串,如:如何取消未分類的集合?
<Tree Name="tree1">
<Service>Service1</Service>
<Tree Name="tree2">
<Service>Service2</Service>
<Service>Service3</Service>
</Tree>
<Service>Service4</Service>
<Tree Name="tree3">
<Service>Service4</Service>
<Service>service5</Service>
</Tree>
</Tree>
和裝訂結構:
<mapping ordered="false" allow-repeats="true" abstract="true" type-name="Tree"
class="Tree">
<collection ordered="false" allow-repeats="true" get-method="getTrees" set-method="setTrees" usage="optional">
<structure usage="optional" ordered="false" allow-repeats="true" map-as="Tree" name="Tree"/>
</collection>
<collection ordered="false" allow-repeats="true" get-method="getServices" set-method="setServices" usage="optional">
<structure usage="optional" ordered="false" allow-repeats="true" map-as="Service" name="Service"/>
</collection>
<value style="attribute" name="Name" get-method="getName" set-method="setName" usage="optional"/>
</mapping>
但是當我嘗試和解組XML我抓到根只有一棵樹,只有一個服務。是否有任何posibilites從XML獲取所有數據?