Five XML Tips

怪我咯
Release: 2017-04-05 17:35:58
Original
1350 people have browsed it

Tip 1
The difference between XmlNode.InnerText and .InnerXml is: the former changes the < and > in the content into < and > respectively. Therefore, programs that want to merge two XmlDocument can only use

XmlDocumentFragment.InnerXml = XmlNode.OuterXml


Tip 2

/XPath: string end-with




Tips 3
If an XML document fails to load, it is not legal at all; whether it meets the requirements of a certain Schema (XSD) is a validity check by using the Schemas and ValidationType attributes of the XmlValidatingReader object.

Tips 4
The XmlDataDocument class is derived from XmlDocument. The most important thing is to add a DataSet attribute. However, this class is not provided by System.Xml, but by System.Data. For applications that always have to deal with the database, they have to reference System.Data anyway, so it is better to use XmlDataDocument entirely.

Tips 5
How to save the DataSet updates in the XmlDataDocument object to the database? DataSet itself has an AcceptChanges method, so just need:

xmlDataDoc.DataSet.AcceptChanges();

The above is the detailed content of Five XML Tips. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!