Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLxsl display time error?  xsl display time error?
Previous
 
Next
New Post
7/2/2009 5:02 AM
 

Hello,

My xsl coding is:

<xsl:value-of select="concat(substring(pubDate,6,2),' ',substring(pubDate,9,4),', ',substring(pubDate,18,14))" />
Display: 30 Jun , 06:35:07 +0800

but i want to display is: 30 Jun , 14:35:07

 

Why will have the above situation?
And how to solve this problem??

 
New Post
7/2/2009 5:13 AM
 

Can you please also post the XML for the pubDate note?

 
New Post
7/3/2009 6:37 AM
 

To Stefan Cullmann,

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="/">
<style media="all" lang="en" type="text/css">
</style>

 <div>
  <xsl:apply-templates select="rss/channel"/>
 </div> 
</xsl:template>

<xsl:template match="rss/channel">
<xsl:variable name="link" select="link"/>
  <xsl:variable name="description" select="description"/>
  <xsl:variable name="image" select="image/url"/>
  <xsl:variable name="idesc" select="image/description"/>
  <xsl:variable name="ilink" select="image/link"/>
  <xsl:variable name="iwide" select="image/width"/>
  <xsl:variable name="ihigh" select="image/height"/>

<div class="rssChannel">
 <xsl:if test="$image">
    <a href="{$ilink}" title="{$idesc}"><xsl:value-of select="ilink" /></a>
    <img src="{$image}" height="{$ihigh}" width="{$iwide}" style="float: left; margin: 2px; border: 0px;"/>
 </xsl:if>
 </div>

<div class="rssChannelDescription">
<xsl:call-template name="strip_HTML">
    <xsl:with-param name="value" select="substring(description,1,300)" />
</xsl:call-template></div>

<xsl:apply-templates select="item"/>

</xsl:template>

<xsl:template match="item">
<xsl:if test="position() &lt; 6">


  <xsl:variable name="item_link" select="link"/>
  <xsl:variable name="item_title" select="description"/>
  <div class="rssItemTitle">
    <a href="{$item_link}" title="{$item_title}" target="_blank"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
</div>
<div class="rssItemPubDate">


<xsl:value-of select="concat(substring(pubDate,6,2),' ',substring(pubDate,9,4),', ',substring(pubDate,18,14))" />

<!--
<xsl:value-of select="pubDate"/>
-->


</div>
<div class="rssItemDescription">
<xsl:call-template name="strip_HTML">
    <xsl:with-param name="value" select="substring(description,1,300)" />
</xsl:call-template>
<xsl:text>...</xsl:text>
</div>
<hr/>
</xsl:if>
</xsl:template>

<xsl:template name="strip_HTML">
<xsl:param name="value"/>
<xsl:choose>
 <xsl:when test="contains($value,'&lt;')">
  <xsl:value-of select="substring-before($value,'&lt;')" disable-output-escaping="yes"/>
  <xsl:choose>
   <xsl:when test="contains(substring-after($value,'&lt;'),'&gt;')">
    <xsl:call-template name="strip_HTML">
    <xsl:with-param name="value"><xsl:value-of select="substring-after($value,'&gt;')"/></xsl:with-param>
    </xsl:call-template>
   </xsl:when>
  <xsl:otherwise>
  </xsl:otherwise>
  </xsl:choose>
 </xsl:when>
<xsl:otherwise>
 <xsl:value-of select="$value" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>

</xsl:template>

</xsl:stylesheet>

 

 
New Post
7/3/2009 7:46 AM
 

Andrew,

I asked for the source, not the stylesheet.

 
New Post
7/6/2009 1:52 PM
 

Hi Stefan Cullmann,

This xsl post is the source file, how to modify this xsl source??

thanks a lot~

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLxsl display time error?  xsl display time error?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out