.net 读写 xml 文档详解
一 .Net 框架中与 XML 有关的命名空间
System.Xml 包含了一些和 XML 文档的读写操作相关的类,
它 们 分 别 是 : XmlReader 、 XmlTextReader 、
XmlValidatingReader 、 XmlNodeReader 、 XmlWriter 、
XmlTextWriter 以 及 XmlNode ( 它 的 子 类 包 括 :
XmlDocument、XmlDataDocument、XmlDocumentFragment)
等类。
System.Xml.Schema 包含了和 XML 模式相关的类,这些
类包括 XmlSchema、XmlSchemaAll、XmlSchemaXPath 以及
XmlSchemaType 等类。
System.Xml.Serialization 包含了和 XML 文档的序列化
和反序列化操作相关的类。序列化:将 XML 格式的数据转化
为流格式的数据,并能在网络中传输;反序列化:完成相反
的操作,即将流格式的数据还原成 XML 格式的数据。
System.Xml.Xpath 包 含 了 XPathDocument 、
XPathExression、XPathNavigator 以及 XPathNodeIterator
等 类 , 这 些 类 能 完 成 XML 文 档 的 导 航 功 能 。( 在
XPathDocument 类的协助下,XPathNavigator 类能完成快速
的 XML 文档导航功能,该类为程序员提供了许多 Move 方法