62,041
社区成员
发帖
与我相关
我的任务
分享
<Question>
<QuestionType Code="1" Type="单选题" />
<QuestionField>
<Field Name="T_Title" />
<Field Name="T_Type" />
</QuestionField>
</Question>
XmlDocument doc = new XmlDocument();
doc.LoadXml(@"
<Question>
<QuestionType Code=""1"" Type=""单选题"" />
<QuestionField>
<Field Name=""Q_Title"" />
<Field Name=""Q_Type"" />
<Field Name=""Q_DropDownBox"" />
<Field Name=""Q_PictureRotation"" />
<Field Name=""Q_Rotation""/>
</QuestionField>
</Question>");
doc.SelectSingleNode(@"//Field[@Name=""Q_Title""]").Attributes["Name"].InnerText = "T_Title";
doc.SelectSingleNode(@"//Field[@Name=""Q_Type""]").Attributes["Name"].InnerText = "T_Type";
doc.FirstChild.LastChild.RemoveChild(doc.SelectSingleNode(@"//Field[@Name=""Q_DropDownBox""]"));
doc.FirstChild.LastChild.RemoveChild(doc.SelectSingleNode(@"//Field[@Name=""Q_PictureRotation""]"));
doc.FirstChild.LastChild.RemoveChild(doc.SelectSingleNode(@"//Field[@Name=""Q_Rotation""]"));
Console.Write(doc.InnerXml);