如何读取xml文件并将其存储在数据集中

问题描述:

大家好,



我需要读取xml文件并将值映射到数据集:我的xml文件包含以下内容:

Hi All,

I need to read an xml file and map the values to a Dataset:My xml file has contents like this:

<?xml version="1.0" ?>
- <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
- <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>CSRSI</Author>
  <Created>2013-03-21T03:21:55Z</Created>
  <Company>CSRSI</Company>
  <Version>11.773</Version>
  </DocumentProperties>
- <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG />
  </OfficeDocumentSettings>
- <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>15060</WindowHeight>
  <WindowWidth>8100</WindowWidth>
  <WindowTopX>-20</WindowTopX>
  <WindowTopY>-20</WindowTopY>
  <Date1904 />
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
  </ExcelWorkbook>
- <Styles>
- <Style ss:ID="Default" ss:Name="Normal">
  <Alignment ss:Vertical="Bottom" />
  <Borders />
  <Font ss:FontName="Verdana" />
  <Interior />
  <NumberFormat />
  <Protection />
  </Style>
- <Style ss:ID="s26">
  <Alignment ss:Horizontal="Left" ss:Vertical="Bottom" />
  <NumberFormat ss:Format="0" />
  </Style>
- <Style ss:ID="s27">
  <Alignment ss:Horizontal="Left" ss:Vertical="Bottom" />
  </Style>
  </Styles>
- <Worksheet ss:Name="SAQ_Data_2013-03-21">
- <Table x:FullColumns="1" x:FullRows="1">
  <Column ss:StyleID="s26" ss:AutoFitWidth="0" ss:Width="133.0" />
  <Column ss:StyleID="s27" ss:AutoFitWidth="0" ss:Width="94.0" />




- <Row>
- <Cell>
  <Data ss:Type="String">eonlint</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">UCWDC.ORG</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">2710</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">Confirmed</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String">817-23</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">NA</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">NA</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String">N/A</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String" />
  </Cell>
- <Cell>
  <Data ss:Type="String">2</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">B2</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">1.2</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">Yes</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">2010-09-14</Data>
  </Cell>
- <Cell>
  <Data ss:Type="String">Tracy Butler</Data>
  </Cell>









我需要存储它们在数据集中。我可以实现这个目标吗?请帮助



我需要将Cell Data值存储到数据集。



谢谢。





I need to store them in a Dataset.How can i achieve this? Please help

I need to store the Cell Data values to a Dataset.

Thanks.

请参阅本文 [ ^ ],可在Google找到。
See this article[^], found with Google.