Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xsl date format issue

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 7/8/2007 1:30:00 PM

kamkaro wrote:
> Thanks Martin. I have to say, you have very strong knowledge about XML. i 
> have two more questions, first i m using Java base parser so can i use 
> Microsoft stuff, second according to your reply you give me the following 
> code;
> <xsl:value-of
>      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>      select="msxsl:format-date('2001-03-06', 'MMMM dd, yyyy', 'en-US')"/>
> 
> how do i call the date element's data, e.g i m doing 
> <xsl:template match="Date">
>    <xsl:value-of select="." />
> </xsl:template>

An XSLT processor implemented in Java does very likely not implement 
those MS specific extension functions my suggested solution uses. It 
might offer other extension functions, in particular the possibility to 
use Java objects and methods but I am not familiar with that. Try a 
forum/newsgroup/mailing list dedicated to that XSLT processor you use.

As for the template, you would simply use

<xsl:template match="Date">
    <xsl:value-of
      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      select="msxsl:format-date(., 'MMMM dd, yyyy', 'en-US')"/>
</xsl:template>

assuming Date has contents in the form yyyy-mm-dd and you are using 
MSXML 4 or later or XslCompiledTransform.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent