<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:test="testuri" xmlns:test2="testuri2">
	<!-- 
restructuredText style comments

non ASCII characters should work in comments (öäüÜÖÄß), pyXSLdoc normally assumes UTF-8 documents

"quots" too?

**this stylesheet does not work for anything, just shows comment examples!**

:version: 0.66
:author: Christof Höke
-->
	<!-- 
comment for output -->
	<xsl:output encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="yes" standalone="no"/>
	<!-- 
comment for ns-alias -->
	<xsl:namespace-alias stylesheet-prefix="test" result-prefix="xsl"/>
	<xsl:namespace-alias stylesheet-prefix="test2" result-prefix="test"/>
	<!-- 
comment for strip space of all elements -->
	<xsl:strip-space elements="test | test2"/>
	<!-- 
comment for preserve -->
	<xsl:preserve-space elements="some"/>
	<!-- 
imports/includes -->
	<xsl:import href="test2.xsl"/>
	<xsl:import href="test1.xsl"/>
	<xsl:include href="testa.xsl"/>
	<xsl:include href="testc.xsl"/>
	<xsl:include href="testb.xsl"/>
	<!-- 
comment for param par1 with select="1" -->
	<xsl:param name="par1" select="1"/>
	<!-- 
comment for param 3 with no default -->
	<xsl:param name="par2"/>
	<!-- 
comment for param 2 with content 2 -->
	<xsl:param name="par2">2</xsl:param>
	<!-- 
comment for variable var2 with no default -->
	<xsl:variable name="var2"/>
	<!--
comment for  variable var 3 -->
	<xsl:variable name="var3" select="3"/>
	<!-- 
comment for variable var1 with value 1-->
	<xsl:variable name="var1">1</xsl:variable>
	<!-- 
comment for key 2 -->
	<xsl:key name="n2" match="m2" use="u2"/>
	<!-- 
comment for key 1 -->
	<xsl:key name="n" match="m" use="u"/>
	<!-- 
comment for this attribute set -->
	<xsl:attribute-set name="as1">
		<xsl:attribute name="a2"><xsl:value-of select="$var3"/></xsl:attribute>
		<xsl:attribute name="a1">x</xsl:attribute>
	</xsl:attribute-set>
	<xsl:attribute-set name="as2">
		<xsl:attribute name="a2">y</xsl:attribute>
		<xsl:attribute name="a1">x</xsl:attribute>
	</xsl:attribute-set>
	<!-- 
comment for decimal formatter2 -->
	<xsl:decimal-format decimal-separator="." name="name2" NaN="NaN" pattern-separator=";" per-mille="&#x2030;" percent="%" zero-digit="0"/>
	<!-- 
comment for decimal formatter1 -->
	<xsl:decimal-format decimal-separator="," digit="#" grouping-separator="." infinity="Inf" minus-sign="-" name="name1" NaN="NaN" pattern-separator=";" per-mille="&#x2030;" percent="%" zero-digit="0"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" mode="1"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" mode="2"/>
	<!-- test if sorted right in summary -->
	<xsl:template name="sorted"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" priority="5"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" mode="5" priority="1"/>
	<!-- test if sorted right in summary -->
	<xsl:template name="sorted" mode="2"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" mode="1" priority="1"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" mode="5" priority="6"/>
	<!-- test if sorted right in summary -->
	<xsl:template match="sorted" priority="3"/>
	<!-- match template without params, mode, priority

does nothing -->
	<xsl:template match="melement"/>
	<!-- named template without params, mode, priority

does nothing -->
	<xsl:template name="nelement"/>
	<!-- match/named template without params, mode, priority

does nothing -->
	<xsl:template match="mnelement" name="nmelement"/>
	<!-- match template without params, mode

does nothing -->
	<xsl:template match="mpelement" priority="1"/>
	<!-- named template without params, mode

does nothing -->
	<xsl:template name="npelement" priority="1"/>
	<!-- match/named template without params, mode

does nothing -->
	<xsl:template match="mnpelement" name="nmpelement" priority="1"/>
	<!-- match template without params

does nothing -->
	<xsl:template match="mpmelement" priority="1" mode="m1"/>
	<!-- named template without params
	
does nothing -->
	<xsl:template name="npmelement" priority="1" mode="m1"/>
	<!-- match/named template without params

does nothing -->
	<xsl:template match="mnpmelement" name="nmpmelement" priority="1" mode="m1"/>
	<!-- match template with everything

does nothing -->
	<xsl:template match="mall" mode="mode12" priority="2">
		<!-- the default value is stated as content of the ``xsl:param`` element -->
		<xsl:param name="t1">default in content</xsl:param>
		<!-- the default value is stated in the ``select`` attribute of the ``xsl:param`` element -->
		<xsl:param name="t2" select="default in select"/>
		<!-- no default value given but instead comment about that given here -->
		<xsl:param name="t3"/>
	</xsl:template>
	<!-- named template with everything

does nothing -->
	<xsl:template name="nall" mode="x" priority="3">
		<xsl:param name="t1">default in content</xsl:param>
		<xsl:param name="t2" select="default in select"/>
		<xsl:param name="t3"/>
	</xsl:template>
	<!-- match and named template with everything

does nothing -->
	<xsl:template match="mnall" name="nmall" mode="mode1" priority="5">
		<xsl:param name="t1">default in content</xsl:param>
		<xsl:param name="t2" select="default in select"/>
		<!-- no default -->
		<xsl:param name="t3"/>
	</xsl:template>
	<!-- 
comment for tpl xsl:key | xsl:decimal-format | xsl:output | xsl:strip-space | xsl:preserve-space -->
	<xsl:template match="xsl:key | xsl:decimal-format | xsl:output | xsl:strip-space | xsl:preserve-space">
		<xsl:element name="{local-name()}">
			<xsl:copy-of select="@*"/>
			<xsl:call-template name="insert-comment"/>
		</xsl:element>
	</xsl:template>
	<!-- 
comment for param/variable tpl -->
	<xsl:template match="xsl:param | xsl:variable">
		<xsl:element name="{local-name()}">
			<xsl:copy-of select="@name | @select"/>
			<xsl:call-template name="insert-comment"/>
			<default>
				<xsl:copy-of select="* | text()"/>
			</default>
		</xsl:element>
	</xsl:template>
	<!-- 
comment for insert-comment tpl -->
	<xsl:template name="insert-comment">
		<!-- 
param TEST 1 comment -->
		<xsl:param name="TEST1" select="value">invalue</xsl:param>
		<!-- 
param TEST 2 comment -->
		<xsl:param name="TEST2" select="value">invalue</xsl:param>
		<xsl:if test="(preceding-sibling::comment() | preceding-sibling::*)[last()] = preceding-sibling::comment()[1]">
			<comment>
				<xsl:value-of select="preceding-sibling::comment()[1]"/>
			</comment>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
