html2xhtml3.xsl 1.25 KB
Newer Older
1 2 3 4 5 6
<?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"/>
    
qaomia's avatar
qaomia committed
7
    <xsl:template match="p[child::ul or child::ol]" priority="1">
8 9 10 11 12 13 14
        
      <xsl:apply-templates select="./ul"/>
      <xsl:apply-templates select="./ol"/>
      <p>
          <xsl:apply-templates select="./node()[not(self::ul) and not(self::ol)]"/>
      </p>
      
qaomia's avatar
qaomia committed
15 16
    </xsl:template>
    
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    <xsl:template match="//ul[parent::ul or parent::ol]" priority="1">
        <li>
            <ul>
                <xsl:apply-templates select="*"/>
            </ul>
        </li>
    </xsl:template>
    <xsl:template match="//ol[parent::ul or parent::ol]" priority="1">
        <li>
            <ol>
                <xsl:apply-templates select="*"/>
            </ol>
        </li>
    </xsl:template>
    
32 33 34 35 36 37 38
    <!--Identity template, 
        provides default behavior that copies all content into the output -->
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
qaomia's avatar
qaomia committed
39
     
40
</xsl:stylesheet>