<?xml version="1.0" encoding="UTF-8"?>
<codesense version="1.0">
	<set name="com.macrabbit.xsl.root-namespace">
		<behavior>
			<append-dynamic>
				<matched-suffix>(\s*:)|[^:]</matched-suffix>
				<transform-into>(?1:::)</transform-into>
			</append-dynamic>
			<confirm characters=":"/>
		</behavior>
		<completion string="xsl"/>
	</set>
	
	<set name="com.macrabbit.xsl.tags">
		<!-- Default behavior -->
		<behavior>
			<append-dynamic>
				<matched-suffix>(\s*:)|[^:]</matched-suffix>
				<transform-into>(?1::>$0&lt;/xsl:${completion}>)</transform-into>
			</append-dynamic>
		</behavior>
		
		<completion string="attribute">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="attribute-set">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="choose" />
		<completion string="comment" />
		<completion string="copy" />
		<completion string="element">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="fallback" />
		<completion string="for-each">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: select="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="if">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: test="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="message" />
		<completion string="otherwise" />
		<completion string="processing-instruction">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="result-document"/>
		<completion string="stylesheet">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: version="${1:1.0}"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="template" />
		<completion string="text" />
		<completion string="transform">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: version="${1:1.0}"$2>$0&lt;/xsl:${completion}>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="when">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: test="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
	</set>
	
	<set name="com.macrabbit.xsl.tags.self-closing">
		<behavior>
			<append-dynamic>
				<matched-suffix>(\s*:)|[^:]</matched-suffix>
				<transform-into>(?1::$0/>)</transform-into>
			</append-dynamic>
		</behavior>
		
		<completion string="apply-imports" />
		<completion string="copy-of">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: select="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="decimal-format" />
		<completion string="import">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: href="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="include">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: href="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="key">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1" match="$2" use="$3"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="namespace-alias">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: result-prefix="$1" stylesheet-prefix="$2"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="number" />
		<completion string="output" />
		<completion string="preserve-space">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: elements="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="sort" />
		<completion string="strip-space">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: elements="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="value-of">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: select="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		
		<!-- TODO: These can be used either as self-closing or as open; need to figure out which makes sense as the default -->
		<completion string="apply-templates" />
		<completion string="call-template">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="param">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="variable">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
		<completion string="with-param">
			<behavior>
				<append-dynamic>
					<matched-suffix>(\s*:)|[^:]</matched-suffix>
					<transform-into>(?1:: name="$1"/>)</transform-into>
				</append-dynamic>
			</behavior>
		</completion>
	</set>
	
	<!-- Attribute completions -->
	
	<behavior>
		<append-dynamic>
			<matched-suffix>(\s*=)|[^=]</matched-suffix>
			<transform-into>(?1::="$1"$0)</transform-into>
		</append-dynamic>
		<partial-confirm characters="-"/>
	</behavior>
	
	<set name="com.macrabbit.xsl.tags.stylesheet.attributes">
		<completion string="version"/>
		<completion string="id" />
		<completion string="extension-element-prefixes" />
		<completion string="exclude-result-prefixes" />
		<completion string="xmlns:xsl">
			<behavior>
				<partial-confirm characters=":"/>
			</behavior>
		</completion>
	</set>
	<set name="com.macrabbit.xsl.tags.transform.attributes">
		<completion string="version"/>
		<completion string="id" />
		<completion string="extension-element-prefixes" />
		<completion string="exclude-result-prefixes" />
		<completion string="xmlns:xsl">
			<behavior>
				<partial-confirm characters=":"/>
			</behavior>
		</completion>
	</set>
	
	<set name="com.macrabbit.xsl.tags.include.attributes">
		<completion string="href" />
	</set>
	<set name="com.macrabbit.xsl.tags.import.attributes">
		<completion string="href" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.template.attributes">
		<completion string="match" />
		<completion string="name" />
		<completion string="priority" />
		<completion string="mode" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.apply-templates.attributes">
		<completion string="select" />
		<completion string="mode" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.call-template.attributes">
		<completion string="name" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.namespace-alias.attributes">
		<completion string="name" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.element.attributes">
		<completion string="name" />
		<completion string="namespace" />
		<completion string="use-attribute-sets" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.attribute.attributes">
		<completion string="name" />
		<completion string="namespace" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.attribute-set.attributes">
		<completion string="name" />
		<completion string="use-attribute-sets" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.text.attributes">
		<completion string="disable-output-escaping" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.processing-instruction.attributes">
		<completion string="name" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.copy.attributes">
		<completion string="use-attribute-sets" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.value-of.attributes">
		<completion string="select" />
		<completion string="disable-output-escaping" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.number.attributes">
		<completion string="level" />
		<completion string="count" />
		<completion string="from" />
		<completion string="value" />
		<completion string="format" />
		<completion string="lang" />
		<completion string="letter-value" />
		<completion string="grouping-separator" />
		<completion string="grouping-size" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.for-each.attributes">
		<completion string="select" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.if.attributes">
		<completion string="test" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.when.attributes">
		<completion string="test" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.sort.attributes">
		<completion string="select" />
		<completion string="lang" />
		<completion string="data-type" />
		<completion string="order" />
		<completion string="case-order" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.variable.attributes">
		<completion string="name" />
		<completion string="select" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.param.attributes">
		<completion string="name" />
		<completion string="select" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.copy-of.attributes">
		<completion string="select" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.with-param.attributes">
		<completion string="name" />
		<completion string="select" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.key.attributes">
		<completion string="name" />
		<completion string="match" />
		<completion string="use"/>
	</set>
	
	<set name="com.macrabbit.xsl.tags.decimal-format.attributes">
		<completion string="name" />
		<completion string="decimal-separator" />
		<completion string="grouping-separator" />
		<completion string="infinity" />
		<completion string="minus-sign" />
		<completion string="NaN" />
		<completion string="percent" />
		<completion string="per-mille" />
		<completion string="zero-digit" />
		<completion string="digit" />
		<completion string="pattern-separator" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.message.attributes">
		<completion string="terminate" />
	</set>
	
	<set name="com.macrabbit.xsl.tags.output.attributes">
		<completion string="method" />
		<completion string="version" />
		<completion string="encoding" />
		<completion string="omit-xml-declaration" />
		<completion string="doctype-public" />
		<completion string="doctype-system" />
		<completion string="standalone" />
		<completion string="indent" />
		<completion string="cdata-section-elements" />
		<completion string="media-type" />
	</set>
	
</codesense>