Subject: Re: [xsl] variable question From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Tue, 31 Aug 2004 07:15:01 -0400 |
However teh system doesn't agree with you, there's no point in asking us to guess, just find out what it is:
<xsl:function name="mods:reftype" as="xs:string"> <xsl:param name="bibref" as="element(mods:mods)" /> <xsl:choose> <xsl:when test="$bibref/mods:relatedItem/@type = 'host'"> <xsl:variable name="issuance"
select="$bibref/mods: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>
Now, if I use this template, it runs through and I get the correct output:
<xsl:template match="mods:titleInfo" mode="title-before"> <xsl:choose> <xsl:when test="not(parent::mods:mods)"> <xsl:message> parent is [[<xsl:value-of select="name(..)"/>]] </xsl:message> </xsl:when> <xsl:otherwise> <xsl:if test="mods:reftype(parent::mods:mods) = 'chapter'"> <xsl:text></xsl:text> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template>
<xsl:template match="mods:titleInfo" mode="title-before"> <xsl:if test="mods:reftype(parent::mods:mods) = 'chapter'"> <xsl:text></xsl:text> </xsl:if> </xsl:template>
An empty sequence is not allowed as the first argument of mods:reftype() Transformation failed: Run-time errors were reported
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] variable question, David Carlisle | Thread | Re: [xsl] variable question, David Carlisle |
Re: [xsl] collapsing number ranges, Bruce D'Arcus | Date | Re: [xsl] variable question, David Carlisle |
Month |