Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / html5 / microdata.xsl @ 187

History | View | Annotate | Download (1.1 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet 
3
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4
    version="2.0"
5
    xpath-default-namespace="http://www.tei-c.org/ns/1.0">
6

    
7
  <xsl:template name="microdata">
8
    <xsl:choose>
9
      <xsl:when test="self::p"/>
10
      <xsl:when test="starts-with(local-name(),'div')">
11
	<xsl:attribute name="itemscope">itemscope</xsl:attribute>
12
	<xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
13
      </xsl:when>
14
      <xsl:when test="self::docDate|self::date">
15
	<xsl:attribute name="itemprop">date</xsl:attribute>
16
      </xsl:when>
17
      <xsl:otherwise>
18
	<xsl:attribute name="itemprop" select="local-name()"/>
19
      </xsl:otherwise>
20
    </xsl:choose>
21
    <xsl:if test="@when">
22
      <xsl:attribute name="data-when">
23
	<xsl:value-of select="@when"/>
24
      </xsl:attribute>
25
    </xsl:if>
26
  </xsl:template>
27

    
28
  <xsl:template name="bodyMicroData">
29
    <xsl:attribute name="itemscope">itemscope</xsl:attribute>
30
    <xsl:attribute name="itemtype">http://www.tei-c.org/ns/1.0/</xsl:attribute>
31
    <xsl:attribute name="itemprop">TEI</xsl:attribute>
32
  </xsl:template>
33

    
34
</xsl:stylesheet>