代码

public SortedDictionary<string, object> FromXml(string xml)
{
SortedDictionary<string, object> m_values = new SortedDictionary<string, object>();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlNode xmlNode = xmlDoc.FirstChild;//获取到根节点<xml>
XmlNodeList nodes = xmlNode.ChildNodes;
foreach (XmlNode xn in nodes)
{
XmlElement xe = (XmlElement)xn;
m_values[xe.Name] = xe.InnerText;//获取xml的键值对到WxPayData内部的数据中
}
return m_values;
}

xml转化为Dictionary的更多相关文章

  1. C# Json数据反序列化为Dictionary并根据关键字获取指定值1

    Json数据: { "dataSet": { "header": { "returnCode": "0", " ...

  2. C# Json数据反序列化为Dictionary并根据关键字获取指定值

    Json数据: { "dataSet": { "header": { "returnCode": "0", " ...

  3. 将Dictionary序列化为json数据 、json数据反序列化为Dictionary

    需要引用System.Web.Extensions  dll类库 /// <summary> /// 将json数据反序列化为Dictionary /// </summary> ...

  4. C#:Json数据反序列化为Dictionary并根据关键字获取指定的值

    转自曾是土木人原文 C#:Json数据反序列化为Dictionary并根据关键字获取指定的值 Json数据: { "dataSet": { "header": ...

  5. Json 序列化为Dictionary

    如下所示的json字符串中包含中文属性转换成英文属性 ["sid":"dd1312","success":true,"data&q ...

  6. 支持 XML 序列化的 Dictionary

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.X ...

  7. xml 文件转化Dictionary

    下面是xml文件 <?xml version="1.0" encoding="utf-8" ?><nodes> <国土局> ...

  8. sql里的in对应linq的写法 及 IQueryable转化为Dictionary

    string[] arID = { "0001", "0002" }; var dict = this.service.GetMyList(m => ar ...

  9. string 转化xml && xml转化为string

    一.使用最原始的javax.xml.parsers,标准的jdk api // 字符串转XML [java] view plaincopyprint? String xmlStr = \". ...

随机推荐

  1. Haskell语言学习笔记(82)Extensible effects

    安装 extensible-effects $ cabal install extensible-effects Installed extensible-effects-3.0.0.0 Extens ...

  2. 关于在VS2008和VS2010中禁用及卸载Visual Assist X的方法研究——转载

    禁用和启用   此方法对于VS2008和VS2010 都适用. 在VS2008或VS2010菜单栏中选择“VassistX”选项卡,找到“Enable/Disable Visual Assist X” ...

  3. 手机调试 fiddler

    使用Fiddler调试手机程序 | 前端和运维利器 2015-11-27  zhy97031  文章来源  阅 688  转 4 转藏到我的图书馆   微信分享:   作者:Uncle Chen 原文 ...

  4. KADEMLIA算法学习

    在上一篇文章中<P2P技术是什么>,我们介绍了P2P技术的特点以及发展历史.在本篇文章中,我们来介绍某一个具体的算法. 如今很多P2P网络的实现都采用DHT的方式实现查找,其中Kademl ...

  5. vue 路由meta作用及在路由中添加props作用

    vue路由meta:有利于我们处理seo的东西,我们在html中加入meta标签,就是有利于处理seo的东西,搜索引擎 在路由中传参是通过/:id传参代码如下: import Login from ' ...

  6. node+mysql简单注册

    1前台文件 <!doctype html> <html> <head> <meta charset="UTF-8" /> <t ...

  7. numpy 矩阵变换transpose和swapaxes

    1.transpose 交换 arr = np.random.arange().reshape((,,)) # ** = 则 arr_shape = arr.shape # ,, 则 arr 索引 # ...

  8. jar is specified twice.

    Warning:Exception while processing task java.io.IOException: The same input jar [libs\afinal_0.5.1_b ...

  9. Java虚拟机1

    Java内存区域 程序计数器(Program Counter Register):记录当前线程所执行字节码的行号指示器.字节码解释器工作时,判断是循环,分支,跳转,异常等条件,然后更新这个计数器的值来 ...

  10. CentOS7下解决yum install mysql-server没有可用包

    # wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm --  http://repo.mysql.com/mysq ...