C# xml2json
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml; namespace xml2json
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string xml = @"<dataestimate>
<OwnerName>CRM06手机端赵雅琪</OwnerName>
<StepName>赵雅琪</StepName>
<DEName>测试环境跑流程---1</DEName>
<ID>150F2263-C56A-E611-80C0-00155DB6760B</ID>
<CPName>测试环境跑流程</CPName>
<AccountInfoName>crm06专属客户</AccountInfoName>
<AccountName>艾迪美通</AccountName>
<Saler>CRM06手机端赵雅琪</Saler>
<SalerList>CRM01杨静</SalerList>
<EFTypeValues>1197CF3B-C56A-E611-80C0-00155DB6760B;1297CF3B-C56A-E611-80C0-00155DB6760B</EFTypeValues>
<Monitor>是</Monitor>
<Budget>234.00</Budget>
<Reason>2344</Reason>
<OwnerSType>100000000</OwnerSType>
<OPOwnerSType>100000000</OPOwnerSType>
<effecttype>
<effecttype>
<EFID>662AC533-C56A-E611-80C0-00155DB6760B</EFID>
<EFName>CPC</EFName>
</effecttype>
<effecttype>
<EFID>1197CF3B-C56A-E611-80C0-00155DB6760B</EFID>
<EFName>CPM</EFName>
</effecttype>
<effecttype>
<EFID>1297CF3B-C56A-E611-80C0-00155DB6760B</EFID>
<EFName>PV</EFName>
</effecttype>
<effecttype>
<EFID>D7849F46-C56A-E611-80C0-00155DB6760B</EFID>
<EFName>点击</EFName>
</effecttype>
</effecttype>
</dataestimate>"; XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
string json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(doc); Response.Write(json); }
}
}
C# xml2json的更多相关文章
- electron package can not find module xml2json
问题 electron 打包好的应用找不到xml2json 但是开发环境npm start 运行正常 定位 node_modules没有包含在打的包中, 解决办法 --no-prune Be care ...
- XML2JSON 的【net.sf.json.JSONException: nu.xom.ParsingException must be followed by either attribute specifications, ">" or "/>"】问题解决办法
在使用JSon-Lib库进行XML2JSon的转换时,在JUnit测试时没有什么问题,但是在Tomcat里面跑的时候,抛出了下面的异常,查找了google,发现关于这方便的文章比较少,即使有,也需要F ...
- Java中xml2json,json2xml
在JAVA中xml与json数据互相转换 package com.sgcc.platform.common.utils; import static java.lang.String.format; ...
- staxon实现json和xml互转
pom.xml: <dependency> <groupId>de.odysseus.staxon</groupId> <artifactId>stax ...
- postman 断言解析
最近在学习postman官方文档, 顺势翻译出来,以供学习! postman断言是JavaScript语言编写的,在postman客户端指定区域编写即可. 断言会在请求返回之后,运行,并根据断言的pa ...
- json、javaBean、xml互转的几种工具介绍
json.javaBean.xml互转的几种工具介绍 转载至:http://blog.csdn.net/sdyy321/article/details/7024236 工作中经常要用到Json.Jav ...
- 关于JSON的那些事儿
JSON的那些事儿 曾经有一段时间,XML是互联网上传输结构化数据的事实标准,其突出特点是服务器与服务器间的通信.但是业内不少人认为XML过于繁琐.冗长,后面为了解决这个问题也出现了一些方案,但是由于 ...
- SQL2008使用json.net实现XML与JSON互转
借助CLR,首先实现字符串的互转,然后使用存储过程实现JSON2table public class JsonFunction { /// <summary> ...
- JAVA微信支付多次回调方法解决方案
@WebServlet("/ActionServlet")public class PayWxOrderingReqCBS extends HttpServlet { public ...
随机推荐
- angualrjs学习总结三(http、select、表格、指令以及事件)
一:http XMLHttpRequest:$http是angularjs的一个核心服务,用于读取远程服务器的数据.$http.get(url) 是用于读取服务器数据的函数.举例:<div ng ...
- oracle中的 exists 和 in 的效率问题
1) select * from T1 where exists(select * from T2 where T1.a=T2.a) ; T1数据量小而T2数据量非常大时,T1<<T2 时 ...
- 使用jQuery获取Bootstrap Switch的值
$('#switcher').bootstrapSwitch('state'); // true || false $('#switcher').bootstrapSwitch('toggleStat ...
- touch——移动端
touch事件原生一定要用addEventListener来绑定 一.原生 touchstart:触摸开始时触发 touches:当前位于屏幕上所有手指的列表 event.touches.length ...
- SQL SERVER中的逻辑读,预读和物理读
sqlserver:数据存储方式:最小单位是页,每一页8k,sqlserver 对页的读取是具有原子性,也就是说,要么读取完整一页,要么完全不读取,不会有中间状态,而页之间的数据组织结构是B树 但是每 ...
- 转载---SQL Server XML基础学习之<6>--XQuery的 value() 方法、 exist() 方法 和 nodes() 方法
/*------------------------------------------------------------------------------+ #| = : = : = : = : ...
- Install GTK in Ubuntu
reference: http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html 一.安装 1.安装gcc/g++/gdb/make 等 ...
- 通过自关联替代开窗函数实现SQL优化
数据库环境:SQL SERVER 2005 我们平时都是通过开窗析函数来取代自关联,减少表扫描,从而优化SQL.今天,反其道而行, 用自关联改写开窗函数.我们先来看一下SQL. 原SQL语句 SELE ...
- 经历:如何设置jquery easyui中下拉框不可编辑
今天,在项目中碰到一个这样的问题,当选择按钮时候,查询条件是可以输入的,否则,表单框是不可用的[图1].但是,批量查询中的船名和装港用到了自动配置,即jquery-easyui中的combox的配置. ...
- SVN服务器从Windows迁移到Linux
gerui 2013.9.14 ge-rui@sohu.com 一.备份VisualSVN项目 1. 现在要使用Linux作为svn服务器,之前是在windows Server 2008上的,用的是V ...