<?xml version="1.0" ?>
<!-- 
xslt_localizer - Create localized versions of XSLT Templates
Copyright (C) 2004 Jeroen Pulles

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->
<xsl:stylesheet version="1.0"
        xmlns:mc="http://www.redslider.net/ns/messagecatalog.1.0"
        xmlns:a="http://www.w3.org/1999/XSL/TransformAlias"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="lang">en</xsl:param>
<xsl:namespace-alias stylesheet-prefix="a" result-prefix="xsl" />
<xsl:output indent="yes" method="xml" media-type="text/xml" />
<xsl:strip-space elements="mc:label " />


<xsl:template match="/">
    <a:stylesheet version="1.0" 
            xmlns="http://www.redslider.net/ns/messagecatalog.1.0">
        <!--
        <xsl:attribute name="xmlns:xsl">
            <xsl:text>http://www.w3.org/1999/XSL/Transform</xsl:text>
        </xsl:attribute>
        -->
        <xsl:comment>
        This XSL is created from the chosen language and the messagecatalog 
        in that language.
        </xsl:comment>
        
        <a:param name="lang">
            <xsl:value-of select="$lang"/>
        </a:param>
        
        <xsl:apply-templates/>

        <a:template match="mc:gettext">
            <a:element name="text"
                       namespace="http://www.w3.org/1999/XSL/Transform">
                <a:value-of select="@key"/>
            </a:element>
        </a:template>

        <a:template match="node() | @*" priority="-5">
            <a:copy>
                <a:apply-templates select="node() | @*"/>
            </a:copy>
        </a:template>

    </a:stylesheet>
</xsl:template>


<xsl:template match="mc:message">
    <a:template>
        <xsl:attribute name="match">
            <xsl:text>mc:gettext[@key='</xsl:text>
            <xsl:value-of select="mc:key/text()"/>
            <xsl:text>']</xsl:text>
        </xsl:attribute>
        <a:element name="text"
                   namespace="http://www.w3.org/1999/XSL/Transform">
            <xsl:value-of select="mc:value/text()"/>
        </a:element>
    </a:template>

    <a:template>
        <xsl:attribute name="match">
            <xsl:text>mc:label[text()='</xsl:text>
            <xsl:value-of select="mc:key/text()"/>
            <xsl:text>']</xsl:text>
        </xsl:attribute>
        <a:element name="text"
                   namespace="http://www.w3.org/1999/XSL/Transform">
            <xsl:value-of select="mc:value/text()"/>
        </a:element>
    </a:template>
</xsl:template>


</xsl:stylesheet>

