日期:2014-05-18  浏览次数:20827 次

读取Xml文件中的DocmentType节点
xml文件中有一个DocmentType节点:
<!DOCTYPE configuration [<!ELEMENT PatchInfos ANY><!ATTLIST PatchInfos ID ID #REQUIRED>]>

怎么才能把"[<!ELEMENT PatchInfos ANY><!ATTLIST PatchInfos ID ID #REQUIRED>]"读出来反给一个字符串?

------解决方案--------------------
C# code
        string xml = "<!DOCTYPE configuration [<!ELEMENT PatchInfos ANY><!ATTLIST PatchInfos ID ID #REQUIRED>]><items>1111</items>";
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(xml);
        XmlDocumentType xdt = doc.DocumentType;
        Response.Write(xdt.InternalSubset);