XML-RPC .Net-如何读取数组的数组 [英] XML-RPC .Net - How read arrays of arrays

查看:71
本文介绍了XML-RPC .Net-如何读取数组的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,请帮助,如何在C#中阅读此结构:

结构:
数组行(报告数据行
数组行(
..行值
)

在XML中:

Hi,please help, How read this struct in C#:

Struct:
array rows ( Report data rows
array row (
..Row values
)

In XML:

<member>
  <name>rows</name>
  <value>
    <array>
      <data>
        <value>
          <array>
            <data>
              <value>
                <i4>1213028</i4>
              </value>
              <value>
                <string>products</string>
              </value>
            </data>
          </array>
        </value>
      </data>
    </array>
  </value>
</member>






Tom






Tom

推荐答案

我建​​议在代码中模拟一些存根数据,因为您显然知道类的结构是什么(通常是3层或在各个维度上深的项目足以对数据结构进行抽烟测试),然后序列化为xml文件(您可以通过这种方式免费获得架构),然后使用该文件来获取数据格式.

如果那在第一次修改前不起作用,请先修改一下,否则请tweek将您的xml放入您的类中..

从长远来看,这将对您更有利,因为从xml转到类结构总是比从类结构转到xml更加困难.
I recommend mocking out some stub data inside your code since you obviously know what the structure of your class is(usually 3 layers or items deep in all dimensions is sufficient to smoke test the data structure), then serialize to an xml file (you get the schema for free this way ) and use that to get your data format.

if that doesn''t work on the first go modify until you get it right, or tweek your xml to get it into your class..

In the long run this will be way more beneficial to you, as it is always harder to go from xml into class structure then it is to go from class structure to xml.


这篇关于XML-RPC .Net-如何读取数组的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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