<glimmer-definition>
   <settings>
      <language>eXtensible Markup Language</language>
      <compiler>gnome-moz-remote --newwin "%1/%2"</compiler>
      <debugger>gnome-moz-remote --newwin "%1/%2"</debugger>
      <execution>gnome-moz-remote --newwin "%1/%2"</execution>
      <auto-indent>0</auto-indent>
      <use-spaces>0</use-spaces>
      <tab-stop>2</tab-stop>
   </settings>

   <mime-types>
      <extension>xml</extension>
      <extension>xsl</extension>
      <extension>fo</extension>
      <extension>dtd</extension>
   </mime-types>

   <syntax-items>
      <syntax-item>
         <name>strings1</name>
         <start-regex>&quot;</start-regex>
         <end-regex>\(&quot;\|\n\)</end-regex>
         <style>string</style>
      </syntax-item>
      <syntax-item>
         <name>strings1</name>
         <start-regex>&apos;</start-regex>
         <end-regex>\(&apos;\|\n\)</end-regex>
         <style>string</style>
      </syntax-item>
      <syntax-item>
         <name>comment</name>
         <start-regex>&lt;!--</start-regex>
         <end-regex>--&gt;</end-regex>
         <style>comment</style>
      </syntax-item>
      <syntax-item>
         <name>cdata</name>
         <start-regex>&lt;!\[CDATA\[</start-regex>
         <end-regex>\]\]&gt;</end-regex>
         <style>char</style>
      </syntax-item>
   </syntax-items>

   <pattern-items>
      <pattern-item>
         <name>tags_pi</name>
         <regex>&lt;\?\(\(X\|x\)\(M\|m\)\(L\|l\)\)?</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>tags_decl</name>
         <regex>&lt;!\(DOCTYPE\|ELEMENT\|ENTITY\|ATTLIST\|NOTATION\)</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>tags_generic1</name>
         <regex>&lt;[a-zA-Z_:][a-zA-Z0-9_:-]*\b</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>tags_generic2</name>
         <regex>&lt;/?[a-zA-Z_:][a-zA-Z0-9_:-]*/?></regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>hex</name>
         <regex>#[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]</regex>
         <style>hexidecimal</style>
      </pattern-item>
      <pattern-item>
         <name>close</name>
         <regex>\(/\|\?\)?&gt;</regex>
         <style>keyword</style>
      </pattern-item>
      <pattern-item>
         <name>entities</name>
         <regex>\(\&amp;\|\%\)[a-zA-Z0-9#]*;</regex>
         <style>variable</style>
      </pattern-item>
      <pattern-item>
         <name>operators</name>
         <regex>\(=\|+\|\?\|\*\|\%\)</regex>
         <style>operator</style>
      </pattern-item>
   </pattern-items>

   <embedded-items>
      <embedded-item>
         <name>keywords_pi</name>
         <outside-regex>&lt;\?.+\?&gt;?</outside-regex>
         <inside-regex>\b\(version\|encoding\|standalone\)</inside-regex>
         <style>data_type</style>
      </embedded-item>
      <embedded-item>
         <name>keywords_decl_1</name>
         <outside-regex>&lt;!.+&gt;?</outside-regex>
         <inside-regex>\b\(SYSTEM\|PUBLIC\|CDATA\|NDATA\|EMPTY\|ANY\|ID\|IDREF\|IDREFS/|ENTITY\|ENTITIES\|NMTOKEN\|NMTOKENS\)</inside-regex>
         <style>data_type</style>
      </embedded-item>
      <embedded-item>
         <name>keywords_decl_2</name>
         <outside-regex>&lt;!.+&gt;?</outside-regex>
         <inside-regex>\(#FIXED\|#REQUIRED\|#IMPLIED\|#PCDATA\)</inside-regex>
         <style>data_type</style>
      </embedded-item>
      <embedded-item>
         <name>keywords_conditional</name>
         <outside-regex>&lt;!\[.+\]\]&gt;?</outside-regex>
         <inside-regex>\(INCLUDE\|IGNORE\)</inside-regex>
         <style>data_type</style>
      </embedded-item>
      <embedded-item>
         <name>keywords1</name>
         <outside-regex>&lt;.+&gt;?</outside-regex>
         <inside-regex>\b\(xml:lang\|xmlns\|xml:space\)\b</inside-regex>
         <style>data_type</style>
      </embedded-item>
   </embedded-items>
</glimmer-definition>

<python-definition>
import glimmer
import string

def insert_xml_header():
    glimmer.freeze()
    glimmer.move(0)
    glimmer.insert("<?xml version='1.0' encoding='utf-8'?>\n")
    glimmer.thaw()

glimmer.add_sub_to_menu("_Insert/", "XML", -1)
glimmer.add_item_to_menu("_Insert/XML/", "Header", "", "", -1, insert_xml_header)
glimmer.add_item_to_popup_menu("XML Header", -1, insert_xml_header)    
</python-definition>

