
又来?
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("<?xml version='1.0' ?>" +
"<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>");
//Display the document element.
Console.WriteLine(doc.DocumentElement.OuterXml);
}
}
大概就是根据当前输入字符来判断读取XML文件的指定段之间的内容,然后传给XmlEle(又是一个我不知道什么的定义),关键是this,this就是本文件或者本类,this.Type判断本类的类型,此处的Type是属性,但是我始终不知道你的this的定义是什么,所以没法解释。
The Type property can only be set to primitive types and enumerations.
The XmlTextAttribute can also be applied to a field that returns an XmlNode or an array of XmlNode objects.
You can apply the XmlTextAttribute to a field or property that returns an array of strings. You can also apply the attribute to an array of type Object but you must set the Type property to string. In that case, any strings inserted into the array will be serialized as XML text.