Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RemoveBackwardsCompatibility/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/Highlighting/Resources/XML-Mode.xshd @ 15529

Last change on this file since 15529 was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 2.3 KB
Line 
1<SyntaxDefinition name="XML" extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.booproj;.build;.xfrm;.targets;.xaml;.xpt;.xft;.map;.wsdl;.disco;.ps1xml;.nuspec" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
2  <Color foreground="Green" name="Comment" exampleText="&lt;!-- comment --&gt;" />
3  <Color foreground="Blue" name="CData" exampleText="&lt;![CDATA[data]]&gt;" />
4  <Color foreground="Blue" name="DocType" exampleText="&lt;!DOCTYPE rootElement&gt;" />
5  <Color foreground="Blue" name="XmlDeclaration" exampleText='&lt;?xml version="1.0"?&gt;' />
6  <Color foreground="DarkMagenta" name="XmlTag" exampleText='&lt;tag attribute="value" /&gt;' />
7  <Color foreground="Red" name="AttributeName" exampleText='&lt;tag attribute="value" /&gt;' />
8  <Color foreground="Blue" name="AttributeValue" exampleText='&lt;tag attribute="value" /&gt;' />
9  <Color foreground="Teal" name="Entity" exampleText="index.aspx?a=1&amp;amp;b=2" />
10  <Color foreground="Olive" name="BrokenEntity" exampleText="index.aspx?a=1&amp;b=2" />
11 
12  <RuleSet>
13    <Span color="Comment" multiline="true">
14      <Begin>&lt;!--</Begin>
15      <End>--&gt;</End>
16    </Span>
17    <Span color="CData" multiline="true">
18      <Begin>&lt;!\[CDATA\[</Begin>
19      <End>]]&gt;</End>
20    </Span>
21    <Span color="DocType" multiline="true">
22      <Begin>&lt;!DOCTYPE</Begin>
23      <End>&gt;</End>
24    </Span>
25    <Span color="XmlDeclaration" multiline="true">
26      <Begin>&lt;\?</Begin>
27      <End>\?&gt;</End>
28    </Span>
29    <Span color="XmlTag" multiline="true">
30      <Begin>&lt;</Begin>
31      <End>&gt;</End>
32      <RuleSet>
33        <!-- Treat the position before '<' as end, as that's not a valid character
34             in attribute names and indicates the user forgot a closing quote. -->
35        <Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
36          <Begin>"</Begin>
37          <End>"|(?=&lt;)</End>
38        </Span>
39        <Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
40          <Begin>'</Begin>
41          <End>'|(?=&lt;)</End>
42        </Span>
43        <Rule color="AttributeName">[\d\w_\-\.]+(?=(\s*=))</Rule>
44        <Rule color="AttributeValue">=</Rule>
45      </RuleSet>
46    </Span>
47    <Import ruleSet="EntitySet"/>
48  </RuleSet>
49 
50  <RuleSet name="EntitySet">
51    <Rule color="Entity">
52      &amp;
53      [\w\d\#]+
54      ;
55    </Rule>
56
57    <Rule color="BrokenEntity">
58      &amp;
59      [\w\d\#]*
60      #missing ;
61    </Rule>
62  </RuleSet>
63</SyntaxDefinition>
Note: See TracBrowser for help on using the repository browser.