| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY qname "[A-Za-z_:][\w.:_-]*"> |
| 5 |
<!ENTITY entref "&(#[0-9]+|#[xX][0-9A-Fa-f]+|&qname;);"> |
| 6 |
]> |
| 7 |
|
| 8 |
<!-- |
| 9 |
Kate syntax highlighting for RELAX NG |
| 10 |
2007 by Thomas Schraitle (tom_schr AT web DOT de) |
| 11 |
Derived from the XSLT syntax file from Peter Lammich |
| 12 |
Published under the LGPL |
| 13 |
|
| 14 |
TODO: |
| 15 |
- More modularization (how?) |
| 16 |
- Namespace rules |
| 17 |
--> |
| 18 |
|
| 19 |
<language version="6" |
| 20 |
kateversion="5.0" |
| 21 |
name="RELAX NG" |
| 22 |
section="Markup" |
| 23 |
extensions="*.rng;*.RNG" |
| 24 |
license="LGPL" |
| 25 |
author="Thomas Schraitle (tom_schr AT web DOT de)"> |
| 26 |
<highlighting> |
| 27 |
<list name="relaxngnames"> |
| 28 |
<item>anyName</item> |
| 29 |
<item>attribute</item> |
| 30 |
<item>choice</item> |
| 31 |
<item>data</item> |
| 32 |
<item>define</item> |
| 33 |
<item>div</item> |
| 34 |
<item>element</item> |
| 35 |
<item>empty</item> |
| 36 |
<item>except</item> |
| 37 |
<item>externalRef</item> |
| 38 |
<item>grammar</item> |
| 39 |
<item>group</item> |
| 40 |
<item>include</item> |
| 41 |
<item>interleave</item> |
| 42 |
<item>list</item> |
| 43 |
<item>mixed</item> |
| 44 |
<item>name</item> |
| 45 |
<item>notAllowed</item> |
| 46 |
<item>nsName</item> |
| 47 |
<item>oneOrMore</item> |
| 48 |
<item>optional</item> |
| 49 |
<item>param</item> |
| 50 |
<item>parentRef</item> |
| 51 |
<item>ref</item> |
| 52 |
<item>start</item> |
| 53 |
<item>text</item> |
| 54 |
<item>value</item> |
| 55 |
<item>zeroOrMore</item> |
| 56 |
</list> |
| 57 |
|
| 58 |
<contexts> |
| 59 |
<context name="normalText" attribute="Normal Text" lineEndContext="#stay"> |
| 60 |
<StringDetect attribute="Comment" context="comment" String="<!--" beginRegion="comment"/> |
| 61 |
<DetectChar attribute="Tag" context="tagname" char="<" /> |
| 62 |
<RegExpr attribute="Entity Reference" context="#stay" String="&entref;" /> |
| 63 |
</context> |
| 64 |
|
| 65 |
<context name="detectEntRef" attribute="Normal Text" lineEndContext="#stay"> |
| 66 |
<RegExpr attribute="Entity Reference" context="#stay" String="&entref;" /> |
| 67 |
</context> |
| 68 |
|
| 69 |
<context name="tagname" attribute="Tag" lineEndContext="#stay"> |
| 70 |
<keyword attribute="RELAX NG Tag" context="attributes" String="relaxngnames" /> |
| 71 |
<DetectSpaces attribute="Attribute" context="attributes" /> |
| 72 |
<DetectChar attribute="Tag" context="#pop" char=">" /> |
| 73 |
</context> |
| 74 |
|
| 75 |
<context name="attributes" attribute="Attribute" lineEndContext="#stay"> |
| 76 |
<Detect2Chars attribute="Tag" context="#pop#pop" char="/" char1=">" /> |
| 77 |
<DetectChar attribute="Tag" context="#pop#pop" char=">" /> |
| 78 |
<RegExpr attribute="Normal Text" context="attrValue" String="\s*=\s*" /> |
| 79 |
</context> |
| 80 |
|
| 81 |
<context name="attrValue" attribute="Invalid" lineEndContext="#stay"> |
| 82 |
<Detect2Chars attribute="Invalid" context="#pop#pop#pop" char="/" char1=">" /> |
| 83 |
<DetectChar attribute="Invalid" context="#pop#pop#pop" char=">" /> |
| 84 |
<DetectChar attribute="Attribute Value" context="string" char=""" /> |
| 85 |
</context> |
| 86 |
|
| 87 |
<context name="string" attribute="Attribute Value" lineEndContext="#stay"> |
| 88 |
<DetectChar attribute="Attribute Value" context="#pop#pop" char=""" /> |
| 89 |
<IncludeRules context="detectEntRef" /> |
| 90 |
</context> |
| 91 |
|
| 92 |
<context name="comment" attribute="Comment" lineEndContext="#stay"> |
| 93 |
<DetectSpaces/> |
| 94 |
<StringDetect attribute="Comment" context="#pop" String="-->" endRegion="comment"/> |
| 95 |
<RegExpr attribute="Error" context="#stay" String="-(-(?!->))+"/> |
| 96 |
<IncludeRules context="##Comments"/> |
| 97 |
<DetectIdentifier/> |
| 98 |
</context> |
| 99 |
</contexts> |
| 100 |
|
| 101 |
<itemDatas> |
| 102 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 103 |
<itemData name="Tag" defStyleNum="dsKeyword"/> |
| 104 |
<itemData name="Entity Reference" defStyleNum="dsOthers"/> |
| 105 |
<itemData name="Invalid" defStyleNum="dsError"/> |
| 106 |
<itemData name="Attribute" defStyleNum="dsOthers"/> |
| 107 |
<itemData name="Attribute Value" defStyleNum="dsString" color="#800000" selColor="#ffffff" bold="0" italic="0"/> |
| 108 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 109 |
<itemData name="RELAX NG Tag" defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="1" italic="0" /> |
| 110 |
<itemData name="Error" defStyleNum="dsError" /> |
| 111 |
</itemDatas> |
| 112 |
</highlighting> |
| 113 |
<general> |
| 114 |
<comments> |
| 115 |
<comment name="multiLine" start="<!--" end="-->" region="comment" /> |
| 116 |
</comments> |
| 117 |
<keywords casesensitive="0" weakDeliminator="-:" additionalDeliminator=""{}"/> |
| 118 |
</general> |
| 119 |
</language> |
| 120 |
<!-- kate: replace-tabs on; indent-width 2; --> |