DotNet中的XML解析 [英] XML Parsing in DotNet

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

问题描述

大家好,

如何使用Web服务在ASP.Net中使用XML解析.任何人都可以告诉并提供示例吗?

Hi All,

How to use XML Parsing in ASP.Net using web service. Can anyone tell and give sample?

推荐答案

您可以通过多种方法进行操作.

使用XmlDocument和XmlNode等.

http://www.stardeveloper.com/articles/display.html?article=2009030701& page = 1 [ ^ ]

使用Xml Linq ....例如

You can do this a number of ways.

Using XmlDocument and XmlNode etc.

http://www.stardeveloper.com/articles/display.html?article=2009030701&page=1[^]

Using Xml Linq....e.g.

XDocument posLog = XDocument.Load(posLogPath);
XNamespace ns = "http://www.somenamespace.org/IXRetail/namespace/";

// Query the data and write out a subset of contacts
var transactions = from transaction in posLog.Descendants(ns + "Transaction")
where transaction.Descendants(ns + "SomeRequiredCriteria").Any()



尝试使用google,这两种技术都有很多示例



Try google, there are lots of examples of both techniques


XML解析是以ame方式执行的,而不管平台是什么(asp.net应用程序,Web服务,Windows服务,Winforms应用程序等) ).我会个人使用Xml.Linq,因为这些类比旧的.Net类更易于处理.

解析XML太大了,无法在快速解答"中进行完整讨论. Google是您的朋友.
XML parsing is performed the ame way, regardless of the platform (asp.net app, web service, windows service, winforms app, etc). I would use Xml.Linq personally because those classes are easier to deal with than the legacy .Net classes.

Parsing XML is too big of a topic to discuss in its entirety in Quick Answers. Google is your friend.


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

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