/// <summary> /// 在ToString()时调用的方法,该方法对该页面做一些无法使用XML特性的SimplusD特殊处理。 /// 其实都是没有办法的办法。馊招。但效率也不会差,经测试考虑得也还完善。 /// edit by lukan, 2008-6-29 02:40:13 /// 1.在DocType中写入SystemId /// 2.在html节点插入xmlns /// 3.在文件尾插入面向搜索引擎友好的Jeelu的代码 /// </summary> protected virtual string SpecialDisposalForCode(bool isJeelu) { {//3.在文件尾插入面向搜索引擎友好的Jeelu的代码 string jeeluFooter = "http://ssi.jeelu.com/inc/jeelufooter.inc"; XhtmlComment.ShtmlInclude jeeluInclude = this.CreateXhtmlCommentShtml(jeeluFooter); this.Body.AppendChild(jeeluInclude); } string xhtmlCode = this.AsXmlNode.OuterXml; if (isJeelu) {//1.在DocType中写入SystemId string v = "//EN\" \"\">"; int i = xhtmlCode.IndexOf(v, StringComparison.CurrentCulture); string systemId = string.Empty; #region switch (this.XhtmlVersion) switch (this.XhtmlVersion) { case Xhtml.Version.Xhtml10Strict: systemId = XhtmlDocType.Xhtml10StrictSystemId; break; case Xhtml.Version.Xhtml11: systemId = XhtmlDocType.Xhtml11SystemId; break; case Xhtml.Version.Xhtml10Transitional: systemId = XhtmlDocType.Xhtml10TransitionalSystemId; break; case Xhtml.Version.None: default: Debug.Fail("Please to input value for Xhtmlversion in first time!"); break; } #endregion xhtmlCode = xhtmlCode.Insert(i + 7, systemId); } {//2.在html节点插入xmlns string tag = "<html>"; int i = xhtmlCode.IndexOf(tag, StringComparison.CurrentCulture); string str = "<html xmlns=\"http://www.w3.org/1999/xhtml\">"; xhtmlCode = xhtmlCode.Remove(i, tag.Length); xhtmlCode = xhtmlCode.Insert(i, str); } return(xhtmlCode); }
/// <summary> /// 创建内部类ShtmlInclude(带参数,一般是指包含一个模板的PHP页面):它是一个Comment节点,具体是Shtml的包含语句。 /// 类似[!--#include virtual="/templates/073df79febbe4f6aa0087f4574289a5c.shtml"--]语句 /// </summary> /// <param name="path">路径,前后都应有"/"符号</param> /// <param name="file">文件</param> public XhtmlComment.ShtmlInclude CreateXhtmlCommentShtml(string path, string file) { XhtmlComment.ShtmlInclude shtmlInclude = new XhtmlComment.ShtmlInclude(this, path, file); return(shtmlInclude); }
/// <summary> /// 创建内部类ShtmlInclude(带参数,一般是指包含一个模板的PHP页面):它是一个Comment节点,具体是Shtml的包含语句。 /// 类似[!--#include virtual="/templates/073df79febbe4f6aa0087f4574289a5c.shtml"--]语句 /// </summary> /// <param name="fullFile">文件全名,含相对路径的全名</param> public XhtmlComment.ShtmlInclude CreateXhtmlCommentShtml(string fullFile) { XhtmlComment.ShtmlInclude shtmlInclude = new XhtmlComment.ShtmlInclude(this, fullFile); return(shtmlInclude); }
/// <summary> /// 创建内部类ShtmlInclude(带参数,一般是指包含一个模板的PHP页面):它是一个Comment节点,具体是Shtml的包含语句。 /// 类似[!--#include virtual="/templates/073df79febbe4f6aa0087f4574289a5c.shtml"--]语句 /// </summary> /// <param name="path">路径,前后都应有"/"符号</param> /// <param name="file">文件</param> public XhtmlComment.ShtmlInclude CreateXhtmlCommentShtml(CGIObject cgi) { XhtmlComment.ShtmlInclude shtmlInclude = new XhtmlComment.ShtmlInclude(this, cgi.ToString()); return(shtmlInclude); }