<SyntaxLanguage Key="XML" LanguageDefinitionVersion="2.0" Secure="True" xmlns="http://ActiproSoftware/SyntaxEditor/2.0/LanguageDefinition">

	<!-- String Properties -->
	<Properties>
		<Property Key="Creator" Value="Actipro Software LLC" />
		<Property Key="Copyright" Value="Copyright (c) 2001-2004 Actipro Software LLC.  All rights reserved." />
	</Properties>

	<!-- Highlighting Styles -->	
	<Styles>
		<Style Key="EntityStyle" ForeColor="Red" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="TagDelimiterStyle" ForeColor="Blue" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="TagNameStyle" ForeColor="Maroon" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="TagAttributeStyle" ForeColor="Red" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="TagAttributeValueStyle" ForeColor="Blue" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="CommentDelimiterStyle" ForeColor="Green" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="CommentDefaultStyle" ForeColor="Green" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="ProcessingInstructionDelimiterStyle" ForeColor="Blue" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="ProcessingInstructionDefaultStyle" ForeColor="Magenta" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="DeclarationDelimiterStyle" ForeColor="Blue" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="DeclarationDefaultStyle" ForeColor="Magenta" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="CDATADelimiterStyle" ForeColor="Blue" BackColor="Default" Bold="False" Italic="False" Underline="False" />
		<Style Key="CDATADefaultStyle" ForeColor="Gray" BackColor="Default" Bold="False" Italic="False" Underline="False" />
	</Styles>

	<!-- Macros -->	
	<Macros>
		<!-- Redefine word macros to include hyphens -->
		<Macro Key="WordMacro" Value="[a-zA-Z_0-9\-]" />
		<Macro Key="NonWordMacro" Value="[^a-zA-Z_0-9\-]" />
		<!-- Tag name macro to include hyphens and colons -->
		<Macro Key="TagNameMacro" Value="[a-zA-Z_0-9\-:]" />
	</Macros>
	
	<!-- States -->
	<States>
		<!-- Text -->
		<State Key="DefaultState">
			<!-- Patterns Groups -->
			<PatternGroups>
				<!-- Entities -->
				<RegexPatternGroup Token="EntityToken" Style="EntityStyle" PatternValue="&amp; {WordMacro}+ ;?" />
				<!-- Identifier -->
				<RegexPatternGroup Token="IdentifierToken" PatternValue="{AlphaMacro}({WordMacro})*" />
				<!-- Whitespace -->
				<RegexPatternGroup Token="WhitespaceToken" PatternValue="{WhitespaceMacro}+" IsWhitespace="True" />
			</PatternGroups>
			<!-- Child States -->
			<ChildStates>
				<ChildState Key="EndTagState" />
				<ChildState Key="CommentState" />
				<ChildState Key="CDATAState" />
				<ChildState Key="DeclarationState" />
				<ChildState Key="ProcessingInstructionState" />
				<ChildState Key="StartTagState" />
			</ChildStates>
		</State>
		
		<!-- Start Tags -->
		<State Key="StartTagState" Token="StartTagDefaultToken" Style="TagNameStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="StartTagStartToken" Style="TagDelimiterStyle" PatternValue="&lt;" />
					<RegexPatternGroup Type="EndScope" Token="StartTagEndToken" Style="TagDelimiterStyle" PatternValue="/? &gt;" />	
				</Scope>
			</Scopes>
			<!-- Child States -->
			<ChildStates>
				<ChildState Key="StartTagAttributeState" />
			</ChildStates>
		</State>
		
		<!-- Start Tag Attributes -->
		<State Key="StartTagAttributeState" Token="StartTagDefaultToken" Style="TagAttributeStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<RegexPatternGroup Type="StartScope" Token="StartTagNameToken" Style="TagNameStyle" PatternValue="{LineTerminatorWhitespaceMacro}* {TagNameMacro}+ {LineTerminatorWhitespaceMacro}*" />
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<!-- Brackets -->
				<RegexPatternGroup Token="StartTagAttributeToken" Style="TagAttributeStyle" LookAhead="{NonWordMacro}" PatternValue="{WordMacro}+" />
			</PatternGroups>
			<!-- Child States -->
			<ChildStates>
				<ChildState Key="StartTagAttributeStringValueState" />
				<ChildState Key="StartTagAttributeValueState" />
			</ChildStates>
		</State>
		
		<!-- Start Tag Attribute Values -->
		<State Key="StartTagAttributeValueState" Token="StartTagAttributeValueDefaultToken" Style="TagAttributeValueStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<RegexPatternGroup Type="StartScope" Token="StartTagAttributeValueStartToken" Style="TagAttributeValueStyle" PatternValue="= {LineTerminatorWhitespaceMacro}*" />
					<RegexPatternGroup Type="EndScope" Token="StartTagAttributeValueEndToken" Style="TagAttributeValueStyle" PatternValue="{LineTerminatorWhitespaceMacro}+" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="StartTagAttributeStringValueDefaultToken" PatternValue="{NonLineTerminatorWhitespaceMacro}+" />
			</PatternGroups>
		</State>
		
		<!-- Start Tag Attribute String Values -->
		<State Key="StartTagAttributeStringValueState" Token="StartTagAttributeStringValueDefaultToken" Style="TagAttributeValueStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<RegexPatternGroup Type="StartScope" Token="StartTagAttributeStringValueStartToken" Style="TagAttributeValueStyle" PatternValue="= {LineTerminatorWhitespaceMacro}* \&quot;" />
					<RegexPatternGroup Type="EndScope" Token="StartTagAttributeStringValueEndToken" Style="TagAttributeValueStyle" PatternValue="\&quot;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="StartTagAttributeStringValueDefaultToken" PatternValue="[^&quot;]+" />
			</PatternGroups>
		</State>
		
		<!-- End Tags -->
		<State Key="EndTagState" Token="EndTagDefaultToken" Style="TagNameStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="EndTagStartToken" Style="TagDelimiterStyle" PatternValue="&lt;/" />
					<ExplicitPatternGroup Type="EndScope" Token="EndTagEndToken" Style="TagDelimiterStyle" PatternValue="&gt;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="EndTagDefaultToken" PatternValue="[^&gt;]+" />
			</PatternGroups>
		</State>
		
		<!-- Comments -->
		<State Key="CommentState" Token="CommentDefaultToken" Style="CommentDefaultStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="CommentStartToken" Style="CommentDelimiterStyle" PatternValue="&lt;!--" />
					<ExplicitPatternGroup Type="EndScope" Token="CommentEndToken" Style="CommentDelimiterStyle" PatternValue="--&gt;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="CommentDefaultToken" PatternValue="[^\-]+" />
			</PatternGroups>
		</State>
		
		<!-- Processing Instructions -->
		<State Key="ProcessingInstructionState" Token="ProcessingInstructionDefaultToken" Style="ProcessingInstructionDefaultStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="ProcessingInstructionStartToken" Style="ProcessingInstructionDelimiterStyle" PatternValue="&lt;?" />
					<ExplicitPatternGroup Type="EndScope" Token="ProcessingInstructionEndToken" Style="ProcessingInstructionDelimiterStyle" PatternValue="?&gt;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="ProcessingInstructionDefaultToken" PatternValue="[^\?]+" />
			</PatternGroups>
		</State>
		
		<!-- Declarations -->
		<State Key="DeclarationState" Token="DeclarationDefaultToken" Style="DeclarationDefaultStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="DeclarationStartToken" Style="DeclarationDelimiterStyle" PatternValue="&lt;!" />
					<ExplicitPatternGroup Type="EndScope" Token="DeclarationEndToken" Style="DeclarationDelimiterStyle" PatternValue="&gt;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="DeclarationDefaultToken" PatternValue="[^&gt;]+" />
			</PatternGroups>
		</State>
		
		<!-- CDATAs -->
		<State Key="CDATAState" Token="CDATADefaultToken" Style="CDATADefaultStyle">
			<!-- Scopes -->
			<Scopes>
				<Scope>
					<ExplicitPatternGroup Type="StartScope" Token="CDATAStartToken" Style="CDATADelimiterStyle" PatternValue="&lt;![CDATA[" />
					<ExplicitPatternGroup Type="EndScope" Token="CDATAEndToken" Style="CDATADelimiterStyle" PatternValue="]]&gt;" />	
				</Scope>
			</Scopes>
			<!-- Patterns Groups -->
			<PatternGroups>
				<RegexPatternGroup Token="CDATADefaultToken" PatternValue="[^\]]+" />
			</PatternGroups>
		</State>
	</States>

	<!-- Example Text -->
	<ExampleText>
		<![CDATA[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
<?xml version="1.0" encoding="utf-8" ?>
<!-- This is a comment -->
<parser version="1.0">
	<somevalue>
		Text
	</somevalue>
	Entities: &amp; &gt;
	<singlevals>
		<singleval value="true" anothervalue="2" />
		<singleval value="false" anothervalue="3" />
	</singlevals>
</parser>
		]]>
	</ExampleText>
		
</SyntaxLanguage>
