Você está na página 1de 6

<xsl:stylesheet xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ddw1="http://schemas.microsoft.com/sharepoint/soap/" xmlns:rs="urn:schemas-microsoftcom:rowset" xmlns:z="#RowsetSchema" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.

WebControls" xmlns:ddwrt2="urn:frontpage:internal"> <xsl:output method="html" indent="no"/> <xsl:decimal-format NaN=""/> <xsl:param name="dvt_apos">&apos;</xsl:param> <xsl:param name="ManualRefresh"></xsl:param> <xsl:variable name="dvt_1_automode">0</xsl:variable>

<xsl:template match="/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ddw1="http://schemas.microsoft.com/sharepoint/soap/" xmlns:rs="urn:schemas-microsoftcom:rowset" xmlns:z="#RowsetSchema" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls"> <xsl:choose> <xsl:when test="($ManualRefresh = 'True')"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <xsl:call-template name="dvt_1"/> </td> <td width="1%" class="ms-vb" valign="top"> <img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/> </td> </tr>

</table> </xsl:when> <xsl:otherwise> <xsl:call-template name="dvt_1"/> </xsl:otherwise> </xsl:choose> </xsl:template>

<xsl:template name="dvt_1"> <xsl:variable name="dvt_StyleName">Table</xsl:variable> <xsl:variable name="Rows" select="/soap:Envelope/soap:Body/ddw1:GetListItemsResponse/ddw1:GetListItemsResult/ddw1:listitems /rs:data/z:row"/> <xsl:variable name="RowLimit" select="5" /> <xsl:variable name="dvt_RowCount" select="count($Rows)"/>

<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />

<xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>

<xsl:choose> <xsl:when test="$dvt_IsEmpty">

<xsl:call-template name="dvt_1.empty"/> </xsl:when> <xsl:otherwise>

<table border="0" cellpadding="0" cellspacing="0" style="backgroundcolor:transparent;"> <tr><td> <div id="mysagscroller2" class="sagscroller" style="backgroundcolor:transparent; background:transparent; left: 0px; top: 0px;">

<ul style="left: 0px; top: 0px"> <xsl:call-template name="dvt_1.body"> <xsl:with-param name="Rows" select="$Rows"/> <xsl:with-param name="FirstRow" select="1" />

<xsl:with-param name="LastRow" select="$RowLimit" />

</xsl:call-template> </ul></div></td></tr> </table>

</xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="dvt_1.body">

<xsl:param name="Rows"/> <xsl:param name="FirstRow" /> <xsl:param name="LastRow" /> <xsl:for-each select="$Rows"> <xsl:sort select="@ows_ArticleStartDate" order="descending" /> <xsl:variable name="dvt_KeepItemsTogether" select="false()" /> <xsl:variable name="dvt_HideGroupDetail" select="false()" /> <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether"> <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1"> <xsl:call-template name="dvt_1.rowview" /> </xsl:if> </xsl:if> </xsl:for-each>

</xsl:template> <xsl:template name="dvt_1.rowview"> <li style="list-style-type:none"><table cellspacing="0" cellpadding="0"> <tr> <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1"> <td class="ms-vb" width="1%" nowrap="nowrap"> <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span> </td> </xsl:if>

<td class="ms-vb" rowspan="2">

</td><td class="imageClass" style="border:1px #9d8c5d solid;" valign="bottom"><a href="/English/the-news/News/Pages/{@ows_LinkFilename}" ><xsl:value-of select="@ows_PublishingPageImage" disable-output-escaping="yes" /></a> </td><td valign="top" rowspan="2"> <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsppreserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>&#160; &#160;</td><td rowspan="2" valign="top" align="left"><p style="color:#9d8c5d;font-weight:bold;margin:0px"><a href="/English/the-news/News/Pages/{@ows_LinkFilename}" ><xsl:value-of select="@ows_Title" /></a></p><p style="color:#cccccc;margin:0px"><xsl:value-of select="@ows_Comments" /> <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsppreserve="yes" disable-output-escaping="yes">&amp;nbsp; </xsl:text> <a href="/English/the-news/News/Pages/{@ows_LinkFilename}" style="color:#9d8c5d">More</a></p> </td><td class="ms-vb" rowspan="2" /></tr> <tr><td valign="top" style="height: 15px" > <a style="border:0px;" href="/English/the-news/News" ><img style="border:1px #9d8c5d solid;" src="/English/thenews/News/PublishingImages/mImage1.png"/></a></td></tr> </table></li></xsl:template> <xsl:template name="dvt_1.empty"> <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable> <table border="0" width="100%"> <tr> <td class="ms-vb"> <xsl:value-of select="$dvt_ViewEmptyText"/> </td> </tr>

</table> </xsl:template> </xsl:stylesheet>

//Parameter

<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/> <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/> <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/> <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>

Você também pode gostar