xhtml2hdoc.xsl 1.5 KB
Newer Older
Etienne Chognard's avatar
Etienne Chognard 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
    xmlns="http://www.utc.fr/ics/hdoc/xhtml" version="2.0">
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="html" priority="3">
        <html>
            <head>
                <title>
                    <xsl:value-of select="/html/head/title"/>
                </title>
                <meta charset="utf-8"/>
            </head>
            <body>
                <section>
                    <header>
                        <h1>Contenu</h1>
                    </header>
                    <xsl:apply-templates select="/html/body/div"/>
                </section>
            </body>
        </html>
    </xsl:template>
    
    <xsl:template match="li" priority = "2">
        <li><p><xsl:apply-templates select="@* | node()"/></p></li>
    </xsl:template>


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

    <!-- Namespace substitution for hdoc elements -->                        
    <xsl:template match="*" priority="1">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="node()|@*"/>
        </xsl:element>
    </xsl:template> 

</xsl:stylesheet>