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) }) }); }
XmlNode CreateWikiBodyFromPukiWikiMarkup(XmlDocument doc, WikiRecord content) { WikiRootElement root = PukiWikiMarkupParser.Instance.Parse (content.Body); return doc.CreateTextNodeSafe (WikiHtmlRenderer.Instance.Render (root, PukiWikiMarkupParser.Instance)); }
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) }), }); }
XmlNode CreateWikiBodyFromPlainText(XmlDocument doc, WikiRecord content) { return doc.CreateTextNodeSafe (content.Body); }