Home
TeamSite
How to map Date datum type in XSL
nishant
Hi
I have written the code in Content XML as follows:-
Now i have to show this value in my HTML page by writing the code in appearance XSL as follows:-
But it is not showing the selected date.
Can anybody help regarding this.
Find more posts tagged with
Comments
dazzlad
I think your post is missing example code. Maybe re-post them?
tec_iwov
you need to escape your xml/xsl or attach the files
Migrateduser
Perhaps you've already finished it. Yet, I just post mine for your reference:
Content XML
<Data> <Datum ID="HEADLINE" Name="Headline" Type="String">Headline</Datum> <Datum ID="DATE" Name="Release Date" Type="Date"> <Date Month="1" Day="1" Year="2008" DayOfWeek="2" ShowTime="false" Hour="12" Minute="0" AMPM="AM"/> </Datum> ...
Appearance XSL
<xsl:template match="/"> <!-- BEGIN summary --> <p class="summary"><xsl:apply-templates select="/Properties/Data/Datum[
@Name=
'Release Date']/Date"/></p> <!-- END summary --> </xsl:template> <xsl:template match="Date"> <!-- new date format 1 January 2008 --> <xsl:value-of select="
@Day"/>
; <xsl:choose> <xsl:when test="
@Month
= '1'">January</xsl:when> <xsl:when test="
@Month
= '2'">February</xsl:when> <xsl:when test="
@Month
= '3'">March</xsl:when> <xsl:when test="
@Month
= '4'">April</xsl:when> <xsl:when test="
@Month
= '5'">May</xsl:when> <xsl:when test="
@Month
= '6'">June</xsl:when> <xsl:when test="
@Month
= '7'">July</xsl:when> <xsl:when test="
@Month
= '8'">August</xsl:when> <xsl:when test="
@Month
= '9'">September</xsl:when> <xsl:when test="
@Month
= '10'">October</xsl:when> <xsl:when test="
@Month
= '11'">November</xsl:when> <xsl:when test="
@Month
= '12'">December</xsl:when> </xsl:choose> <xsl:value-of select="
@Year"/>
; </xsl:template>