Subject: Re: [xsl] variable question From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Sun, 29 Aug 2004 19:35:00 -0400 |
For XSLT 2.0, I think I'd turn the reftype template into a function instead, since it just returns a string. I'd keep the title-before template as a template since it might return some XML when you revise it in the future. So it would look more like:
<xsl:template match="mods:titleInfo[not(@type='abbreviated')]" mode="bibliography"> <span class="{if (../mods:relatedItem[@type = 'host']) then 'title' else 'title italic'}"> <xsl:apply-templates select="." mode="title-before"/> <xsl:apply-templates select="mods:title"/> <xsl:apply-templates select="mods:subTitle"/> <xsl:apply-templates select="." mode="title-after"/> </span> </xsl:template>
<xsl:template match="mods:titleInfo" mode="title-before"> <xsl:if test="mods:reftype(parent::mods:relatedItem) = 'chapter'"> <xsl:text>"</xsl:text> </xsl:if> </xsl:template>
<xsl:function name="mods:reftype" as="xs:string"> <xsl:param name="relatedItem" as="element(mods:relatedItem)" /> <xsl:choose> <xsl:when test="$relatedItem/@type = 'host'"> <xsl:variable name="issuance" as="xs:string" select="$relatedItem/mods:originInfo/mods:issuance" /> <xsl:choose> <xsl:when test="$issuance = 'continuing'">article</xsl:when> <xsl:when test="$issuance = 'monographic'">chapter</xsl:when> </xsl:choose> </xsl:when> <xsl:otherwise>book</xsl:otherwise> </xsl:choose> </xsl:function>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] variable question, Jeni Tennison | Thread | Re: [xsl] variable question, Bruce D'Arcus |
Re: [xsl] collapsing number ranges, Bruce D'Arcus | Date | [xsl] Trying to display Summed Aver, Mr D Lisi |
Month |