30 SyntaxHighlighter.brushes.Xml =
function()
32 function process(match, regexInfo)
34 var constructor = SyntaxHighlighter.Match,
36 tag =
new XRegExp(
'(<|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)',
'xg').exec(code),
40 if (match.attributes != null)
43 regex =
new XRegExp(
'(?<name> [\\w:\\-\\.]+)' +
45 '(?<value> ".*?"|\'.*?\'|\\w+)',
48 while ((attributes = regex.exec(code)) != null)
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'));
57 new constructor(tag.name, match.index + tag[0].indexOf(tag.name),
'keyword')
64 { regex:
new XRegExp(
'(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)',
'gm'), css:
'color2' },
65 { regex:
new XRegExp(
'(\\<|<)!--\\s*.*?\\s*--(\\>|>)',
'gm'), css:
'comments' },
66 { regex:
new XRegExp(
'(<|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(>|>)',
'sg'), func: process }
70 SyntaxHighlighter.brushes.Xml.prototype =
new SyntaxHighlighter.Highlighter();
71 SyntaxHighlighter.brushes.Xml.aliases = [
'xml',
'xhtml',
'xslt',
'html',
'xhtml'];