本文整理汇总了C#中Discuz.Common.Xml.XmlDocumentExtender.CreateCDataSection方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDocumentExtender.CreateCDataSection方法的具体用法?C# XmlDocumentExtender.CreateCDataSection怎么用?C# XmlDocumentExtender.CreateCDataSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Discuz.Common.Xml.XmlDocumentExtender
的用法示例。
在下文中一共展示了XmlDocumentExtender.CreateCDataSection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: savetopic_Click
protected void savetopic_Click(object sender, EventArgs e)
{
#region 保存主题修改
XmlDocumentExtender doc = new XmlDocumentExtender();
doc.Load(configPath);
XmlNodeList topiclistNode = doc.SelectNodes("/Aggregationinfo/Aggregationpage/Website/Forum/Topiclist/Topic");
XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor();
foreach (XmlNode topic in topiclistNode)
{
topicvisitor.SetNode(topic);
if (topicvisitor["topicid"] == topicid.Value)
{
topicvisitor["topicid"] = topicid.Value;
topicvisitor["title"] = tbtitle.Text;
topicvisitor["poster"] = poster.Text;
topicvisitor["postdatetime"] = postdatetime.Text;
XmlCDataSection shortDes = doc.CreateCDataSection("shortdescription");
shortDes.InnerText = shortdescription.Text;
topicvisitor.GetNode("shortdescription").RemoveAll();
topicvisitor.GetNode("shortdescription").AppendChild(shortDes);
break;
}
}
doc.Save(configPath);
Response.Redirect("aggregation_editforumaggset.aspx");
#endregion
}
示例2: ModifyNode
private void ModifyNode(XmlDocumentExtender doc,string topicPath)
{
XmlNodeList topiclistNode = doc.SelectNodes(topicPath);
XmlNodeInnerTextVisitor topicvisitor = new XmlNodeInnerTextVisitor();
foreach (XmlNode topic in topiclistNode)
{
topicvisitor.SetNode(topic);
if (topicvisitor["topicid"] == topicid.Value)
{
topicvisitor["topicid"] = topicid.Value;
topicvisitor["title"] = title.Text;
topicvisitor["poster"] = poster.Text;
topicvisitor["postdatetime"] = postdatetime.Text;
XmlCDataSection shortDes = doc.CreateCDataSection("shortdescription");
shortDes.InnerText = shortdescription.Text;
topicvisitor.GetNode("shortdescription").RemoveAll();
topicvisitor.GetNode("shortdescription").AppendChild(shortDes);
break;
}
}
}