146 lines
6.4 KiB
XML
146 lines
6.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?><!-- kate: space-indent on; indent-width 2 -->
|
|
<!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.93" 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" end-of-line-context="#stay">
|
|
<IncludeRules from="FindXML" />
|
|
</context>
|
|
|
|
<context name="FindXML" style="Normal Text" end-of-line-context="#stay">
|
|
<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;" include-into-next="TRUE" beginRegion="element" />
|
|
<IncludeRules from="FindEntityRefs" />
|
|
</context>
|
|
|
|
<context name="FindEntityRefs" style="Normal Text" end-of-line-context="#stay">
|
|
<Regex style="EntityRef" context="#stay" pattern="&entref;" />
|
|
<Range style="Error" context="#stay" chars="&<" />
|
|
</context>
|
|
|
|
<context name="FindPEntityRefs" style="Normal Text" end-of-line-context="#stay">
|
|
<Regex style="EntityRef" context="#stay" pattern="&entref;" />
|
|
<Regex style="PEntityRef" context="#stay" pattern="%&name;;" />
|
|
<Range style="Error" context="#stay" chars="&%" />
|
|
</context>
|
|
|
|
|
|
<context name="Comment" style="Comment" end-of-line-context="#stay">
|
|
<String style="Comment" context="#pop" string="-->" endRegion="comment" />
|
|
<Regex style="Error" context="#stay" pattern="-(-(?!->))+" />
|
|
<Regex style="Alert" context="#stay" pattern="(FIXME|TODO)" />
|
|
</context>
|
|
|
|
<context name="CDATA" style="Normal Text" end-of-line-context="#stay">
|
|
<String style="CDATA" context="#pop" string="]]>" endRegion="cdata" />
|
|
<String style="EntityRef" context="#stay" string="]]&gt;" />
|
|
</context>
|
|
|
|
<context name="PI" style="Normal Text" end-of-line-context="#stay">
|
|
<TwoChars style="Processing Instruction" context="#pop" char1="?" char2=">" endRegion="pi" />
|
|
</context>
|
|
|
|
<context name="Doctype" style="Normal Text" end-of-line-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" end-of-line-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" end-of-line-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" end-of-line-context="#stay">
|
|
<Char style="Value" context="#pop" char=""" />
|
|
<IncludeRules from="FindPEntityRefs" />
|
|
</context>
|
|
|
|
<context name="Doctype Markupdecl SQ" style="Value" end-of-line-context="#stay">
|
|
<Char style="Value" context="#pop" char="'" />
|
|
<IncludeRules from="FindPEntityRefs" />
|
|
</context>
|
|
|
|
<context name="Element" style="Normal Text" end-of-line-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" end-of-line-context="#stay">
|
|
<Regex style="Element" context="El End" include-into-next="TRUE" pattern="</&name;" />
|
|
<IncludeRules from="FindXML" />
|
|
</context>
|
|
|
|
<context name="El End" style="Normal Text" end-of-line-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" end-of-line-context="#stay">
|
|
<Char style="Attribute" context="Value" char="=" />
|
|
<Regex style="Error" context="#stay" pattern="\S" />
|
|
</context>
|
|
|
|
<context name="Value" style="Normal Text" end-of-line-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" end-of-line-context="#stay">
|
|
<Char style="Value" context="#pop#pop#pop" char=""" />
|
|
<IncludeRules from="FindEntityRefs" />
|
|
</context>
|
|
|
|
<context name="Value SQ" style="Value" end-of-line-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="TRUE"/>
|
|
<style name="Processing Instruction" default-style="Keyword"/>
|
|
<style name="Doctype" default-style="DataType" bold="TRUE"/>
|
|
<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"/>
|
|
<style name="Alert" default-style="Alert"/>
|
|
</styles>
|
|
|
|
<general>
|
|
<brackets><></brackets>
|
|
<comments>
|
|
<multi-line start="<!--" end="-->"/>
|
|
</comments>
|
|
</general>
|
|
|
|
</language>
|