shBrushXml.js
Upload User: gdxydsw
Upload Date: 2019-01-29
Package Size: 16721k
Code Size: 1k
Category:

Java Develop

Development Platform:

Java

  1. /*
  2.  * JsMin
  3.  * Javascript Compressor
  4.  * http://www.crockford.com/
  5.  * http://www.smallsharptools.com/
  6. */
  7. dp.sh.Brushes.Xml=function()
  8. {this.CssClass='dp-xml';this.Style='.dp-xml .cdata { color: #ff1493; }'+'.dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }'+'.dp-xml .attribute { color: red; }'+'.dp-xml .attribute-value { color: blue; }';}
  9. dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=['xml','xhtml','xslt','html','xhtml'];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function()
  10. {function push(array,value)
  11. {array[array.length]=value;}
  12. var index=0;var match=null;var regex=null;this.GetMatches(new RegExp('(&lt;|<)\!\[[\w\s]*?\[(.|\s)*?\]\](&gt;|>)','gm'),'cdata');this.GetMatches(new RegExp('(&lt;|<)!--\s*.*?\s*--(&gt;|>)','gm'),'comments');regex=new RegExp('([:\w-.]+)\s*=\s*(".*?"|'.*?'|\w+)*|(\w+)','gm');while((match=regex.exec(this.code))!=null)
  13. {if(match[1]==null)
  14. {continue;}
  15. push(this.matches,new dp.sh.Match(match[1],match.index,'attribute'));if(match[2]!=undefined)
  16. {push(this.matches,new dp.sh.Match(match[2],match.index+match[0].indexOf(match[2]),'attribute-value'));}}
  17. this.GetMatches(new RegExp('(&lt;|<)/*\?*(?!\!)|/*\?*(&gt;|>)','gm'),'tag');regex=new RegExp('(?:&lt;|<)/*\?*\s*([:\w-.]+)','gm');while((match=regex.exec(this.code))!=null)
  18. {push(this.matches,new dp.sh.Match(match[1],match.index+match[0].indexOf(match[1]),'tag-name'));}}