XML数据集 [英] XML Datasets

查看:90
本文介绍了XML数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

 

我有一个XML文档,我希望将其转换为数据集并绑定到报告文件(rdlc)。 XML文档采用以下一般形式: 

I have an XML document that I want to turn into a data set and bind to a report document (rdlc). The XML document takes the general form of : 


<ROOT>
- <DATA>
-  <DataOne>
   <Tag>F10188L8</Tag> 
   <Tag>0</Tag> 
  </DataOne>
-  <DataTwo>
-   <DataName>
    <Tag>P</Tag> 
    <Tag>-</Tag> 
    <Tag>7</Tag> 
    <Tag>-</Tag> 
   </DataTwo>
-  <DataTwo>
-   <DataName>
    <Tag>P</Tag> 
    <Tag>-</Tag> 
    <Tag>7</Tag> 
   </DataTwo>
 </DATA>
</ROOT>

推荐答案

我认为DataSet的ReadXml方法不能像那样处理XML因为该方法将叶元素名称映射到列名和数据表中你不能有两个同名的列。因此,对于具有
同名"Tag"的兄弟叶元素的XML示例,您将收到一个错误,即您不能拥有两个同名的列。
I don't think the DataSet's ReadXml method can deal with XML like that as that method maps leaf element names to column names and in a data table you can't have two columns with the same name. So with that XML sample having sibling leaf elements of the same name 'Tag' you will get an error that you can't have two columns of the same name.


这篇关于XML数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆