I have this XSL file:
< ?xml version="1.0" encoding="utf-8"?>
< xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl script" xmlns:script="script">
< msxsl:script implements-prefix="script" language="C#">
< ![CDATA[
public string formatDate(string sDate)
{
string sRetval = "";
try
{
System.IFormatProvider format = new System.Globalization.CultureInfo(sSourceCulture);
System.IFormatProvider format2 = new System.Globalization.CultureInfo(sTargetCulture);
DateTime dDate = DateTime.Parse(sDate, format);
sRetval = dDate.ToString(sFormat, format2);
}
catch {}
return sRetval;
}
]] >
< / msxsl:script>
< xsl:template match="/">
< ?xsl:if test="count(//item) > 0">
<br />
<div id="ForumsBox" class="NoTabBox300">
<h2>forum</h2>
<div class="NoTabBoxContent">
<ul class="Article">
<xsl:apply-templates select="//item" />
</ul>
</div>
</div>
</xsl:if>
< /xsl:template>
< xsl:template match="item">
< xsl:if test="position() <= 5">
<li>
< xsl:value-of select="script:formatDate(pubDate)" />
< xsl:text disable-output-escaping="yes"> </xsl:text>
...
< /xsl:template>
</ xsl:stylesheet>
There is a C# function define in CDATA section. Does php support something similar?