resource/alternative may have optional @title

This commit is contained in:
Astro 2011-10-05 22:46:03 +02:00
parent 2679c0ee9a
commit 2456a8eada
2 changed files with 7 additions and 1 deletions

View File

@ -70,6 +70,7 @@
</xs:element>
<xs:element name="alternative">
<xs:complexType>
<xs:attribute name="title" type="xs:string" use="optional"/>
<xs:attribute name="size" type="xs:nonNegativeInteger"
use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>

View File

@ -343,7 +343,12 @@
<xsl:template match="resource/alternative" mode="resources-in-news">
<xsl:call-template name="resource-item">
<xsl:with-param name="title" select="../@title"/>
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="../@title"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>