:dhò: cho combatuto 2 ore per farlo diventare di 25 K :)
io di posto tutto l'XML (che per la cronaca e' una pagina di digital dashboard )


<?xml version="1.0" ?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:WP="urn:schemas-microsoft-com:webpart:" xmlns:DAV="DAV:" xmlns:DDF="urn:schemas-microsoft-com:dashboardfactory:">
- <xsl:template match="/">
+ <xsl:script language="JavaScript">
+ <![CDATA[ function GetFormattedDate(node)
{
var strDate = node.text;

// We need to check the date format
// we are seeing. It may differ based on
// which store type last set the date on this
// part. If it is alredy in "GMT" mode, we'll
// just leave it alone and return.
//



if( (strDate.length-3) != strDate.lastIndexOf("GMT") ){

// This is an exchange format
var strSubStr = strDate.substring(5,7);
var dte = new Date();

if (strSubStr.charAt(0) == "0")
{
strSubStr = strSubStr.charAt(1);
}

dte.setUTCFullYear(Number(strDate.substring(0,4))) ;
dte.setUTCMonth(Number(strSubStr)-1);
dte.setUTCDate(Number(strDate.substring(8,10)));
dte.setUTCHours(Number(strDate.substring(11,13)));
dte.setUTCMinutes(Number(strDate.substring(14,16)) );
dte.setUTCSeconds(Number(strDate.substring(17,19)) );
return (dte.toUTCString());
}

return strDate;
}

]]>
</xsl:script>
- <HTML>
+ <HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>
<xsl:apply-templates select="//String[@_locID='L_PageCaption_Text']" />
"
<xsl:value-of select="/DAV:multistatus/DAV:response[0]/DAV:propstat/DAV:prop/WP:Title" />
"
</title>
- <xsl:if test="/DAV:multistatus/DDF:Settings/DDF:BaseHref[.!='']">
- <BASE>
- <xsl:attribute name="href">
<xsl:value-of select="/DAV:multistatus/DDF:Settings/DDF:BaseHref" />
</xsl:attribute>
</BASE>
</xsl:if>
- <xsl:choose>
- <xsl:when test="/DAV:multistatus/DDF:Settings/DDF:IE5OrGreater[.='1']">
<link rel="stylesheet" HREF="cust.css" />
</xsl:when>
- <xsl:otherwise>
<link rel="stylesheet" HREF="cust_nav.css" />
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="/DAV:multistatus/DDF:Settings/DDF:AdditionalStyleSheet[.!='']">
- <link rel="stylesheet">
- <xsl:attribute name="href">
<xsl:value-of select="/DAV:multistatus/DDF:Settings/DDF:AdditionalStyleSheet" />
</xsl:attribute>
</link>
</xsl:if>
</HEAD>
- <BODY leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0" bgcolor="White">
- <FORM METHOD="POST" ACTION="dbcontent.asp">
- <table class="CustOuterTable" height="100%" width="100%" border="0" cellspacing="0" cellpadding="0">
- <!-- Begin Mask Area
-->
+ <tr>
+ <td colspan="2" class="CustMaskAreaTop">
+ <xsl:choose>
+ <xsl:when test="/DAV:multistatus/DDF:Settings/DDF:CustomTitleBar[.!='']">
<xsl:apply-templates select="/DAV:multistatus/DDF:Settings/DDF:CustomTitleBar" />
</xsl:when>
- <xsl:otherwise>
[img]pixel.gif[/img]
</xsl:otherwise>
</xsl:choose>
</td>
+ <td rowspan="3" class="CustMaskAreaRight">
[img]pixel.gif[/img]
</td>
</tr>
- <!-- End Mask Area
-->
- <!-- Gold highlight
-->
- <tr>
+ <td colspan="2" style="background-color:#ffcc00">
[img]pixel.gif[/img]
</td>
</tr>
- <!-- Begin Content Area
-->
- <tr height="100%">
+ <td style="vertical-align: top; background-color:#ffcc00">
[img]pixel.gif[/img]
</td>
- <td style="vertical-align: top">
- <!--
There should only be one dashboard in our XML, but
just in case, select the first one explicitly

-->
- <xsl:for-each select="/DAV:multistatus/DAV:response[0]/DAV:propstat/DAV:prop">
- <table class="CustContentTable" height="100%" width="100%" border="0" cellspacing="0" cellpadding="0">
- <!-- Begin Content Header
-->
- <tr>
- <td class="CustSpacer">
[img]pixel.gif[/img]
</td>
- <xsl:choose>
- <xsl:when test="/DAV:multistatus/DDF:Settings/DDF:CustomTitleBar[.!='']">
- <td class="CustSidebarSpacer" width="110px" align="center">
[img]home.gif[/img]
</td>
</xsl:when>
- <xsl:otherwise>
- <td class="CustSidebarSpacer" align="center">
[img]settingsicon.gif[/img]
</td>
</xsl:otherwise>
</xsl:choose>
- <td class="CustSpacer">
[img]pixel.gif[/img]
</td>
- <td class="CustTitleArea">
- <xsl:choose>
- <xsl:when test="/DAV:multistatus/DDF:Settings/DDF:CustomTitleBar[.!='']">
<xsl:value-of select="/DAV:multistatus/DAV:response[0]/DAV:propstat/DAV:prop/WP:Title" />


</xsl:when>
- <xsl:otherwise>
<xsl:apply-templates select="//String[@_locID='L_PageTitle_Text']" />


</xsl:otherwise>
</xsl:choose>
- <SPAN class="CustCaption">
<xsl:apply-templates select="//String[@_locID='L_PageCaption_Text']" />
"
<xsl:value-of select="WP:Title" />
"
</SPAN>
</td>
- <td class="CustSpacer">
[img]pixel.gif[/img]
</td>
</tr>
- <tr>
- <td class="CustSpacer">
[img]pixel.gif[/img]
</td>
- <td colspan="3" style="background-color:#5f8ac5">
[img]pixel.gif[/img]
</td>
- <td class="CustSpacer">
[img]pixel.gif[/img]
</td>
</tr>
- <tr>
- <td colspan="5" class="CustSpacer">
[img]pixel.gif[/img]
</td>
</tr>
- <!-- End Content Header
-->
- <!-- Begin content body
-->
- <tr height="100%">
- <!-- Indent area with vertical dot separator
-->
- <td>
<xsl:eval no-entities="t">""</xsl:eval>
</td>
- <td>
[img]pixel.gif[/img]
</td>
- <td width="6px" class="CustVerticalDots">
<xsl:eval no-entities="t">""</xsl:eval>
</td>
- <!-- Area that contains all the sections of content
-->
- <td style="vertical-align:top">
<xsl:apply-templates select="//String[@_locID='L_PageDescription_Text']" />



- <!-- Begin Section "Current Web Parts"
-->
- <div class="UserGenericHeader">
<xsl:apply-templates select="//String[@_locID='L_WebParts_Text']" />
</div>
- <div class="UserGenericBody">
<xsl:apply-templates select="//String[@_locID='L_AvailableParts_Text']" />
</div>
- <div class="UserGenericBody">
+ <INPUT TYPE="hidden" NAME="DashboardID">
- <xsl:attribute name="VALUE">
<xsl:value-of select="/DAV:multistatus/DAV:response[0]/DAV:propstat/DAV:prop/DDF:ID" />
</xsl:attribute>
</INPUT>
- <xsl:choose>
- <xsl:when test="/DAV:multistatus/DAV:response/DAV:propstat/DAV:prop[DAV:contentclass='urn:schemas-microsoft-com:webpart']">
- <!-- Begin Parts Table
-->
- <table width="95%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>
<xsl:eval no-entities="t">""</xsl:eval>
</th>
- <th width="60%">
<xsl:apply-templates select="//String[@_locID='L_Name_Text']" />
</th>
- <th width="20%" nowrap="" style="padding-left: 2px; padding-right: 2px">
<xsl:apply-templates select="//String[@_locID='L_Position_Text']" />
</th>
- <th width="20%" nowrap="" style="padding-left: 2px; padding-right: 2px">
<xsl:apply-templates select="//String[@_locID='L_LastModified_Text']" />
</th>
</tr>
- <xsl:for-each select="/DAV:multistatus/DAV:response/DAV:propstat/DAV:prop[DAV:contentclass='urn:schemas-microsoft-com:webpart']" order-by="WP:Title">
- <tr style="overflow: hidden">
- <td style="VERTICAL-ALIGN: middle; TEXT-ALIGN:center">
- <xsl:choose>
- <xsl:when test="/DAV:multistatus/DDF:Settings/DDF:BrowserSupportsDisabled[.='1']">
- <INPUT class="CustCheckBox" TYPE="checkbox" style="display:none">
- <xsl:attribute name="name">
chkOld
<xsl:value-of select="DDF:ID" />
</xsl:attribute>
- <xsl:if test="WP:IsIncluded[.='1']">
<xsl:attribute name="CHECKED" />
- <xsl:if test="WP:AllowRemove[.='0']">
<xsl:attribute name="DISABLED" />
</xsl:if>
</xsl:if>
- <xsl:if test="DDF:CanPersonalize[.='0']">
<xsl:attribute name="DISABLED" />
</xsl:if>
</INPUT>
- <INPUT class="CustCheckBox" TYPE="checkbox">
- <xsl:attribute name="name">
chkNew
<xsl:value-of select="DDF:ID" />
</xsl:attribute>
- <xsl:if test="WP:IsIncluded[.='1']">
<xsl:attribute name="CHECKED" />
- <xsl:if test="WP:AllowRemove[.='0']">
<xsl:attribute name="DISABLED" />
</xsl:if>
</xsl:if>
- <xsl:if test="DDF:CanPersonalize[.='0']">
<xsl:attribute name="DISABLED" />
</xsl:if>
</INPUT>
</xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="WP:AllowRemove[.!='0' and ../DDF:CanPersonalize!='0']">
- <INPUT TYPE="hidden">
- <xsl:attribute name="name">
chkOld
<xsl:value-of select="DDF:ID" />
</xsl:attribute>
- <xsl:if test="WP:IsIncluded[.='1']">
<xsl:attribute name="value">1</xsl:attribute>
</xsl:if>
</INPUT>
- <INPUT class="CustCheckBox" TYPE="checkbox">
- <xsl:attribute name="name">
chkNew
<xsl:value-of select="DDF:ID" />
</xsl:attribute>
- <xsl:if test="WP:IsIncluded[.='1']">
<xsl:attribute name="CHECKED" />
</xsl:if>
</INPUT>
</xsl:when>
- <xsl:otherwise>
[img]pixel.gif[/img]
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</td>
- <td NOWRAP="" style="VERTICAL-ALIGN: middle" width="40%">
- <xsl:choose>
- <xsl:when test="DDF:CanPersonalize[.='1']">
- <A>
- <xsl:attribute name="name">
__
<xsl:value-of select="WP:Title" />
</xsl:attribute>
- <xsl:attribute name="HREF">
<xsl:value-of select="DDF:EditPartURL" />
</xsl:attribute>
<xsl:value-of select="WP:Title" />
</A>
</xsl:when>
- <xsl:otherwise>
<xsl:value-of select="WP:Title" />
</xsl:otherwise>
</xsl:choose>
</td>
- <td NOWRAP="" style="VERTICAL-ALIGN: middle; padding-left: 2px; padding-right: 2px" width="20%">
- <xsl:choose>
- <xsl:when test="WP:Zone[.='1']">
<xsl:apply-templates select="//String[@_locID='L_Left_Text']" />
</xsl:when>
- <xsl:when test="WP:Zone[.='2']">
<xsl:apply-templates select="//String[@_locID='L_Right_Text']" />
</xsl:when>
- <xsl:when test="WP:Zone[.='3']">
<xsl:apply-templates select="//String[@_locID='L_Middle_Text']" />
</xsl:when>
- <xsl:when test="WP:Zone[.='4']">
<xsl:apply-templates select="//String[@_locID='L_Header_Text']" />
</xsl:when>
- <xsl:when test="WP:Zone[.='5']">
<xsl:apply-templates select="//String[@_locID='L_Footer_Text']" />
</xsl:when>
<xsl:otherwise>Middle</xsl:otherwise>
</xsl:choose>
</td>
- <td STYLE="VERTICAL-ALIGN: middle; padding-left: 2px; padding-right: 2px" width="40%" nowrap="">
- <xsl:for-each select="WP:LastModified">
<xsl:eval>GetFormattedDate(this)</xsl:eval>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
- <!-- End Parts Table
-->
</xsl:when>
- <xsl:otherwise>
- <font color="red">
<xsl:apply-templates select="//String[@_locID='L_EmptyDashboard_Text']" />
</font>
</xsl:otherwise>
</xsl:choose>
</div>