在以下的例子里,红色部分就是自己定义的,好象兰色部分不可以自己定义.具体的我也不是很明白,因为也是第一次遇到这样的问题. using System; using System.IO; using System.Xml;
public class Sample { public static void Main() { // Create the XmlDocument. XmlDocument doc = new XmlDocument(); doc.LoadXml("<!DOCTYPE sfsf [<!ENTITY h 'hardcover'>]>" + "<book genre='novel' ISBN='1-861001-57-5'>" + "<title>Pride And Prejudice</title>" + "<style>&h;</style>" + "</book>");
// Display information on the DocumentType node. XmlDocumentType doctype = doc.DocumentType; Console.WriteLine("Name of the document type: {0}", doctype.Name); Console.WriteLine("The internal subset of the document type: {0}", doctype.InternalSubset);