我正在使用 WPF 和一个稍微不寻常的 xml 文件,我试图用它来填充数据网格。在根节点和重复的顺序节点之间,有四个节点是根的子节点,并且仅出现在顶部,我似乎无法导航到顺序节点。如果我删除这前四个节点,它会按预期填充。
这是不起作用的xml:
<evec_api method="quicklook" version="2.0">
<quicklook>
<item>40</item>
<itemname>Megacyte</itemname>
<regions/><hours>360</hours>
<minqty>10001</minqty>
<sell_orders>
<order id="2686762970">
<region>10000002</region>
<station>60003760</station>
<station_name>Jita IV - Moon 4 - Caldari Navy Assembly Plant</station_name>
<security>0.9</security>
<range>32767</range>
<price>2534.98</price>
<vol_remain>750000</vol_remain>
<min_volume>1</min_volume>
<expires>2013-03-13</expires>
<reported_time>12-13 10:54:11</reported_time>
</order>
<order id="2686763351">
<region>10000002</region>
<station>60003760</station>
<station_name>Jita IV - Moon 4 - Caldari Navy Assembly Plant</station_name>
<security>0.9</security>
<range>32767</range>
<price>2545.99</price>
<vol_remain>709273</vol_remain>
<min_volume>1</min_volume>
<expires>2013-03-13</expires>
<reported_time>12-13 10:54:11</reported_time>
</order>
</sell_orders>
</quicklook>
</evec_api>
XAML(不适用于上述):
<DataGrid x:Name="grid" ItemsSource="{Binding Path=Element
Element[item].Element[itemname].Element[regions].Element[minqty]
.Element[sell_orders].Elements[order]}">
这是 xml 减去前四个有效的节点:
<evec_api method="quicklook" version="2.0">
<quicklook>
<sell_orders>
<order id="2686762970">
<region>10000002</region>
<station>60003760</station>
<station_name>Jita IV - Moon 4 - Caldari Navy Assembly Plant</station_name>
<security>0.9</security>
<range>32767</range>
<price>2534.98</price>
<vol_remain>750000</vol_remain>
<min_volume>1</min_volume>
<expires>2013-03-13</expires>
<reported_time>12-13 10:54:11</reported_time>
</order>
<order id="2686763351">
<region>10000002</region>
<station>60003760</station>
<station_name>Jita IV - Moon 4 - Caldari Navy Assembly Plant</station_name>
<security>0.9</security>
<range>32767</range>
<price>2545.99</price>
<vol_remain>709273</vol_remain>
<min_volume>1</min_volume>
<expires>2013-03-13</expires>
<reported_time>12-13 10:54:11</reported_time>
</order>
</sell_orders>
</quicklook>
</evec_api>
XAML(与上面的 xml 一起使用):
<DataGrid x:Name="grid" ItemsSource="{Binding Path=Element
[quicklook].Element[sell_orders].Elements[order]}">
任何帮助,将不胜感激。