added video etc. excplicitly to XSL

This commit is contained in:
vv01f 2017-05-10 04:39:32 +02:00
parent 0ff1d7d15a
commit 92c7143266
2 changed files with 240 additions and 201 deletions

View File

@ -104,6 +104,10 @@
<xs:element ref="form" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="iframe" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="video" xmlns="http://www.w3.org/1999/xhtml"/>
<xs:element ref="picture"/>
<xs:element ref="image"/>
<xs:element ref="figure"/>
<xs:element ref="figcaption"/>
<xs:element ref="include-frab-schedule"/>
<xs:element ref="resource"/>
</xs:choice>
@ -121,7 +125,6 @@
<xs:element ref="link"/>
<xs:element ref="em"/>
<xs:element ref="strong"/>
<xs:element ref="image"/>
<xs:element ref="code"/>
<xs:element ref="sup"/>
</xs:choice>
@ -173,6 +176,15 @@
<xs:element name="code" type="xs:string"/>
<xs:element name="figure">
<xs:choice minOccurs="1">
<xs:element ref="figcaption" maxOccurs="1"/>
<xs:element ref="picture" maxOccurs="1"/>
<xs:element ref="video" maxOccurs="1"/>
</xs:choice>
</xs:element>
<xs:element name="figcaption" type="Block"/>
<xs:element name="sup">
<xs:complexType mixed="true">
<xs:group ref="Inline.class" minOccurs="0"

View File

@ -179,6 +179,23 @@
<blockquote><xsl:call-template name="auto-id"/><xsl:apply-templates/></blockquote>
</xsl:template>
<xsl:template match="source">
<source>
<xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
</source>
</xsl:template>
<xsl:template match="video">
<video>
<xsl:if test="@type='loop'">
<xsl:attribute name="loop"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="autoplay">autoplay</xsl:attribute>
<xsl:attribute name="muted">muted</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</video>
</xsl:template>
<!-- Bilder in News-Einträgen haben Pfad immer relativ zu /images/news/ -->
<xsl:template match="image">
<xsl:variable name="path">
@ -291,6 +308,16 @@
<xsl:apply-templates/>
</sup>
</xsl:template>
<xsl:template match="figure">
<figure>
<xsl:apply-templates/>
</figure>
</xsl:template>
<xsl:template match="figcaption">
<figcaption>
<xsl:apply-templates/>
</figcaption>
</xsl:template>
<xsl:template match="xhtml:*"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
@ -656,19 +683,19 @@
<xsl:choose>
<xsl:when test="$value &gt; 1024 * 1024 * 1024">
<xsl:value-of select="format-number($value div (1024 * 1024 * 1024), '0.0')"/>
<xsl:text> GB</xsl:text>
<xsl:text> GiB</xsl:text>
</xsl:when>
<xsl:when test="$value &gt; 1024 * 1024">
<xsl:value-of select="format-number($value div (1024 * 1024), '0.0')"/>
<xsl:text> MB</xsl:text>
<xsl:text> MiB</xsl:text>
</xsl:when>
<xsl:when test="$value &gt; 1024">
<xsl:value-of select="format-number($value div (1024), '0.0')"/>
<xsl:text> KB</xsl:text>
<xsl:text> KiB</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
<xsl:text> Bytes</xsl:text>
<xsl:text> Byte</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>