how to format date using xlst?

Trying to convert date to specific format but getting error:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.openapplications.org/oagis/9"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xsl:variable name="origDate" select="row[@num='6']/cell[@num='2']"/>
<PromisedDeliveryDateTime><xsl:value-of select="format-date(xs:date($origDate), '[Y] [M] [D]')" /></PromisedDeliveryDateTime>

error:

Failed to transform XQMessage part, index=0 (Invalid date "30.11.2011" (Non-numeric component)

Answers


The xs:date() constructor function expects a string in ISO date format: 2011-11-30. To manipulate dates in other formats you first need to convert them to ISO format, which you can do for example as

string-join(reverse(tokenize($in, '.')), '-')

Need Your Help

Python/Scrapy: Scraping Nasdaq's data?

javascript python selenium scrapy scrape

I am comfortable scraping most sites with Scrapy, however I have never tried getting dynamic content from javascript and I am running into a lot of arguments in regard to how to start learning.

8086 assembly - divide overflow

assembly x86 8086

I try to make a simple division in assembly but I get "Divide overflow" error.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.