xsl-list
[Top] [All Lists]

RE: variable question

2004-08-29 07:33:32
Is there some obvious reason why the "title-before" variable below  
doesn't work when called from within a template?

By "doesn't work" I assume you mean "has a different effect from what I
expect", but you haven't said what you expect the effect to be.

The most likely cause is that at the point you declare the variable reftype,
the context node does not have a mods:related item child. But you haven't
given any information about the context.

Michael Kay


I'm not sure if the problem is that there's something wrong with the  
way I'm trying to use variables, or something about the 
context and the  
xpath expressions (my guess is the latter).

Bruce

<xsl:variable name="reftype">
   <xsl:choose>
     <xsl:when test="not[mods:relatedItem[(_at_)type='host']]">
       <xsl:text>book</xsl:text>
     </xsl:when>
     <xsl:when
       
test="mods:relatedItem[(_at_)type='host']/mods:originInfo/mods: 
issuance='continuing'">
       <xsl:text>article</xsl:text>
     </xsl:when>
     <xsl:when
       
test="mods:relatedItem[(_at_)type='host']/mods:originInfo/mods: 
issuance='monographic'">
       <xsl:text>chapter</xsl:text>
     </xsl:when>
   </xsl:choose>
</xsl:variable>

<xsl:variable name="title-before">
   <xsl:choose>
     <xsl:when test="$reftype='chapter'">
       <xsl:text>"</xsl:text>
     </xsl:when>
     <xsl:otherwise>
       <xsl:text></xsl:text>
     </xsl:otherwise>
   </xsl:choose>
</xsl:variable>

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>