本文整理汇总了C#中System.Xml.XmlDocument.CreateTextNodeSafe方法的典型用法代码示例。如果您正苦于以下问题:C# XmlDocument.CreateTextNodeSafe方法的具体用法?C# XmlDocument.CreateTextNodeSafe怎么用?C# XmlDocument.CreateTextNodeSafe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlDocument
的用法示例。
在下文中一共展示了XmlDocument.CreateTextNodeSafe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRecordElement
public XmlElement CreateRecordElement(XmlDocument doc, MergeableFileRecord record)
{
SimpleBBSRecord record_content = record.Content as SimpleBBSRecord;
return doc.CreateElement ("bbs", new string[][] {
new string[] {"short-id", record_content.GetShortId (record)},
new string[] {"is-new", record_content.IsNew ? "true" : "false"}
}, new[] {
doc.CreateElement ("name", null, new[] {
doc.CreateTextNodeSafe (record_content.Name)
}),
doc.CreateElement ("body", null, new[] {
doc.CreateTextNodeSafe (record_content.Body)
})
});
}
示例2: CreateWikiBodyFromPukiWikiMarkup
XmlNode CreateWikiBodyFromPukiWikiMarkup(XmlDocument doc, WikiRecord content)
{
WikiRootElement root = PukiWikiMarkupParser.Instance.Parse (content.Body);
return doc.CreateTextNodeSafe (WikiHtmlRenderer.Instance.Render (root, PukiWikiMarkupParser.Instance));
}
示例3: CreateRecordElement
public XmlElement CreateRecordElement(XmlDocument doc, MergeableFileRecord record)
{
WikiRecord content = record.Content as WikiRecord;
return doc.CreateElement ("wiki", new string[][] {
new string[] {"markup-type", content.MarkupType.ToString ()}
}, new[] {
doc.CreateElement ("title", null, new[] {
doc.CreateTextNodeSafe (content.PageName)
}),
doc.CreateElement ("title-for-url", null, new[] {
doc.CreateTextNodeSafe (WikiWebApp.WikiTitleToUrl (content.PageName))
}),
doc.CreateElement ("name", null, new[] {
doc.CreateTextNodeSafe (content.Name)
}),
doc.CreateElement ("body", null, new[] {
CreateWikiBody (doc, content)
}),
doc.CreateElement ("raw-body", null, new[] {
doc.CreateTextNodeSafe (content.Body)
}),
});
}
示例4: CreateWikiBodyFromPlainText
XmlNode CreateWikiBodyFromPlainText(XmlDocument doc, WikiRecord content)
{
return doc.CreateTextNodeSafe (content.Body);
}