在以前公司的时候写过一点用c#通过xslt把xml转成html的代码,在此记录一下,附示例xml和xslt。
try{ string sourceDoc = "resource-sample.xml"; string xsltDoc = "resource.xslt";
XPathDocument myXPathDocument = new XPathDocument(sourceDoc)…
这是以前在公司遇到的一个问题,避免sql语句的递归,提高效率
/*注解:
以前遇到过一个同事,在处理树的时候,在sql语句里面用递归,造成性能非常低下。
在遇到sql处理树的时候,可以采用以下方法,用循环来解决。
主要思路:
找到Cateogry的Parent插入临时表,在临时表里做遍历,每到一条记录,都做一个操作:将它的par…
有时候我们使用虚拟主机上的sql,不能用企业管理器等工具直接对数据库进行操作,有时候为了节省空间,需要清楚数据库里的Log,以下的sql脚本是用来清除数据库的log
SET NOCOUNT ONDECLARE @LogicalFileName sysname,@MaxMinutes INT,@NewSize INT
USE cms -- 要操作的数据库名SELECT @LogicalFileName = 'cms_log', -- 日志文件名…
将一个string分成等长的几分 例如,SplitStringIntoMultipart( “abcdefgh”, 3 ); 会返回 “abc”, “def”, “gh”
public static string[] SplitStringIntoMultipart( string input , int eachCount ){ if( input.Length == 0 ) return…
前加^后加$
比如^[\d]+$
abc123这个就不match了,IsMatch返回false
如果[\d]+
abc123 IsMatch的话就会返回true
纯粹地用xmlhttprequest访问某个页面的时候,比如某个aspx页面,返回的是整个页面的html,但有时候我们只需要其中的一部分,或者第一次调用需要页面中的某个部分,第二次调用需要页面中的另外一个部分。 可以这样解决: 在被访问页面里写上某些注释,客户端callback的时候截取注释里的内容: 部分js代码:
function…
以下的css代码可以让ie在被保存时,把输入框例如<input type=”text” />中的值一并保存下来
<style> .saveSnapshot {behavior:url(#default#savesnapshot);}</style>