Solved

Formatting dates in XSL

Posted on 2012-04-11
2
305 Views
Last Modified: 2012-06-27
I am currently transforming XML into an HTML table using XSL.

The XML file is a collection of 'Roads' - which I am rendering out to a table.

XML: http://sandbox5.project4.net/date/roads_locs.xml
XSL: http://sandbox5.project4.net/date/roads.xsl
HTML Output: http://sandbox5.project4.net/date/default.asp

You may note in the XSL that I have a couple of date properties for each <road> element, these are <observed> and <updated>

The format for these dates is <observed>mm/dd/yyyy h:m:s PM or PM</observed>

Question: What options are available using XSL to format these dates differently?
0
Comment
Question by:sonic1234
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
yawkey13 earned 500 total points
ID: 37835855
Here is a good date format function.  It's a few years old, but works.  

http://geekswithblogs.net/workdog/archive/2007/02/08/105858.aspx

There might be newer built in methods, but I haven't used XSL in a while.
0
 

Author Comment

by:sonic1234
ID: 37835867
Thanks, looks like the smartest method might be to simply create a number of different formatted date items in the XML rather than trying to format it using XSL
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question