我有一个如下的 Xml:
<Phrase Entry="ID">
<Ans number="1">
<Identification LastName="Bornery" Name="John" Age="23"/>
<Identification LastName="Grify" Name="Johnson" Age="29"/>
<Identification LastName="Alisen" Name="Julia" Age="38" City="NewYork" Job="Teacher"/>
<Identification LastName="Bornery" Name="John" Weight="85"/>
</Ans>
</Phrase>
我希望能够列出Xml属性及其值的列表,如下所示:
MyList = {LastName="Bornery" , Name="John", Age="23" , LastName="Grify" ,
Name="Johnson", Age="29", LastName="Alisen",
Name="Julia", Age="38", City="NewYork", Job="Teacher",
LastName="Bornery", Name="John", Weight="85"}
Attributes
集合,因此需要迭代遍历所有节点。 - Karel Frajták