<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language
[
  <!-- Names beginning with the string "xml" are reserved for standardization -->
  <!ENTITY reserved_prefix "[xX][mM][lL]">
  <!ENTITY name "(?!&reserved_prefix;)[[:alpha:]_:][\w:.-]*">
  <!ENTITY nmtoken "[\w:.-]+">
  <!ENTITY invalid_name "[\w:.-]+">

  <!ENTITY entity "&amp;&name;;|&amp;#(x[0-9a-fA-F]+|[0-9]+);">
  <!ENTITY peref "&#x25;&name;;">

  <!ENTITY weakdelim ";:.-&#x23;&amp;">
]>
<language version="14" kateversion="5.79" name="XML (Debug)" section="Markup" extensions="" mimetype="" indenter="xml">

  <!-- https://www.w3.org/TR/REC-xml/#sec-documents -->

  <highlighting>
    <list name="AttType">
      <item>CDATA</item>
      <item>ID</item>
      <item>IDREF</item>
      <item>IDREFS</item>
      <item>ENTITY</item>
      <item>ENTITIES</item>
      <item>NMTOKEN</item>
      <item>NMTOKENS</item>
    </list>

<contexts>

  <!--
    [1] document ::= prolog element Misc*

    [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
    /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */

    [3] S ::= (#x20 | #x9 | #xD | #xA)+
    note: Replaced by <DetectSpaces/> or \s+ regexp

    [4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
    [4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
    [5] Name ::= NameStartChar (NameChar)*
    [6] Names ::= Name (#x20 Name)*
    [7] Nmtoken ::= (NameChar)+
    [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*

    [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
  |  "'" ([^%&'] | PEReference | Reference)* "'"

    [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
    [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
    [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]

    [66] CharRef ::= '&#' [0-9]+ ';'
                   | '&#x' [0-9a-fA-F]+ ';'
    [67] Reference ::= EntityRef | CharRef
    [68] EntityRef ::= '&' Name ';'
    [69] PEReference ::= '%' Name ';'
  -->

  <!--
    [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
    [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
  -->
  <context name="0:prolog" attribute="Error" lineEndContext="#stay" fallthroughContext="11:Misc after XMLDecl">
    <WordDetect attribute="Doctype Declaration" context="1:XMLDecl Version" String="&lt;?xml" weakDeliminator="&weakdelim;"/>
  </context>

  <!--
    [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
    [25] Eq ::= S? '=' S?
    [26] VersionNum ::= '1.' [0-9]+
  -->
  <context name="1:XMLDecl Version" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Attribute" context="2:XMLDecl Version Eq" String="version" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="2:XMLDecl Version Eq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="3:XMLDecl Version" char="="/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="3:XMLDecl Version" attribute="Error" lineEndContext="#stay">
    <RegExpr attribute="Value" context="4:XMLDecl Encoding" String="&quot;[A-Za-z0-9:._-]*&quot;|'[A-Za-z0-9:._-]*'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <!--
    [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
    [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
  -->
  <context name="4:XMLDecl Encoding" attribute="Error" lineEndContext="#stay" fallthroughContext="7:XMLDecl Standalone">
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Attribute" context="5:XMLDecl Encoding Eq" String="encoding" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="5:XMLDecl Encoding Eq" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Attribute" context="6:XMLDecl Encoding" char="="/>
  </context>

  <context name="6:XMLDecl Encoding" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Value" context="#pop#pop!7:XMLDecl Standalone" String="&quot;[A-Za-z][A-Za-z0-9._-]*&quot;|'[A-Za-z][A-Za-z0-9._-]*'"/>
  </context>

  <!--
    [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
  -->
  <context name="7:XMLDecl Standalone" attribute="Error" lineEndContext="#stay" fallthroughContext="10:XMLDecl Standalone">
    <WordDetect attribute="Attribute" context="8:XMLDecl Standalone Eq" String="standalone" weakDeliminator="&weakdelim;"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="8:XMLDecl Standalone Eq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="9:XMLDecl Standalone" char="="/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="9:XMLDecl Standalone" attribute="Error" lineEndContext="#stay">
    <RegExpr attribute="Value" context="#pop#pop!10:XMLDecl Standalone" String="&quot;(yes|no)&quot;|'(yes|no)'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <!-- close XMLDecl -->

  <context name="10:XMLDecl Standalone" attribute="Error" lineEndContext="#stay">
    <Detect2Chars attribute="Doctype Declaration" context="#pop#pop#pop#pop#pop#pop!11:Misc after XMLDecl" char="?" char1="&gt;"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <!-- ^^^ XMLDecl end ^^^ -->


  <!--
    [27] Misc ::= Comment | PI | S
    [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>'
  -->
  <context name="11:Misc after XMLDecl" attribute="Error" lineEndContext="#stay" fallthroughContext="#pop!79:Outside">
    <WordDetect attribute="Doctype Declaration" context="14:Doctype Decl Name" String="&lt;!DOCTYPE" weakDeliminator="&weakdelim;"/>
    <DetectSpaces attribute="Normal Text"/>
    <IncludeRules context="Comment"/>
    <IncludeRules context="PI"/>
  </context>

  <context name="14:Doctype Decl Name" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Doctype Declaration" context="15:Doctype Decl ExternalID" String="&name;"/>
  </context>

  <!--
    [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
  -->
  <context name="15:Doctype Decl ExternalID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop!23:Doctype Decl IS" char="["/>
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop!79:Outside" char=">"/>
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Doctype Declaration" context="16:Doctype Decl PublicID" String="PUBLIC" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Doctype Declaration" context="19:Doctype Decl SystemID" String="SYSTEM" weakDeliminator="&weakdelim;"/>
  </context>

  <!--
    [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
    [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
  -->
  <context name="16:Doctype Decl PublicID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="17:Doctype Decl PublicID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="18:Doctype Decl PublicID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="17:Doctype Decl PublicID qq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!19:Doctype Decl SystemID" char="&quot;"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="18:Doctype Decl PublicID q" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!19:Doctype Decl SystemID" char="'"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <!--
    [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
  -->
  <context name="PubidChar" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" char="'"/>
    <RegExpr attribute="Value" String="[&#x20;&#xD;&#xA;a-zA-Z0-9()+,./:=?;!*#@$_%-]+"/>
  </context>

  <!--
    [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
  -->
  <context name="19:Doctype Decl SystemID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="20:Doctype Decl SystemID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="21:Doctype Decl SystemID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="20:Doctype Decl SystemID qq" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="22:Doctype Decl IS or end" char="&quot;"/>
  </context>

  <context name="21:Doctype Decl SystemID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="22:Doctype Decl IS or end" char="'"/>
  </context>

  <context name="22:Doctype Decl IS or end" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop#pop#pop#pop!23:Doctype Decl IS" char="["/>
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop#pop#pop#pop!79:Outside" char=">"/>
  </context>

  <!--
    [28a] DeclSep ::= PEReference | S
    [28b] intSubset ::= (markupdecl | DeclSep)*
    [29]  markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
  -->
  <context name="23:Doctype Decl IS" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <StringDetect attribute="Doctype Declaration" context="#pop!79:Outside" String="]>"/>
    <IncludeRules context="Comment"/>
    <IncludeRules context="EntityDecl"/>
    <IncludeRules context="elementdecl"/>
    <IncludeRules context="AttlistDecl"/>
    <IncludeRules context="NotationDecl"/>
    <IncludeRules context="PI"/>
    <RegExpr attribute="Entity" context="#stay" String="&peref;"/>
  </context>

  <!--
    [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
    [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children

    [47] children ::= (choice | seq) ('?' | '*' | '+')?
    [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
    [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    [50] seq    ::= '(' S? cp ( S? ',' S? cp )* S? ')'

    [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
                 | '(' S? '#PCDATA' S? ')'

    where each Name is the type of an element which may appear as a child.
  -->
  <context name="elementdecl" attribute="Error" lineEndContext="#stay">
    <WordDetect attribute="Doctype Declaration" context="24:elementdecl" String="&lt;!ELEMENT" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="24:elementdecl" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Normal Tag" context="25:contentspec" String="&name;"/>
    <RegExpr attribute="Entity" context="25:contentspec" String="&peref;"/>
    <RegExpr attribute="Error" context="25:contentspec" String="&invalid_name;"/>
  </context>

  <context name="25:contentspec" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Attribute" context="26:MixedOrChildren" char="("/>
    <WordDetect attribute="Attribute" context="#pop#pop!37:element end" String="EMPTY" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Attribute" context="#pop#pop!37:element end" String="ANY" weakDeliminator="&weakdelim;"/>
    <RegExpr attribute="Entity" context="#pop#pop!37:element end" String="&peref;"/>
  </context>

  <context name="26:MixedOrChildren" attribute="Error" lineEndContext="#stay" fallthroughContext="childrenLvl0OrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <StringDetect attribute="Doctype Declaration" context="27:MixedShort" String="#PCDATA"/>
    <DetectChar attribute="Error" context="#pop#pop#pop!37:element end" char=")"/>
    <AnyChar attribute="Error" context="childrenLvl0OrEnd" String=",|"/>
  </context>

  <context name="27:MixedShort" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="28:MixedLong" char="|"/>
    <DetectChar attribute="Attribute" context="#pop#pop#pop#pop!37:element end" char=")"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="28:MixedLong" attribute="Error" lineEndContext="#stay">
    <RegExpr attribute="Value" context="29:MixedLong endOrContinue" String="&name;|&peref;"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="29:MixedLong endOrContinue" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop" char="|"/>
    <StringDetect attribute="Attribute" context="#pop#pop#pop#pop#pop#pop!37:element end" String=")*"/>
    <DetectChar attribute="Error" context="#pop#pop#pop#pop#pop#pop!37:element end" char=")"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <!-- ^^^ Mixed end ^^^ -->

  <context name="childrenLvl0OrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop#pop!choiceLvl0" char="|"/>
    <DetectChar attribute="Attribute" context="#pop#pop!seqLvl0" char=","/>
    <IncludeRules context="childrenLvl0CpOrEnd"/>
  </context>

  <context name="childrenCp" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="children" char="("/>
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Value" context="childrenCpEnd" String="(&name;|&peref;)[?*+]?"/>
  </context>

  <context name="childrenLvl0CpOrEnd" attribute="Error" lineEndContext="#stay">
    <IncludeRules context="childrenCp"/>
    <RegExpr attribute="Attribute" context="#pop#pop#pop#pop!37:element end" String="\)[?*+]?"/>
  </context>

  <context name="choiceLvl0" attribute="Error" lineEndContext="#stay" fallthroughContext="choiceLvl0OrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop#pop#pop!37:element end" char=")"/>
    <DetectChar attribute="Error" context="choiceLvl0OrEnd" char=","/>
  </context>
  <context name="choiceLvl0OrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop" char=","/>
    <IncludeRules context="childrenLvl0CpOrEnd"/>
  </context>

  <context name="seqLvl0" attribute="Error" lineEndContext="#stay" fallthroughContext="seqLvl0OrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop#pop#pop!37:element end" char=")"/>
    <DetectChar attribute="Error" context="seqLvl0OrEnd" char=","/>
  </context>
  <context name="seqLvl0OrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop" char=","/>
    <IncludeRules context="childrenLvl0CpOrEnd"/>
  </context>


  <context name="children" attribute="Error" lineEndContext="#stay" fallthroughContext="childrenOrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop" char=")"/>
    <AnyChar attribute="Error" context="childrenOrEnd" String="|,"/>
  </context>

  <context name="childrenOrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop#pop!choice" char="|"/>
    <DetectChar attribute="Attribute" context="#pop#pop!seq" char=","/>
    <IncludeRules context="childrenCpOrEnd"/>
  </context>

  <context name="childrenCpOrEnd" attribute="Error" lineEndContext="#stay">
    <IncludeRules context="childrenCp"/>
    <RegExpr attribute="Attribute" context="#pop#pop!childrenCpEnd" String="\)[?*+]?"/>
  </context>

  <context name="childrenCpEnd" attribute="Error" lineEndContext="#stay" fallthroughContext="#pop">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop!children" char="("/>
    <DetectChar attribute="Error" context="#pop" char=":"/>
    <DetectIdentifier attribute="Error" context="#pop"/>
  </context>

  <context name="choice" attribute="Error" lineEndContext="#stay" fallthroughContext="choiceOrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop" char=")"/>
    <DetectChar attribute="Error" context="choiceOrEnd" char="|"/>
  </context>
  <context name="choiceOrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop" char="|"/>
    <IncludeRules context="childrenCpOrEnd"/>
  </context>

  <context name="seq" attribute="Error" lineEndContext="#stay" fallthroughContext="seqOrEnd">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Error" context="#pop" char=")"/>
    <DetectChar attribute="Error" context="seqOrEnd" char=","/>
  </context>
  <context name="seqOrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="#pop" char=","/>
    <IncludeRules context="childrenCpOrEnd"/>
  </context>

  <!-- ^^^ children end ^^^ -->

  <!-- ^^^ XMLDecl end ^^^ -->

  <context name="37:element end" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop" char=">"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>


  <!--
    [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
    [53] AttDef ::= S Name S AttType S DefaultDecl
  -->
  <context name="AttlistDecl" attribute="Error" lineEndContext="#stay">
    <WordDetect attribute="Doctype Declaration" context="38:AttlistDecl" String="&lt;!ATTLIST" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="38:AttlistDecl" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Normal Tag" context="39:AttDef" String="&name;"/>
  </context>

  <context name="39:AttDef" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Doctype Declaration" context="#pop#pop" char=">"/>
    <RegExpr attribute="Attribute" context="40:AttType" String="xml:space\b|&name;"/>
  </context>

  <!--
    [54] AttType ::= StringType | TokenizedType | EnumeratedType
    [55] StringType ::= 'CDATA'
    [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY'
                         | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'

    [57] EnumeratedType ::= NotationType | Enumeration
    [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
    [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
  -->
  <context name="40:AttType" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Doctype Declaration" context="43:Enumeration" char="("/>
    <keyword attribute="Doctype Declaration" context="46:DefaultDecl" String="AttType"/>
    <WordDetect attribute="Doctype Declaration" context="41:NotationStart" String="NOTATION" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="41:NotationStart" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop!42:Notation" char="("/>
    <DetectSpaces attribute="Doctype Declaration"/>
  </context>

  <context name="42:Notation" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Value" context="44:EnumeratedType or End" String="&name;"/>
  </context>

  <context name="43:Enumeration" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Value" context="44:EnumeratedType or End" String="&nmtoken;"/>
  </context>

  <context name="44:EnumeratedType or End" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop" char="|"/>
    <DetectChar attribute="Doctype Declaration" context="#pop#pop!46:DefaultDecl" char=")"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <!--
    [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
    [10] AttValue ::= '"' ([^<&"] | Reference)* '"'
                    | "'" ([^<&'] | Reference)* "'"
  -->
  <context name="46:DefaultDecl" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Attribute" context="#pop#pop" String="#REQUIRED" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Attribute" context="#pop#pop" String="#IMPLIED" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Attribute" context="#pop!AttValue" String="#FIXED" weakDeliminator="&weakdelim;"/>
    <DetectChar attribute="Value" context="AttValue qq" char="&quot;"/>
    <DetectChar attribute="Value" context="AttValue q" char="'"/>
  </context>

  <context name="AttValue" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Value" context="AttValue qq" char="&quot;"/>
    <DetectChar attribute="Value" context="AttValue q" char="'"/>
  </context>

   <context name="AttValue qq" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop#pop" char="&quot;"/>
    <IncludeRules context="In AttValue"/>
  </context>

  <context name="AttValue q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop" char="&quot;"/>
    <IncludeRules context="In AttValue"/>
  </context>

  <context name="In AttValue" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Value"/>
    <DetectIdentifier attribute="Value"/>
    <RegExpr attribute="Entity" String="&entity;"/>
    <AnyChar attribute="Error" String="&amp;&lt;"/>
  </context>

  <!-- ^^^ AttDef end ^^^ -->

  <!-- ^^^ AttlistDecl end ^^^ -->


  <!--
    [70] EntityDecl ::= GEDecl | PEDecl
    [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
    [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
  -->
  <context name="EntityDecl" attribute="Error" lineEndContext="#stay">
    <WordDetect attribute="Doctype Declaration" context="50:EntityDecl" String="&lt;!ENTITY" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="50:EntityDecl" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Entity" context="#pop!61:PEDecl" char="%"/>
    <RegExpr attribute="Entity" context="52:GEDecl EntityValueOrExternalID" String="&name;"/>
  </context>

  <!--
    [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
    [74] PEDef ::= EntityValue | ExternalID
  -->
  <context name="52:GEDecl EntityValueOrExternalID" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Value" context="53:GEDecl EntityValue qq" char="&quot;"/>
    <DetectChar attribute="Value" context="54:GEDecl EntityValue q" char="'"/>
    <WordDetect attribute="Doctype Declaration" context="55:GEDecl PublicID" String="PUBLIC" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Doctype Declaration" context="58:GEDecl SystemID" String="SYSTEM" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="53:GEDecl EntityValue qq" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="&quot;"/>
    <IncludeRules context="In EntityValue"/>
  </context>

  <context name="54:GEDecl EntityValue q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="69:GEDecl endOrNDATA" char="'"/>
    <IncludeRules context="In EntityValue"/>
  </context>

  <context name="In EntityValue" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Value"/>
    <DetectIdentifier attribute="Value"/>
    <RegExpr attribute="Entity" String="&entity;|&peref;"/>
    <AnyChar attribute="Error" String="&amp;%"/>
  </context>

  <context name="55:GEDecl PublicID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="56:GEDecl PublicID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="57:GEDecl PublicID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="56:GEDecl PublicID qq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!58:GEDecl SystemID" char="&quot;"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="57:GEDecl PublicID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!58:GEDecl SystemID" char="'"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="58:GEDecl SystemID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="59:GEDecl SystemID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="60:GEDecl SystemID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="59:GEDecl SystemID qq" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop!69:GEDecl endOrNDATA" char="&quot;"/>
  </context>

  <context name="60:GEDecl SystemID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop!69:GEDecl endOrNDATA" char="'"/>
  </context>

  <context name="61:PEDecl" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Entity" context="62:PEDecl EntityValueOrExternalID" String="&name;"/>
  </context>

  <context name="62:PEDecl EntityValueOrExternalID" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectChar attribute="Value" context="53:GEDecl EntityValue qq" char="&quot;"/>
    <DetectChar attribute="Value" context="54:GEDecl EntityValue q" char="'"/>
    <WordDetect attribute="Doctype Declaration" context="63:PEDecl PublicID" String="PUBLIC" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Doctype Declaration" context="66:PEDecl SystemID" String="SYSTEM" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="63:PEDecl PublicID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="64:PEDecl PublicID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="65:PEDecl PublicID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="64:PEDecl PublicID qq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!66:PEDecl SystemID" char="&quot;"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="65:PEDecl PublicID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop!66:PEDecl SystemID" char="'"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="66:PEDecl SystemID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="67:PEDecl SystemID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="68:PEDecl SystemID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="67:PEDecl SystemID qq" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop#pop#pop!37:element end" char="&quot;"/>
  </context>

  <context name="68:PEDecl SystemID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="#pop#pop#pop#pop!37:element end" char="'"/>
  </context>

  <!-- ^^^ PEDef end ^^^ -->

  <context name="69:GEDecl endOrNDATA" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop#pop" char=">"/>
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Doctype Declaration" context="70:GEDecl NDATA" String="NDATA" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="70:GEDecl NDATA" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Entity" context="#pop#pop#pop#pop#pop!37:element end" String="&name;"/>
  </context>

  <!-- ^^^ EntityDef end ^^^ -->

  <!-- ^^^ EntityDecl end ^^^ -->


  <!--
    [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
    [83] PublicID ::= 'PUBLIC' S PubidLiteral
  -->
  <context name="NotationDecl" attribute="Error" lineEndContext="#stay">
    <WordDetect attribute="Doctype Declaration" context="71:NotationDecl Name" String="&lt;!NOTATION" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="71:NotationDecl Name" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Entity" context="72:NotationDecl ExternalID" String="&name;"/>
  </context>

  <context name="72:NotationDecl ExternalID" attribute="Error" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <WordDetect attribute="Doctype Declaration" context="66:PEDecl SystemID" String="SYSTEM" weakDeliminator="&weakdelim;"/>
    <WordDetect attribute="Doctype Declaration" context="#pop#pop!73:NotationDecl PublicID" String="PUBLIC" weakDeliminator="&weakdelim;"/>
  </context>

  <context name="73:NotationDecl PublicID" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="74:NotationDecl PublicID qq" char="&quot;"/>
    <DetectChar attribute="Value" context="75:NotationDecl PublicID q" char="'"/>
    <DetectSpaces attribute="Normal Text"/>
  </context>

  <context name="74:NotationDecl PublicID qq" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Value" context="76:NotationDecl SystemIDOrEnd" char="&quot;"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="75:NotationDecl PublicID q" attribute="Value" lineEndContext="#stay">
    <DetectChar attribute="Value" context="76:NotationDecl SystemIDOrEnd" char="'"/>
    <IncludeRules context="PubidChar"/>
  </context>

  <context name="76:NotationDecl SystemIDOrEnd" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Doctype Declaration" context="#pop#pop#pop" char=">"/>
    <IncludeRules context="66:PEDecl SystemID"/>
  </context>

  <!-- ^^^ NotationDecl end ^^^ -->


  <!--
    [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
    [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
  -->
  <context name="PI" attribute="Processing Instruction Body" lineEndContext="#stay">
    <RegExpr attribute="Processing Instruction" context="77:PI inside IS" String="&lt;\?(xml-stylesheet(\s+|$)|&name;)"/>
    <RegExpr attribute="Error" context="77:PI inside IS" String="&lt;\?&invalid_name;"/>
  </context>

  <context name="77:PI inside IS" attribute="Processing Instruction Body" lineEndContext="#stay">
    <StringDetect attribute="Processing Instruction" context="#pop" String="?>"/>
  </context>

  <!-- ^^^ PI end ^^^ -->

  <!--
    [39] element ::= EmptyElemTag | STag content ETag

    [40] STag ::= '<' Name (S Attribute)* S? '>'
    [41] Attribute ::= Name Eq AttValue
    [42] ETag ::= '</' Name S? '>'

    [43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
    [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

    [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'

    [18] CDSect ::= CDStart CData CDEnd
    [19] CDStart ::= '<![CDATA['
    [20] CData ::= (Char* - (Char* ']]>' Char*))
    [21] CDEnd ::= ']]>'
  -->
  <context name="79:Outside" attribute="Normal Text" lineEndContext="#stay">
    <DetectSpaces attribute="Normal Text"/>
    <DetectIdentifier attribute="Normal Text"/>
    <RegExpr attribute="Normal Tag" context="80:STag" String="&lt;&name;"/>
    <RegExpr attribute="Normal Tag" context="85:ETag" String="&lt;/&name;"/>
    <RegExpr attribute="Entity" context="#stay" String="&entity;"/>
    <RegExpr attribute="Error" context="80:STag" String="&lt;&invalid_name;"/>
    <RegExpr attribute="Error" context="85:ETag" String="&lt;/&invalid_name;"/>
    <IncludeRules context="Comment"/>
    <StringDetect attribute="Entity" context="86:CDSect" String="&lt;![CDATA["/>
    <IncludeRules context="PI"/>
    <AnyChar attribute="Error" context="#stay" String="&lt;&amp;"/>
    <StringDetect attribute="Error" context="#stay" String="]]>"/>
  </context>

  <context name="80:STag" attribute="Error" lineEndContext="#stay">
    <Detect2Chars attribute="Normal Tag" context="#pop" char="/" char1="&gt;"/>
    <DetectChar attribute="Normal Tag" context="#pop" char="&gt;"/>
    <DetectSpaces attribute="Normal Text"/>
    <RegExpr attribute="Attribute" context="81:STag Attribute" String="(^|(?&lt;=[ \t]))(&name;|xmlns:[\w_.-]*|xmlns\b|xml:(lang|base|space)\b)"/>
  </context>

  <context name="81:STag Attribute" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Attribute" context="AttValue" char="="/>
    <DetectSpaces attribute="Normal Tag" context="#stay"/>
  </context>

  <context name="85:ETag" attribute="Error" lineEndContext="#stay">
    <DetectChar attribute="Normal Tag" context="#pop" char="&gt;"/>
    <DetectSpaces attribute="Normal Tag" context="#stay"/>
  </context>

  <context name="86:CDSect" attribute="Normal Text" lineEndContext="#stay">
    <StringDetect attribute="Entity" context="79:Outside" String="]]>"/>
  </context>

  <!-- ^^^ Outside end ^^^ -->

  <!--
    [15] Comment ::= '<!-' '-' ((Char - '-') | ('-' (Char - '-')))* '-' '->'
  -->
  <context name="Comment" attribute="Comment" lineEndContext="#stay">
    <StringDetect attribute="Comment" context="87:Comment inside IS" String="&lt;!--" beginRegion="Comment"/>
  </context>

  <context name="87:Comment inside IS" attribute="Comment" lineEndContext="#stay">
    <DetectSpaces/>
    <StringDetect context="88:Comment double hyphen" String="--" lookAhead="1"/>
    <IncludeRules context="##Comments"/>
    <DetectIdentifier/>
  </context>

  <context name="88:Comment double hyphen" attribute="Comment" lineEndContext="#pop" fallthroughContext="#pop">
    <StringDetect attribute="Comment" context="#pop#pop" String="-->" endRegion="comment" />
    <DetectChar attribute="Error" char="-" />
  </context>

  <!-- ^^^ Comment end ^^^ -->

</contexts>
    <itemDatas>
      <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Entity" defStyleNum="dsChar" spellChecking="false"/>
      <itemData name="Normal Tag" defStyleNum="dsKeyword" spellChecking="false"/>
      <itemData name="Attribute" defStyleNum="dsDataType" spellChecking="false"/>
      <itemData name="Value" defStyleNum="dsString" spellChecking="false"/>
      <itemData name="Doctype Declaration" defStyleNum="dsKeyword" spellChecking="false"/>
      <itemData name="Comment" defStyleNum="dsComment"/>
      <itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false"/>
      <itemData name="Processing Instruction Body" defStyleNum="dsNormal" spellChecking="false"/>
      <itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="multiLine" start="&lt;!--" end="--&gt;" region="Comment"/>
    </comments>
    <keywords casesensitive="1"/>
  </general>
</language>
