LINQ TO XML Common Class
个人收集、整理了一些LINQ TO XML的基本方法,希望各位大虾多多指导:
/// <summary>
///Xml节点属性
/// </summary>
public class XmlAttribute
{
public XmlAttribute()
{
}
public XmlAttribute(string _key,object _value)
{
Key = _key;
Value = _value;
}
/// <summary>
/// 节点属性名
/// </summary>
public string Key { get; set; }
/// <summary>
/// 节点值
/// </summary>
public object Value { get; set; }
}
/// <summary>
///Xml文件节点
/// </summary>
public class XmlNode
{
public XmlNode()
{
}
public XmlNode(XElement _xemt)
{
xemt = _xemt;
}
public XmlNode(string _nodeName, object _nodeValue)
{
nodeName = _nodeName;
nodeValue = _nodeValue;
}
public XmlNode(string _nodeName, object _nodeValue, List<XmlNode> _childNodes, List<XmlAttribute> _attributeList)
{
nodeName = _nodeName;
nodeValue = _nodeValue;
childNodes = _childNodes;
attributeList = _attributeList;
}
/// <summary>
/// 节点对象
/// </summ
相关文档:
gloox自己实现了xml的解析模块,没有用到第三方的库(tinyXML,expat )
主要涉及的文件:
tag.h (tag.cpp)
taghandler.h
parser.h (parser.cpp)
1. Tag一个Tag就是一个XML元素
例如:
a.
<book kind='computer'>
<store id='23'/>
<author>
qiang
</author>
</bo ......
四种XML解析方法
xml文件:
<?xml version="1.0" encoding="GB2312"?>
<RESULT>
<VALUE>
<NO>A1234</NO>
<ADDR>四川省XX县XX镇XX路X段XX号</ADDR>
</VALUE>
<VALUE>
<NO>B1234</NO>
<ADDR>四川省XX市XX乡XX村XX组</ADDR>
</VALUE>
</RESULT>
1)DOM
& ......
XML现在已经成为一种通用的数据交换格式,它的平台无关性,语言无关性,系统无关性,给数据集成与交互带来了极大的方便。对于XML本身的语法知识与技术细节,需要阅读相关的技术文献,这里面包括的内容有DOM(Document Object Model),DTD(Document Type Definition),SAX(Simple API for XML),XSD(Xml Schema Definition),XSLT(Exten ......
wsdl.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<definitions name="MobilePhoneService"
targetNamespace="www.mobilephoneservice.com/MobilePhoneService-interface"
xmlns="http://schemas.xmlsoap.org/wsdl/"
  ......