我正在使用 C# 2.0,并且我有以下 xml 格式(这只是一个示例)并在 XPathDocument xmlData 中加载;
<?xml version="1.0"?>
<sitedata>
<resources>
<WorldwideSites>Worldwide sites</WorldwideSites>
<PublishedDate>20120507163835</PublishedDate>
</resources>
<region code="global" title="Global">
<site defaultLanguage="en" id="tcm:0-233-1" url="/english" countryCode="" title="" order="1">
<language code="en" pubId="tcm:0-233-1" countrylang="en-GB">English</language>
</site>
</region>
<region code="NSAM" title="North & South America">
<site defaultLanguage="es" id="tcm:0-520-1" url="/ar/spanish" countryCode="AR" title="Argentina">
<language code="es" pubId="tcm:0-520-1" countrylang="es-AR" >Español</language>
<language code="en" pubId="tcm:0-447-1" countrylang="en-AR" >English</language>
</site>
</region>
<region code="EU" title="Europe">
<site defaultLanguage="de" id="tcm:0-336-1" url="/at/german" countryCode="AT" title="Austria">
<language code="de" pubId="tcm:0-336-1" countrylang="de-AT" >Deutsch</language>
<language code="en" pubId="tcm:0-337-1" countrylang="en-AT" >English</language>
</site>
</region>
</sitedata>
现在我想创建一个 C# 2.0 函数,它将这个 XML 作为输入并返回一个多维数组或数组列表
ArrayList xmldata = new ArrayList();
xmldata[0][0] will be ["233"]["en-GB"] //a middle part of pubId attribute
xmldata[1][1] will be ["520"]["es-AR"] //attribute value of countrylang
..
..
and so on
或者建议最好的方法
请推荐!!
谢谢。