/** * syntaxhighlighter * http://alexgorbatchev.com/ * * syntaxhighlighter is donationware. if you are using it, please donate. * http://alexgorbatchev.com/wiki/syntaxhighlighter:donate * * @version * 2.1.364 (october 15 2009) * * @copyright * copyright (c) 2004-2009 alex gorbatchev. * * @license * this file is part of syntaxhighlighter. * * syntaxhighlighter is free software: you can redistribute it and/or modify * it under the terms of the gnu lesser general public license as published by * the free software foundation, either version 3 of the license, or * (at your option) any later version. * * syntaxhighlighter is distributed in the hope that it will be useful, * but without any warranty; without even the implied warranty of * merchantability or fitness for a particular purpose. see the * gnu general public license for more details. * * you should have received a copy of the gnu general public license * along with syntaxhighlighter. if not, see . */ syntaxhighlighter.brushes.xml = function() { function process(match, regexinfo) { var constructor = syntaxhighlighter.match, code = match[0], tag = new xregexp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), result = [] ; if (match.attributes != null) { var attributes, regex = new xregexp('(? [\\w:\\-\\.]+)' + '\\s*=\\s*' + '(? ".*?"|\'.*?\'|\\w+)', 'xg'); while ((attributes = regex.exec(code)) != null) { result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexof(attributes.value), 'string')); } } if (tag != null) result.push( new constructor(tag.name, match.index + tag[0].indexof(tag.name), 'keyword') ); return result; } this.regexlist = [ { regex: new xregexp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // { regex: syntaxhighlighter.regexlib.xmlcomments, css: 'comments' }, // { regex: new xregexp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } ]; }; syntaxhighlighter.brushes.xml.prototype = new syntaxhighlighter.highlighter(); syntaxhighlighter.brushes.xml.aliases = ['xml', 'xhtml', 'xslt', 'html'];