/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd

http://github.com/icsharpcode/ILSpy · Unknown · 63 lines · 60 code · 3 blank · 0 comment · 0 complexity · c0af2364a63486f2b6f9576bd579713b MD5 · raw file

  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. <RuleSet>
  12. <Span color="Comment" multiline="true">
  13. <Begin>&lt;!--</Begin>
  14. <End>--&gt;</End>
  15. </Span>
  16. <Span color="CData" multiline="true">
  17. <Begin>&lt;!\[CDATA\[</Begin>
  18. <End>]]&gt;</End>
  19. </Span>
  20. <Span color="DocType" multiline="true">
  21. <Begin>&lt;!DOCTYPE</Begin>
  22. <End>&gt;</End>
  23. </Span>
  24. <Span color="XmlDeclaration" multiline="true">
  25. <Begin>&lt;\?</Begin>
  26. <End>\?&gt;</End>
  27. </Span>
  28. <Span color="XmlTag" multiline="true">
  29. <Begin>&lt;</Begin>
  30. <End>&gt;</End>
  31. <RuleSet>
  32. <!-- Treat the position before '<' as end, as that's not a valid character
  33. in attribute names and indicates the user forgot a closing quote. -->
  34. <Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
  35. <Begin>"</Begin>
  36. <End>"|(?=&lt;)</End>
  37. </Span>
  38. <Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
  39. <Begin>'</Begin>
  40. <End>'|(?=&lt;)</End>
  41. </Span>
  42. <Rule color="AttributeName">[\d\w_\-\.]+(?=(\s*=))</Rule>
  43. <Rule color="AttributeValue">=</Rule>
  44. </RuleSet>
  45. </Span>
  46. <Import ruleSet="EntitySet"/>
  47. </RuleSet>
  48. <RuleSet name="EntitySet">
  49. <Rule color="Entity">
  50. &amp;
  51. [\w\d\#]+
  52. ;
  53. </Rule>
  54. <Rule color="BrokenEntity">
  55. &amp;
  56. [\w\d\#]*
  57. #missing ;
  58. </Rule>
  59. </RuleSet>
  60. </SyntaxDefinition>