147 lines
6.4 KiB
XML
147 lines
6.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?><!-- kate: space-indent on; indent-width 2; strip on; -->
|
|
<!DOCTYPE language SYSTEM "language.dtd"
|
|
[
|
|
<!ENTITY name "[A-Za-z_:][\w.:_-]*">
|
|
<!ENTITY entref "&(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
|
|
]>
|
|
<language name="XML" version="1.96" kateversion="2.4" section="Markup"
|
|
extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf" mimetypes="text/xml;text/book;text/daml;text/rdf"
|
|
author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
|
|
|
|
<syntax>
|
|
<context name="Start" style="Normal Text" eol-context="#stay">
|
|
<IncludeRules from="FindXML"/>
|
|
</context>
|
|
|
|
<context name="FindXML" style="Normal Text" eol-context="#stay">
|
|
<Whitespace/>
|
|
<String style="Comment" context="Comment" string="<!--" beginRegion="comment"/>
|
|
<String style="CDATA" context="CDATA" string="<![CDATA[" beginRegion="cdata"/>
|
|
<Regex style="Doctype" context="Doctype" pattern="<!DOCTYPE\s+" beginRegion="doctype"/>
|
|
<Regex style="Processing Instruction" context="PI" pattern="<\?[\w:_-]*" beginRegion="pi"/>
|
|
<Regex style="Element" context="Element" pattern="<&name;" beginRegion="element"/>
|
|
<IncludeRules from="FindEntityRefs"/>
|
|
<Identifier/>
|
|
</context>
|
|
|
|
<context name="FindEntityRefs" style="Normal Text" eol-context="#stay">
|
|
<Regex style="EntityRef" context="#stay" pattern="&entref;"/>
|
|
<AnyChar style="Error" context="#stay" chars="&<"/>
|
|
</context>
|
|
|
|
<context name="FindPEntityRefs" style="Normal Text" eol-context="#stay">
|
|
<Regex style="EntityRef" context="#stay" pattern="&entref;"/>
|
|
<Regex style="PEntityRef" context="#stay" pattern="%&name;;"/>
|
|
<AnyChar style="Error" context="#stay" chars="&%"/>
|
|
</context>
|
|
|
|
|
|
<context name="Comment" style="Comment" eol-context="#stay">
|
|
<Whitespace/>
|
|
<String style="Comment" context="#pop" string="-->" endRegion="comment"/>
|
|
<Regex style="Error" context="#stay" pattern="-(-(?!->))+"/>
|
|
<IncludeRules from="##Misc##AlertRules"/>
|
|
<Identifier/>
|
|
</context>
|
|
|
|
<context name="CDATA" style="Normal Text" eol-context="#stay">
|
|
<Whitespace/>
|
|
<Identifier/>
|
|
<String style="CDATA" context="#pop" string="]]>" endRegion="cdata"/>
|
|
<String style="EntityRef" context="#stay" string="]]&gt;"/>
|
|
</context>
|
|
|
|
<context name="PI" style="Normal Text" eol-context="#stay">
|
|
<TwoChars style="Processing Instruction" context="#pop" char1="?" char2=">" endRegion="pi"/>
|
|
</context>
|
|
|
|
<context name="Doctype" style="Normal Text" eol-context="#stay">
|
|
<Char style="Doctype" context="#pop" char=">" endRegion="doctype"/>
|
|
<Char style="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset"/>
|
|
</context>
|
|
|
|
<context name="Doctype Internal Subset" style="Normal Text" eol-context="#stay">
|
|
<Char style="Doctype" context="#pop" char="]" endRegion="int_subset"/>
|
|
<Regex style="Doctype" context="Doctype Markupdecl" pattern="<!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b"/>
|
|
<String style="Comment" context="Comment" string="<!--" beginRegion="comment"/>
|
|
<Regex style="Processing Instruction" context="PI" pattern="<\?[\w:_-]*" beginRegion="pi"/>
|
|
<IncludeRules from="FindPEntityRefs"/>
|
|
</context>
|
|
|
|
<context name="Doctype Markupdecl" style="Normal Text" eol-context="#stay">
|
|
<Char style="Doctype" context="#pop" char=">"/>
|
|
<Char style="Value" context="Doctype Markupdecl DQ" char="""/>
|
|
<Char style="Value" context="Doctype Markupdecl SQ" char="'"/>
|
|
</context>
|
|
|
|
<context name="Doctype Markupdecl DQ" style="Value" eol-context="#stay">
|
|
<Char style="Value" context="#pop" char="""/>
|
|
<IncludeRules from="FindPEntityRefs"/>
|
|
</context>
|
|
|
|
<context name="Doctype Markupdecl SQ" style="Value" eol-context="#stay">
|
|
<Char style="Value" context="#pop" char="'"/>
|
|
<IncludeRules from="FindPEntityRefs"/>
|
|
</context>
|
|
|
|
<context name="Element" style="Normal Text" eol-context="#stay">
|
|
<TwoChars style="Element" context="#pop" char1="/" char2=">" endRegion="element"/>
|
|
<Char style="Element" context="El Content" char=">"/>
|
|
<Regex style="Attribute" context="Attribute" pattern="^&name;"/>
|
|
<Regex style="Attribute" context="Attribute" pattern="\s+&name;"/>
|
|
<Regex style="Error" context="#stay" pattern="\S"/>
|
|
</context>
|
|
|
|
<context name="El Content" style="Normal Text" eol-context="#stay">
|
|
<Regex style="Element" context="El End" pattern="</&name;"/>
|
|
<IncludeRules from="FindXML"/>
|
|
</context>
|
|
|
|
<context name="El End" style="Normal Text" eol-context="#stay">
|
|
<Char style="Element" context="#pop#pop#pop" char=">" endRegion="element"/>
|
|
<Regex style="Error" context="#stay" pattern="\S"/>
|
|
</context>
|
|
|
|
<context name="Attribute" style="Normal Text" eol-context="#stay">
|
|
<Char style="Attribute" context="Value" char="="/>
|
|
<Regex style="Error" context="#stay" pattern="\S"/>
|
|
</context>
|
|
|
|
<context name="Value" style="Normal Text" eol-context="#stay">
|
|
<Char style="Value" context="Value DQ" char="""/>
|
|
<Char style="Value" context="Value SQ" char="'"/>
|
|
<Regex style="Error" context="#stay" pattern="\S"/>
|
|
</context>
|
|
|
|
<context name="Value DQ" style="Value" eol-context="#stay">
|
|
<Char style="Value" context="#pop#pop#pop" char="""/>
|
|
<IncludeRules from="FindEntityRefs"/>
|
|
</context>
|
|
|
|
<context name="Value SQ" style="Value" eol-context="#stay">
|
|
<Char style="Value" context="#pop#pop#pop" char="'"/>
|
|
<IncludeRules from="FindEntityRefs"/>
|
|
</context>
|
|
</syntax>
|
|
|
|
<styles>
|
|
<style name="Normal Text" default-style="Normal"/>
|
|
<style name="Comment" default-style="Comment"/>
|
|
<style name="CDATA" default-style="BaseN" bold="1"/>
|
|
<style name="Processing Instruction" default-style="Keyword"/>
|
|
<style name="Doctype" default-style="DataType" bold="1"/>
|
|
<style name="Element" default-style="Keyword"/>
|
|
<style name="Attribute" default-style="Others"/>
|
|
<style name="Value" default-style="String" foreground="#a00"/>
|
|
<style name="EntityRef" default-style="Decimal"/>
|
|
<style name="PEntityRef" default-style="Decimal"/>
|
|
<style name="Error" default-style="Error"/>
|
|
</styles>
|
|
|
|
<general>
|
|
<comments>
|
|
<multi-line start="<!--" end="-->"/>
|
|
</comments>
|
|
</general>
|
|
</language>
|