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

RE: Date Format in XSLT

Subject: RE: Date Format in XSLT
From: "Stenson, Bob" <Bob.Stenson@xxxxxxxxxxxxxxx>
Date: Thu, 4 Sep 2003 08:09:35 -0500
xsl date format
Here is a piece of code that is working to do the same thing, but for a
different purpose:

	<tr>
		<td>Housing Type*</td>
		<td colspan="3" align="center">
			<xsl:choose>
			  <xsl:when test="@HousingTypeId='4'">

			 <nobr>Single family house<input type="checkbox"
/></nobr>
			 <nobr>Mobile Home<input type="checkbox" /></nobr>
			 <nobr>2 to 4 Unit<input type="checkbox" /></nobr>
			 <nobr>Apartment (5+)<input type="checkbox"
checked="checked" /></nobr>
			  </xsl:when>
			  <xsl:when test="@HousingTypeId='3'">		
			 <nobr>Single family house<input type="checkbox"
/></nobr>
			 <nobr>Mobile Home<input type="checkbox" /></nobr>
			 <nobr>2 to 4 Unit<input type="checkbox"
checked="checked" /></nobr>
			 <nobr>Apartment (5+)<input type="checkbox"
/></nobr>
			  </xsl:when>
			  <xsl:when test="@HousingTypeId='2'">		
			 <nobr>Single family house<input type="checkbox"
/></nobr>
			 <nobr>Mobile Home<input type="checkbox"
checked="checked" /></nobr>
			 <nobr>2 to 4 Unit<input type="checkbox" /></nobr>
			 <nobr>Apartment (5+)<input type="checkbox"
/></nobr>
			  </xsl:when>
			  <xsl:when test="@HousingTypeId='1'">	
			 <nobr>Single family house<input type="checkbox"
checked="checked" /></nobr>
			 <nobr>Mobile Home<input type="checkbox" /></nobr>
			 <nobr>2 to 4 Unit<input type="checkbox" /></nobr>
			 <nobr>Apartment (5+)<input type="checkbox"
/></nobr>
			  </xsl:when>
			  <xsl:otherwise>		
			 <nobr>Single family house<input type="checkbox"
/></nobr>
			 <nobr>Mobile Home<input type="checkbox" /></nobr>
			 <nobr>2 to 4 Unit<input type="checkbox" /></nobr>
			 <nobr>Apartment (5+)<input type="checkbox"
/></nobr>
			  </xsl:otherwise>	
			</xsl:choose>
		</td>
	</tr>

Just modify it like so:

	<tr>
		<td>Housing Type*</td>
		<td colspan="3" align="center">
			<xsl:choose>
			  <xsl:when test="@Month='1'"> 
				January
			  </xsl:when>
			  <xsl:when test="@HousingTypeId='2'">
				February
			  </xsl:when>
				and so forth.

 
Service with a smile,
 
Bob Stenson 
System Development Specialist 
Office of Computer Services 
Division of Administration, State of Wisconsin 
101 E. Wilson Street, 9th Floor 
PO Box 7864 
Madison, WI 53707-7864 
608-266-0178 
 
It's amazing how opinionated we can become 
concerning issues about which we know little, 
or even nothing at all.
 
"In theory, there isn't any difference between theory and practice. 

In practice, there is." 

Yogi Berra



-----Original Message-----
From: michel geadah [mailto:m_ace_g@xxxxxxxxxxx]
Sent: Thursday, September 04, 2003 7:47 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Date Format in XSLT


hi,

I need to transform the month to words.
For example, if i have '1' i need to output 'Jan', if i have '2' i need to 
output 'Feb', and so on...
(That is to say if i have 1-12-2003 i need it to be transformed to 
1-Dec-2003)

Thanks...
Michel

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


 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.