|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: variable question
On Aug 31, 2004, at 6:03 AM, David Carlisle wrote:
However teh system doesn't agree with you, there's no point in asking us to guess, just find out what it is: It reported a number of these messages: parent is [[mods]] The output was incorrect, though, so I modified the function like so: <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>However, if I use this instead: <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>.... I get this error: An empty sequence is not allowed as the first argument of mods:reftype() Transformation failed: Run-time errors were reported ??? Bruce
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








