Solved

Formatting dates in XSL

Posted on 2012-04-11
2
293 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
c# advanced xml like string split - Help needed 15 73
Mongodb hierarchy 2 47
C# SQL BULK INSERT CLASS 5 46
ASP.NET reading ATOM 2 51
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now