xml.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE language SYSTEM "language.dtd"
  3. [
  4. <!-- names must start with a letter, ideogram or underscore. \w matches any
  5. word character *or* a number, hence the lookahead -->
  6. <!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
  7. <!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
  8. ]>
  9. <language name="XML" version="18" kateversion="5.0" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml;application/vnd.oasis.opendocument.text-flat-xml;application/vnd.oasis.opendocument.graphics-flat-xml;application/vnd.oasis.opendocument.presentation-flat-xml;application/vnd.oasis.opendocument.spreadsheet-flat-xml;application/gpx+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
  10. <highlighting>
  11. <contexts>
  12. <context name="Start" attribute="Normal Text" lineEndContext="#stay">
  13. <IncludeRules context="FindXML" />
  14. </context>
  15. <context name="FindXML" attribute="Normal Text" lineEndContext="#stay">
  16. <DetectSpaces />
  17. <DetectIdentifier />
  18. <RegExpr attribute="Element Symbols" context="ElementTagName" String="&lt;(?=(&name;))" beginRegion="element" />
  19. <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
  20. <StringDetect attribute="CDATA" context="CDATAStart" String="&lt;![CDATA[" lookAhead="true" />
  21. <RegExpr attribute="Doctype Symbols" context="DoctypeTagName" String="&lt;!(?=DOCTYPE(\s|$))" beginRegion="doctype" />
  22. <IncludeRules context="FindProcessingInstruction" />
  23. <IncludeRules context="FindEntityRefs" />
  24. </context>
  25. <context name="FindEntityRefs" attribute="Other Text" lineEndContext="#stay">
  26. <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
  27. <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
  28. </context>
  29. <context name="FindPEntityRefs" attribute="Other Text" lineEndContext="#stay">
  30. <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
  31. <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
  32. <AnyChar attribute="Error" context="#stay" String="&amp;%&lt;" />
  33. </context>
  34. <context name="Comment" attribute="Comment" lineEndContext="#stay">
  35. <DetectSpaces />
  36. <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
  37. <RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" />
  38. <IncludeRules context="##Comments" />
  39. <DetectIdentifier />
  40. </context>
  41. <context name="CDATAStart" attribute="Other Text" lineEndContext="#pop">
  42. <StringDetect attribute="CDATA Symbols" context="#stay" String="&lt;![" beginRegion="cdata" />
  43. <StringDetect attribute="CDATA" context="#stay" String="CDATA" />
  44. <DetectChar attribute="CDATA Symbols" context="#pop!CDATA" char="[" />
  45. </context>
  46. <context name="CDATA" attribute="Other Text" lineEndContext="#stay">
  47. <DetectSpaces />
  48. <DetectIdentifier />
  49. <StringDetect attribute="CDATA Symbols" context="#pop" String="]]&gt;" endRegion="cdata" />
  50. <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
  51. </context>
  52. <context name="FindProcessingInstruction" attribute="Other Text" lineEndContext="#stay">
  53. <RegExpr attribute="PI Symbols" context="PI TagName" String="&lt;\?(?=([\w:_-]*))" beginRegion="pi" />
  54. </context>
  55. <context name="PI TagName" attribute="Other Text" lineEndContext="#pop!PI" fallthrough="true" fallthroughContext="#pop!PI">
  56. <RegExpr attribute="Processing Instruction" context="#pop!PI-XML" String="xml(?=\s|$)" insensitive="true" />
  57. <StringDetect attribute="Processing Instruction" context="#pop!PI" String="%1" dynamic="true" />
  58. </context>
  59. <context name="PI" attribute="Other Text" lineEndContext="#stay">
  60. <Detect2Chars attribute="PI Symbols" context="#pop" char="?" char1="&gt;" endRegion="pi" />
  61. </context>
  62. <context name="PI-XML" attribute="Other Text" lineEndContext="#stay">
  63. <IncludeRules context="PI" />
  64. <RegExpr attribute="Attribute" context="#stay" String="(?:^|\s+)&name;" />
  65. <DetectChar attribute="Attribute Separator" context="Value" char="=" />
  66. </context>
  67. <context name="DoctypeTagName" attribute="Other Text" lineEndContext="#pop">
  68. <StringDetect attribute="Doctype" context="#pop!DoctypeVariableName" String="DOCTYPE" />
  69. </context>
  70. <context name="DoctypeVariableName" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Doctype">
  71. <DetectSpaces />
  72. <RegExpr attribute="Doctype Name" context="#pop!Doctype" String="&name;" />
  73. </context>
  74. <context name="Doctype" attribute="Other Text" lineEndContext="#stay">
  75. <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" endRegion="doctype" />
  76. <DetectChar attribute="Doctype Symbols" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
  77. </context>
  78. <context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
  79. <DetectSpaces />
  80. <DetectChar attribute="Doctype Symbols" context="#pop" char="]" endRegion="int_subset" />
  81. <RegExpr attribute="Doctype Symbols" context="Doctype Markupdecl TagName" String="&lt;!(?=(ELEMENT|ENTITY|ATTLIST|NOTATION)\b)" />
  82. <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
  83. <IncludeRules context="FindProcessingInstruction" />
  84. <IncludeRules context="FindPEntityRefs" />
  85. </context>
  86. <context name="Doctype Markupdecl TagName" attribute="Other Text" lineEndContext="#pop">
  87. <DetectIdentifier attribute="Doctype" context="#pop!Doctype Markupdecl VariableName" />
  88. </context>
  89. <context name="Doctype Markupdecl VariableName" attribute="Other Text" lineEndContext="#pop!Doctype Markupdecl" fallthrough="true" fallthroughContext="#pop!Doctype Markupdecl">
  90. <DetectSpaces />
  91. <RegExpr attribute="Doctype Name" context="#pop!Doctype Markupdecl" String="&name;" />
  92. </context>
  93. <context name="Doctype Markupdecl" attribute="Other Text" lineEndContext="#stay">
  94. <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" />
  95. <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
  96. <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
  97. </context>
  98. <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
  99. <DetectChar attribute="Value" context="#pop" char="&quot;" />
  100. <IncludeRules context="FindPEntityRefs" />
  101. </context>
  102. <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
  103. <DetectChar attribute="Value" context="#pop" char="&apos;" />
  104. <IncludeRules context="FindPEntityRefs" />
  105. </context>
  106. <context name="ElementTagName" attribute="Other Text" lineEndContext="#pop!Element">
  107. <StringDetect attribute="Element" context="#pop!Element" String="%1" dynamic="true" />
  108. </context>
  109. <context name="Element" attribute="Other Text" lineEndContext="#stay">
  110. <Detect2Chars attribute="Element Symbols" context="#pop" char="/" char1="&gt;" endRegion="element" />
  111. <DetectChar attribute="Element Symbols" context="El Content" char="&gt;" />
  112. <RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" />
  113. <RegExpr attribute="Error" context="#stay" String="\S" />
  114. </context>
  115. <context name="El Content" attribute="Other Text" lineEndContext="#stay">
  116. <RegExpr attribute="Element Symbols" context="El End TagName" String="&lt;/(?=(&name;))" />
  117. <IncludeRules context="FindXML" />
  118. </context>
  119. <context name="El End TagName" attribute="Other Text" lineEndContext="#pop!El End">
  120. <StringDetect attribute="Element" context="#pop!El End" String="%1" dynamic="true" />
  121. </context>
  122. <context name="El End" attribute="Other Text" lineEndContext="#stay">
  123. <DetectChar attribute="Element Symbols" context="#pop#pop#pop" char="&gt;" endRegion="element" />
  124. <RegExpr attribute="Error" context="#stay" String="\S" />
  125. </context>
  126. <context name="Attribute" attribute="Other Text" lineEndContext="#stay">
  127. <DetectChar attribute="Attribute Separator" context="#pop!Value" char="=" />
  128. <RegExpr attribute="Error" context="#stay" String="\S" />
  129. </context>
  130. <context name="Value" attribute="Other Text" lineEndContext="#stay">
  131. <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
  132. <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
  133. <RegExpr attribute="Error" context="#stay" String="\S" />
  134. </context>
  135. <context name="Value DQ" attribute="Value" lineEndContext="#stay">
  136. <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
  137. <IncludeRules context="FindEntityRefs" />
  138. </context>
  139. <context name="Value SQ" attribute="Value" lineEndContext="#stay">
  140. <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
  141. <IncludeRules context="FindEntityRefs" />
  142. </context>
  143. </contexts>
  144. <itemDatas>
  145. <itemData name="Normal Text" defStyleNum="dsNormal" />
  146. <itemData name="Other Text" defStyleNum="dsNormal" />
  147. <itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
  148. <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" italic="0" spellChecking="false" />
  149. <itemData name="CDATA Symbols" defStyleNum="dsBaseN" bold="0" italic="0" spellChecking="false" />
  150. <itemData name="Processing Instruction" defStyleNum="dsFunction" bold="1" italic="0" spellChecking="false" />
  151. <itemData name="PI Symbols" defStyleNum="dsFunction" bold="0" italic="0" spellChecking="false" />
  152. <itemData name="Doctype" defStyleNum="dsDataType" bold="1" italic="0" spellChecking="false" />
  153. <itemData name="Doctype Name" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
  154. <itemData name="Doctype Symbols" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
  155. <itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" />
  156. <itemData name="Element Symbols" defStyleNum="dsNormal" spellChecking="false" />
  157. <itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
  158. <itemData name="Attribute Separator" defStyleNum="dsOthers" spellChecking="false" />
  159. <itemData name="Value" defStyleNum="dsString" spellChecking="false" />
  160. <itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />
  161. <itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" />
  162. <itemData name="Error" defStyleNum="dsError" spellChecking="false" />
  163. </itemDatas>
  164. </highlighting>
  165. <general>
  166. <comments>
  167. <comment name="multiLine" start="&lt;!--" end="--&gt;" region="comment" />
  168. </comments>
  169. </general>
  170. </language>
  171. <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->