XSL Test attribut
-
Hallo,
wie kann ich in XSL abfragen, oder die Datei mit ".3gp" endet ?
Bevor ich das mache
<xsl:template match="ref|animation|video|textstream"> <xsl:element name="t:{name()}" > <xsl:attribute name="class">time</xsl:attribute> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="@transIn" mode="post"/> <xsl:apply-templates/> </xsl:element> </xsl:template
Würde ich gerne testen, ob das video eine 3gp datei ist....
kann mir da jmd weiter helfen ?
-
Hier ist die Lösung
<xsl:choose> <xsl:when test="substring-after(@src,'.')='3gp'"> </xsl:when> <xsl:otherwise> <xsl:element name="t:{name()}" > <xsl:attribute name="class">time</xsl:attribute> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="@transIn" mode="post"/> <xsl:apply-templates/> </xsl:element> </xsl:otherwise> </xsl:choose>