1/** 2 * SyntaxHighlighter 3 * http://alexgorbatchev.com/ 4 * 5 * SyntaxHighlighter is donationware. If you are using it, please donate. 6 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate 7 * 8 * @version 9 * 2.1.364 (October 15 2009) 10 * 11 * @copyright 12 * Copyright (C) 2004-2009 Alex Gorbatchev. 13 * 14 * @license 15 * This file is part of SyntaxHighlighter. 16 * 17 * SyntaxHighlighter is free software: you can redistribute it and/or modify 18 * it under the terms of the GNU Lesser General Public License as published by 19 * the Free Software Foundation, either version 3 of the License, or 20 * (at your option) any later version. 21 * 22 * SyntaxHighlighter is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public License 28 * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>. 29 */ 30SyntaxHighlighter.brushes.Xml = function() 31{ 32 function process(match, regexInfo) 33 { 34 var constructor = SyntaxHighlighter.Match, 35 code = match[0], 36 tag = new XRegExp('(<|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code), 37 result = [] 38 ; 39 40 if (match.attributes != null) 41 { 42 var attributes, 43 regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' + 44 '\\s*=\\s*' + 45 '(?<value> ".*?"|\'.*?\'|\\w+)', 46 'xg'); 47 48 while ((attributes = regex.exec(code)) != null) 49 { 50 result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 51 result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 52 } 53 } 54 55 if (tag != null) 56 result.push( 57 new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 58 ); 59 60 return result; 61 } 62 63 this.regexList = [ 64 { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]> 65 { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... --> 66 { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 67 ]; 68}; 69 70SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter(); 71SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html'];
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.