Laman Utama Tanya Wiki English Artikel Komuniti E-Mel Ringtones Search

Bantuan | Carian | Ahli | Kalendar

Google

Selamat Datang ( Log In | Daftar )

 
Reply to this topicStart new topic
Xslt Datetime, tlg fix kan code ni pd yg expert
cikdayah
post May 9 2008, 05:49 PM
Kiriman #1


Ahli
***

Grup: Members
Kiriman: 168
Penyertaan: 4-February 08
Dari: melaka
Ahli ke- 42,253



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:datetime="http://exslt.org/dates-and-times" version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="salesLead/serviceRequests/serviceRequest">
<xsl:if test="country='SG'">
<xsl:text>Suspect_CSFAISL</xsl:text>
<xsl:value-of select="normalize-space(country)"/>
<xsl:value-of select="normalize-space(@referenceNumber)"/>_<xsl:text/>
<xsl:value-of select="normalize-space(substring(datetime:dateTime(),3,2))"/>
<xsl:value-of select="normalize-space(substring(datetime:dateTime(),6,2))"/>
<xsl:value-of select="normalize-space(substring(datetime:dateTime(),9,2))"/>|<xsl:text/><!-- sr no1-->


code kat atas tu aku wat utk simulate issue bcoz diaorg nak result kuar as this:

Suspect_CSFAISLSG58675 YYMMDD

prob is error coz die link kat website ni http://exslt.org/dates-and-times

de x cara len utk solve selain dr link from dat website


--------------------
mekanikal + programming=cikdayah
Go to the top of the page
 
+Quote Post
Firestarter
post May 10 2008, 10:40 AM
Kiriman #2


Ahli Rajin
****

Grup: Members
Kiriman: 728
Penyertaan: 2-December 06
Dari: Paka ke Dungun
Ahli ke- 21,529



Cuba ko refer kat bawah tu:

http://www.w3schools.com/Xpath/xpath_functions.asp
http://www.exslt.org/date/date.html
http://xsltsl.sourceforge.net/date-time.html


--------------------
Java Specialist Programmer
programming+bisnes logic=headche
Go to the top of the page
 
+Quote Post
cikdayah
post May 16 2008, 10:07 AM
Kiriman #3


Ahli
***

Grup: Members
Kiriman: 168
Penyertaan: 4-February 08
Dari: melaka
Ahli ke- 42,253



alhamdulilah settle da..ni solutionnya...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="java.util.Date"
xmlns:dateFormat="java.text.SimpleDateFormat"
exclude-result-prefixes="date dateFormat"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="salesLead/serviceRequests/serviceRequest">
<xsl:if test="country='SG'">
<xsl:text>Suspect_CSFAISL</xsl:text>
<xsl:value-of select="normalize-space(country)"/>
<xsl:value-of select="normalize-space(@referenceNumber)"/>_<xsl:text/>
<xsl:value-of select="normalize-space(dateFormat:format(dateFormat:new('yyMMdd'),date:new()))"/>|<xsl:text/><!-- sr no1-->
<xsl:value-of select="normalize-space(companyName)"/>|<xsl:text/><!--2-->
<xsl:value-of select="normalize-space(salesTerryCd)"/>|<xsl:text/><!--3-->


--------------------
mekanikal + programming=cikdayah
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

RSS Lo-Fi Version Time is now: 7th October 2008 - 08:35 PM

© 1998-2008 Khazanah Maya Computer Systems