layoutLabels.xsl 1.06 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:php="http://php.net/xsl"
    extension-element-prefixes="php"
    exclude-result-prefixes="xsl php">

    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:variable name="schemaPath" select="'https://raw.github.com/magento/magento2/master/app/code/Mage/Core/etc/layouts.xsd'"/>

    <!-- Copy nodes -->
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <!-- Transfer handle labels into attributes -->
    <xsl:template match="*[name(..)='layout' and  ./label]">
        <xsl:element name="{name(.)}">
            <xsl:attribute name="label">
                <xsl:value-of select="./label"/>
            </xsl:attribute>
            <xsl:apply-templates select="*[name()!='label']|@*[name()!='translate']"/>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>