[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: variable question

Subject: RE: variable question
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 29 Aug 2004 15:33:32 +0100
RE:  variable question
> 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[@type='host']]">
>        <xsl:text>book</xsl:text>
>      </xsl:when>
>      <xsl:when
>
> test="mods:relatedItem[@type='host']/mods:originInfo/mods:
> issuance='continuing'">
>        <xsl:text>article</xsl:text>
>      </xsl:when>
>      <xsl:when
>
> test="mods:relatedItem[@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>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.