<?xml version="1.0"?>

<!DOCTYPE MODE SYSTEM "xmode.dtd">

<MODE>
	<PROPS>
		<PROPERTY NAME="commentStart" VALUE="&lt;!--" />
		<PROPERTY NAME="commentEnd" VALUE="--&gt;" />
	</PROPS>

	<RULES IGNORE_CASE="TRUE">
		<!-- SGML comment -->
		<SPAN TYPE="COMMENT1">
			<BEGIN>&lt;!--</BEGIN>
			<END>--&gt;</END>
		</SPAN>

		<!-- JavaScript -->
		<SPAN TYPE="MARKUP" DELEGATE="JAVASCRIPT">
			<BEGIN>&lt;SCRIPT</BEGIN>
			<END>&lt;/SCRIPT&gt;</END>
		</SPAN>

		<!-- stylesheet -->
		<SPAN TYPE="MARKUP" DELEGATE="CSS">
			<BEGIN>&lt;STYLE</BEGIN>
			<END>&lt;/STYLE&gt;</END>
		</SPAN>

		<!-- DTD instructions -->
		<SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
			<BEGIN>&lt;!</BEGIN>
			<END>&gt;</END>
		</SPAN>

		<!-- markup tags -->
		<SPAN TYPE="MARKUP" DELEGATE="TAGS">
			<BEGIN>&lt;</BEGIN>
			<END>&gt;</END>
		</SPAN>

		<!-- SGML entities -->
		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
			<BEGIN>&amp;</BEGIN>
			<END>;</END>
		</SPAN>
	</RULES>

	<!-- ESCAPE is not exactly right but it is needed to correctly
	     handle JavaScript in on* parameters.
             NOTE: ESCAPE moved from RULE to SPANs! -->
	<RULES SET="TAGS" DEFAULT="MARKUP">
		<!-- Inline CSS -->
 		<SPAN_REGEXP AT_WORD_START="TRUE" TYPE="MARKUP" DELEGATE="css::PROPERTIES" HASH_CHAR="style">
			<BEGIN>style\s*=\s*(["'])</BEGIN>
			<END>$1</END>
		</SPAN_REGEXP>

		<!-- Javascript: delegate on* attributes to Javascript mode -->
 		<SPAN_REGEXP AT_WORD_START="TRUE" DELEGATE="javascript::MAIN" HASH_CHAR="on" TYPE="MARKUP">
			<BEGIN>on[a-z]+\s*=\s*(["'])</BEGIN>
			<END>$1</END>
		</SPAN_REGEXP>

		<!-- NOTE: no ESCAPE for quotes, at least for attributes; e.g onclick="alert(\"foo\");" is invalid! -->
		<SPAN TYPE="LITERAL1">
			<BEGIN>"</BEGIN>
			<END>"</END>
		</SPAN>
		<SPAN TYPE="LITERAL1">
			<BEGIN>'</BEGIN>
			<END>'</END>
		</SPAN>

		<SEQ TYPE="OPERATOR">=</SEQ>

		<KEYWORDS>
			<!-- HTML/XHTML elements, taken from http://de.selfhtml.org/html/referenz/elemente.htm -->
			<MARKUP>a</MARKUP>
			<MARKUP>abbr</MARKUP>
			<MARKUP>acronym</MARKUP>
			<MARKUP>address</MARKUP>
			<MARKUP>applet</MARKUP>
			<MARKUP>area</MARKUP>
			<MARKUP>b</MARKUP>
			<MARKUP>base</MARKUP>
			<MARKUP>basefont</MARKUP>
			<MARKUP>bdo</MARKUP>
			<MARKUP>big</MARKUP>
			<MARKUP>blockquote</MARKUP>
			<MARKUP>body</MARKUP>
			<MARKUP>br</MARKUP>
			<MARKUP>button</MARKUP>
			<MARKUP>caption</MARKUP>
			<MARKUP>center</MARKUP>
			<MARKUP>cite</MARKUP>
			<MARKUP>code</MARKUP>
			<MARKUP>col</MARKUP>
			<MARKUP>colgroup</MARKUP>
			<MARKUP>dd</MARKUP>
			<MARKUP>del</MARKUP>
			<MARKUP>dfn</MARKUP>
			<MARKUP>dir</MARKUP>
			<MARKUP>div</MARKUP>
			<MARKUP>dl</MARKUP>
			<MARKUP>dt</MARKUP>
			<MARKUP>em</MARKUP>
			<MARKUP>fieldset</MARKUP>
			<MARKUP>font</MARKUP>
			<MARKUP>form</MARKUP>
			<MARKUP>frame</MARKUP>
			<MARKUP>frameset</MARKUP>
			<MARKUP>h1</MARKUP>
			<MARKUP>h2</MARKUP>
			<MARKUP>h3</MARKUP>
			<MARKUP>h4</MARKUP>
			<MARKUP>h5</MARKUP>
			<MARKUP>h6</MARKUP>
			<MARKUP>head</MARKUP>
			<MARKUP>hr</MARKUP>
			<MARKUP>html</MARKUP>
			<MARKUP>i</MARKUP>
			<MARKUP>iframe</MARKUP>
			<MARKUP>img</MARKUP>
			<MARKUP>input</MARKUP>
			<MARKUP>ins</MARKUP>
			<MARKUP>isindex</MARKUP>
			<MARKUP>kbd</MARKUP>
			<MARKUP>label</MARKUP>
			<MARKUP>legend</MARKUP>
			<MARKUP>li</MARKUP>
			<MARKUP>link</MARKUP>
			<MARKUP>map</MARKUP>
			<MARKUP>menu</MARKUP>
			<MARKUP>meta</MARKUP>
			<MARKUP>noframes</MARKUP>
			<MARKUP>noscript</MARKUP>
			<MARKUP>object</MARKUP>
			<MARKUP>ol</MARKUP>
			<MARKUP>optgroup</MARKUP>
			<MARKUP>option</MARKUP>
			<MARKUP>p</MARKUP>
			<MARKUP>param</MARKUP>
			<MARKUP>pre</MARKUP>
			<MARKUP>q</MARKUP>
			<MARKUP>s</MARKUP>
			<MARKUP>samp</MARKUP>
			<MARKUP>script</MARKUP>
			<MARKUP>select</MARKUP>
			<MARKUP>small</MARKUP>
			<MARKUP>span</MARKUP>
			<MARKUP>strike</MARKUP>
			<MARKUP>strong</MARKUP>
			<MARKUP>style</MARKUP>
			<MARKUP>sub</MARKUP>
			<MARKUP>sup</MARKUP>
			<MARKUP>table</MARKUP>
			<MARKUP>tbody</MARKUP>
			<MARKUP>td</MARKUP>
			<MARKUP>textarea</MARKUP>
			<MARKUP>tfoot</MARKUP>
			<MARKUP>th</MARKUP>
			<MARKUP>thead</MARKUP>
			<MARKUP>title</MARKUP>
			<MARKUP>tr</MARKUP>
			<MARKUP>tt</MARKUP>
			<MARKUP>u</MARKUP>
			<MARKUP>ul</MARKUP>
			<MARKUP>var</MARKUP>
		</KEYWORDS>
	</RULES>

	<RULES SET="JAVASCRIPT" DEFAULT="MARKUP" IGNORE_CASE="TRUE">
		<SEQ TYPE="MARKUP" DELEGATE="javascript::MAIN">&gt;</SEQ>
		<!-- handle <SCRIPT SRC="..."> properly -->
		<SEQ TYPE="MARKUP" DELEGATE="BACK_TO_HTML">SRC=</SEQ>

		<!-- Inline CSS -->
 		<SPAN_REGEXP TYPE="MARKUP" DELEGATE="css::PROPERTIES" HASH_CHAR="style">
			<BEGIN>style\s*=\s*(["'])</BEGIN>
			<END>$1</END>
		</SPAN_REGEXP>
	</RULES>

	<RULES SET="BACK_TO_HTML" DEFAULT="MARKUP">
		<SEQ TYPE="MARKUP" DELEGATE="html::MAIN">&gt;</SEQ>
	</RULES>

	<RULES SET="CSS" DEFAULT="MARKUP">
		<SEQ TYPE="MARKUP" DELEGATE="css::MAIN">&gt;</SEQ>
	</RULES>
</MODE>
