<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:aaa="http://java.sun.com/xml/ns/j2ee" >

<xsl:output method="text" encoding="Shift_JIS" />

<xsl:template match="/">
// openGion Version:<xsl:value-of select="aaa:taglib/aaa:tlib-version" />
// 秀丸エディタ 単語補完機能 Ver7 以降で利用可能
<xsl:apply-templates select="aaa:taglib" />
</xsl:template>

<xsl:template match="aaa:taglib">
	<xsl:for-each select="aaa:tag">
	<xsl:sort select="aaa:name" lang="ja" data-type="text" />
&lt;og:<xsl:value-of select="aaa:name" />
		<xsl:for-each select="aaa:attribute">
			<xsl:variable name="req" select="aaa:required"/>
			<xsl:if test="$req='true'"  >
<xsl:text> </xsl:text><xsl:value-of select="aaa:name" /><xsl:text>=""</xsl:text></xsl:if>
		</xsl:for-each>
&lt;og:<xsl:value-of select="aaa:name" />
		<xsl:for-each select="aaa:attribute">
<xsl:text> </xsl:text><xsl:value-of select="aaa:name" />
		</xsl:for-each>
	<xsl:variable name="bodyCtxt" select="aaa:body-content"/>
	<xsl:if test="$bodyCtxt='JSP'"  >
&lt;/og:<xsl:value-of select="aaa:name" />&gt;</xsl:if></xsl:for-each>

	<xsl:for-each select="//aaa:attribute">
	<xsl:sort select="aaa:name" lang="ja" data-type="text" order="ascending" />
	<xsl:if test="not(aaa:name=preceding::aaa:attribute/aaa:name)">
<xsl:text>
</xsl:text><xsl:value-of select="aaa:name" /><xsl:text>=""</xsl:text>
	</xsl:if>
	</xsl:for-each>

</xsl:template>

</xsl:stylesheet>
