我必须将Map-Map1转换为Map2。
地图1:
A.B.Key = "Key"
A.B.Value = "Value"
A.B.Key1 = "Key1"
A.B.Value1 = "Value1"
A.B.Key2 = "Key2"
A.B.Value2 = "Value2"
地图2:
Key = Value
Key1 = Value1
Key2 = Value2
Map1是从这个XML文件创建的:
XML文件:
<A>
<B>
<Key> Key </Key>
<Value> Value </Value>
</B>
<B>
<Key> Key1 </Key>
<Value> Value1 </Value>
</B>
<B>
<Key> Key2 </Key>
<Value> Value2 </Value2>
</B>
</A>
我遇到了问题,因为Map1内容不在XML文件中提到的顺序中。 Map1是这样的:
实际Map1:
A.B.Key2 = "Key2"
A.B.Key = "Key"
A.B.Value = "Value"
A.B.Value1 = "Value1"
A.B.Value3 = "Value2"
A.B.Key1 = "Key1"
我哪里错了?