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

RE: xsl:choose / xsl:when problems

Subject: RE: xsl:choose / xsl:when problems
From: "Diamond, Jason" <Jason.Diamond@xxxxxxx>
Date: Wed, 21 Feb 2001 12:13:05 -0600
xsl choose xsl when test
Your XML isn't well-formed. Remove the slash from the start tag of all your
xsl:when elements. Those are only needed when the element has no content
(like your xsl:value-of elements).

So,

    <xsl:when test="substring(@DateReceived,6,2) = '01'"/>January</xsl:when>

should become:

    <xsl:when test="substring(@DateReceived,6,2) = '01'">January</xsl:when>

You've also got a </font> end tag in there with no corresponding start tag.

Hope this helps,
Jason.

-----Original Message-----
From: Wayne Davis [mailto:quietman@xxxxxxxx]
Sent: Wednesday, February 21, 2001 10:03 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  xsl:choose / xsl:when problems


Hi...
I'm trying to come up with a solution (this hack is the best I seem capable
of at the moment) to converting
a date in the following format "YYYY-MM-DDTHH:NN:SS" to MMM dd, yyyy".

<TD>
<xsl:choose>
    <xsl:when test="substring(@DateReceived,6,2) = '01'"/>January</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) =
'02'"/>February</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '03'"/>March</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '04'"/>April</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '05'"/>May</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '06'"/>June</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '07'"/>July</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '08'"/>August</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) =
'09'"/>September</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) = '10'"/>October</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) =
'11'"/>November</xsl:when>
    <xsl:when test="substring(@DateReceived,6,2) =
'12'"/>December</xsl:when>
 </xsl:choose>
   <xsl:value-of select='substring(@DateReceived,9,2)'/> /
   <xsl:value-of select='substring(@DateReceived,1,4)'/></font>
</TD>

I'm getting this error message:
***End tag 'xsl:when' does not match the start tag 'xsl:choose'. ***
Can someone see where I'm off track here? I've tried bracketing the test
statement in a variety of ways and always get the same result.

TIA

Wayne Davis



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.