Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: DateFormatting, date is taken from MS SQL

$
0
0
Dinariys wrote:
This option is tried, there is an error "Error when calling the extension function "Format". Detailed description of the error, see. In InnerException. - The string "" is not valid AllXsd."
<td><xsl:value-of select="df:Format(ReplDateGood, 'dd MM yyyy')"/></td>
Some of the input data is missing "ReplDateGood" child element, that's why you're seeing this exception.
<Table>
                   <ID>8784</ID>
                   <Client>SoftService</Client>
                    <NamePub>RedCupZSChelyabinsk_pub</NamePub>
                    <NameSub>unit143</NameSub>
                    <ReplGood>0</ReplGood>
                    <ReplBad>171</ReplBad>
                    <ReplDateBad>2014-09-09T14:07:00+04:00</ReplDateBad>
                </Table>
Workaroud would be to have an <xsl:if /> declaration:
<td>
  <xsl:if test="ReplDateGood">
     <xsl:value-of select="df:Format(ReplDateGood, 'dd MM yyyy')"/>
   </xsl:if>
</td>
We recommend using Razor functions http://docs.composite.net/Functions/Razor
Razor syntax is both less verbose, and much easier to start with compare to XSL.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>