<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint &#187; XSLT</title>
	<atom:link href="http://www.sharepointboris.net/category/xslt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharepointboris.net</link>
	<description>and Boris Gomiunik</description>
	<lastBuildDate>Thu, 22 Dec 2011 11:45:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Proper display of decimal comma in XSLT data view webpart</title>
		<link>http://www.sharepointboris.net/2009/11/proper-display-of-decimal-comma-in-xslt-data-view-webpart/</link>
		<comments>http://www.sharepointboris.net/2009/11/proper-display-of-decimal-comma-in-xslt-data-view-webpart/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 09:43:24 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[formatting]]></category>

		<guid isPermaLink="false">http://www.sharepointboris.net/2009/11/proper-display-of-decimal-comma-in-xslt-data-view-webpart/</guid>
		<description><![CDATA[If you&#8217;re having trouble with format-number function in XSLT data view – it&#8217;s probably because of decimal comma. The server returns data with decimal comma, and the format-number function works with decimal dot. The workaround is to translate the values &#60;xsl:value-of select=&#34;format-number(translate(translate(@NumberField,&#8217;.',&#8217;,'),&#8217;,',&#8217;.'), &#8216;#.##0,00;-#.##0,00&#8242;, &#8216;lcid1060&#8242;)&#34; /&#62; (in the example above the @NumberField represents the internal name [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having trouble with format-number function in XSLT data view – it&#8217;s probably because of decimal comma. The server returns data with decimal comma, and the format-number function works with decimal dot. The workaround is to translate the values</p>
<p><strong>&lt;xsl:value-of select=&quot;format-number(translate(translate(@NumberField,&#8217;.',&#8217;,'),&#8217;,',&#8217;.'), &#8216;#.##0,00;-#.##0,00&#8242;, &#8216;lcid1060&#8242;)&quot; /&gt;</strong></p>
<p>(in the example above the @NumberField represents the internal name of the field that contains numerical value.</p>
<p>Also make sure that in HTML just before the &lt;/xsl:stylesheet&gt; tag you have included the following tag:</p>
<p><strong>&lt;xsl:decimal-format decimal-separator=&quot;,&quot; grouping-separator=&quot;.&quot; name=&quot;lcid1060&quot; /&gt;</strong></p>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/11/proper-display-of-decimal-comma-in-xslt-data-view-webpart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting JavaScript into XSLT</title>
		<link>http://www.sharepointboris.net/2009/03/inserting-javascript-into-xslt/</link>
		<comments>http://www.sharepointboris.net/2009/03/inserting-javascript-into-xslt/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 13:28:15 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2009/03/inserting-javascript-into-xslt/</guid>
		<description><![CDATA[When inserting JavaScript code into XSLT dataForm webpart it can sometimes get tricky. Sometimes SharePoint designer messes up our code or we have huge trouble with &#38; signs,… the best way to insert the JavaScript code block into XSLT data view is to enclose it with xsl:text and cdata. Below is the sample: &#60;xsl:text disable-output-escaping=”yes”&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>When inserting JavaScript code into XSLT dataForm webpart it can sometimes get tricky. Sometimes SharePoint designer messes up our code or we have huge trouble with &amp; signs,… the best way to insert the JavaScript code block into XSLT data view is to enclose it with xsl:text and cdata. Below is the sample:</p>
<p><strong>&lt;xsl:text disable-output-escaping=”yes”&gt;     <br />&lt;![CDATA[      <br />&lt;script type=”text/javascript”&gt;      <br /></strong>(your JavaScript code here)    <br /><strong>&lt;/script&gt;     <br />]]&gt;      <br />&lt;/xsl:text&gt;</strong></p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:88f9b6d9-9b3e-41d0-b6b4-78207ca3a003" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/XSLT" rel="tag">XSLT</a>,<a href="http://technorati.com/tags/DataForm" rel="tag">DataForm</a>,<a href="http://technorati.com/tags/WebPart" rel="tag">WebPart</a>,<a href="http://technorati.com/tags/JavaScript" rel="tag">JavaScript</a>,<a href="http://technorati.com/tags/Data+View" rel="tag">Data View</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/03/inserting-javascript-into-xslt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>“Type Microsoft.SharePoint.WebControls.FormField&#8217; does not have a public property named &#8216;xmlns:SharePoint” error</title>
		<link>http://www.sharepointboris.net/2009/02/type-microsoftsharepointwebcontrolsformfield-does-not-have-a-public-property-named-xmlnssharepoint-error/</link>
		<comments>http://www.sharepointboris.net/2009/02/type-microsoftsharepointwebcontrolsformfield-does-not-have-a-public-property-named-xmlnssharepoint-error/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 19:17:37 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2009/02/type-microsoftsharepointwebcontrolsformfield-does-not-have-a-public-property-named-xmlnssharepoint-error/</guid>
		<description><![CDATA[If you’ve made custom forms with SharePoint designer and you’ve modified it quite a lot, everything looks good in SharePoint designer, but when you open it in the web browser, you get the following error, the solution is simple: put your insert/edit form in a div. Let me explain more in detail. A lot of [...]]]></description>
			<content:encoded><![CDATA[<p>If you’ve made custom forms with SharePoint designer and you’ve modified it quite a lot, everything looks good in SharePoint designer, but when you open it in the web browser, you get the following error, the solution is simple:</p>
<p>put your insert/edit form in a div. Let me explain more in detail. A lot of times I don’t want my custom SPD insert of edit forms to be in tables. So I remove all the table tags and format the form with layers, spans, and custom CSS. Like in the screen below. The dvt_1.rowinsert template is clean. And the preview in SharePoint Designer is displaying it ok.</p>
<p><a href="http://boris.gomiunik.net/wp-content/uploads/2009/02/image1.png" rel="lightbox[252]" title="image"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/02/image-thumb1.png" width="244" height="108" /></a> </p>
<p>But when previewing it in web browser you get the error:</p>
<p><a href="http://boris.gomiunik.net/wp-content/uploads/2009/02/image2.png" rel="lightbox[252]" title="image"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/02/image-thumb2.png" width="244" height="62" /></a> </p>
<p>(screenshot is from Slovene website).</p>
<p>All I need to do to resolve this problem is to put the form in a layer (div) – or a table. See the example below (I’ve marked wrapper div with comments)</p>
<p><a href="http://boris.gomiunik.net/wp-content/uploads/2009/02/image3.png" rel="lightbox[252]" title="image"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/02/image-thumb3.png" width="244" height="157" /></a> </p>
<p>You can also place the div inside of entire template if you wish. As long as the sharepoint form fields have wrapper.</p>
<p>And your custom form iwll magically become alive</p>
<p><a href="http://boris.gomiunik.net/wp-content/uploads/2009/02/image4.png" rel="lightbox[252]" title="image"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/02/image-thumb4.png" width="227" height="79" /></a> </p>
<p>Happy formatting.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e878bd84-0aca-48d6-b6b0-0b10133117d4" class="wlWriterEditableSmartContent">Oznake ponudnika Technorati: <a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/XSLT" rel="tag">XSLT</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/02/type-microsoftsharepointwebcontrolsformfield-does-not-have-a-public-property-named-xmlnssharepoint-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit parts of page or DataForm WebPart to the ones with rights</title>
		<link>http://www.sharepointboris.net/2009/01/limit-parts-of-page-or-dataform-webpart-to-the-ones-with-rights/</link>
		<comments>http://www.sharepointboris.net/2009/01/limit-parts-of-page-or-dataform-webpart-to-the-ones-with-rights/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 00:04:55 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2009/01/limit-parts-of-page-or-dataform-webpart-to-the-ones-with-rights/</guid>
		<description><![CDATA[If you see any SharePoint page anonymously, you can see only the items you’re supposed to see. If we as visitors have no rights to see certain site, it’s not displayed. Also if any elements of a list or a document library has specific permissions not to be available for public, we can’t see it. [...]]]></description>
			<content:encoded><![CDATA[<p>If you see any SharePoint page anonymously, you can see only the items you’re supposed to see. If we as visitors have no rights to see certain site, it’s not displayed. Also if any elements of a list or a document library has specific permissions not to be available for public, we can’t see it. </p>
<p>SharePoint has a very good Security model, which we can use (yes, and even without visual Studio). We can set to display certain parts of page or DFWP based on rights the visiting user has. For example: If we have a special part that only the <strong>users that have the right to edit</strong>, can see, we’d wrap it in a conditional formatting tag with a condition ddwrt:IfHasRights(4)</p>
<pre><strong>&lt;xsl:if test=”ddwrt:IfHasRights(4)”&gt;Only Editors can see this text!&lt;/xsl:if&gt;</strong></pre>
<pre>&#160;</pre>
<p>The number 4 in the example above represents the editing right. You’ll find all available rights permissions in the table below. The example above is good for hiding the “Edit” button. </p>
<p>You can make the same outside of a WebPart. But you need to use different kind of tag to nest the protected content in:</p>
<pre><strong>&lt;Sharepoint:SPSecurityTrimmedControl runat=&quot;server&quot; PermissionsString=&quot;EditListItems&quot;&gt;Only Editors can see this text!&lt;/Sharepoint:SPSecurityTrimmedControl&gt;</strong></pre>
<p>
  <br />Use the example above anywhere on the webpage outside of a webpart. As we can see this time the permission is defined with a string instead of number. For this tag to be working, don’t forget to register the SharePoint tagprefix before with </p>
<pre>&lt;%@ Register tagprefix=&quot;SharePoint&quot; namespace=&quot;Microsoft.SharePoint.WebControls&quot; assembly=&quot;Microsoft.SharePoint, Version=<a href="http://12.0.0.0">12.0.0.0</a>, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; %&gt;</pre>
<p>&#160; <br />(in SharePoint’s default master page it’s already added). You’re probably asking which are the values. Thanks to <a target="_blank" href="http://www.wssdemo.com">Ian Morrish</a> I’ve found the whole set. (the strings for PermissionString are quite self-descriptive)</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr style="background-color: #003663; color: white">
<th valign="top" width="200">SPSecurityTrimmedControl</th>
<th valign="top" width="200">ddwrt:IfHasRights</th>
</tr>
<tr>
<td valign="top" width="200">ViewListItems</td>
<td valign="top" width="200">1</td>
</tr>
<tr>
<td valign="top" width="200">AddListItems</td>
<td valign="top" width="200">2</td>
</tr>
<tr>
<td valign="top" width="200">EditListItems</td>
<td valign="top" width="200">4</td>
</tr>
<tr>
<td valign="top" width="200">DeleteListItems</td>
<td valign="top" width="200">8</td>
</tr>
<tr>
<td valign="top" width="200">ApproveItems</td>
<td valign="top" width="200">16</td>
</tr>
<tr>
<td valign="top" width="200">OpenItems</td>
<td valign="top" width="200">32</td>
</tr>
<tr>
<td valign="top" width="200">ViewVersions</td>
<td valign="top" width="200">64</td>
</tr>
<tr>
<td valign="top" width="200">DeleteVersions</td>
<td valign="top" width="200">128</td>
</tr>
<tr>
<td valign="top" width="200">CancelCheckout</td>
<td valign="top" width="200">256</td>
</tr>
<tr>
<td valign="top" width="200">PersonalViews</td>
<td valign="top" width="200">512</td>
</tr>
<tr>
<td valign="top" width="200">ManageLists</td>
<td valign="top" width="200">2048</td>
</tr>
<tr>
<td valign="top" width="200">ViewFormPages</td>
<td valign="top" width="200">4096</td>
</tr>
<tr>
<td valign="top" width="200">Open</td>
<td valign="top" width="200">65536</td>
</tr>
<tr>
<td valign="top" width="200">ViewPages</td>
<td valign="top" width="200">131072</td>
</tr>
<tr>
<td valign="top" width="200">AddAndCustomizePages</td>
<td valign="top" width="200">262144</td>
</tr>
<tr>
<td valign="top" width="200">ApplyThemeAndBorder</td>
<td valign="top" width="200">524288</td>
</tr>
<tr>
<td valign="top" width="200">ApplyStyleSheets</td>
<td valign="top" width="200">1048576</td>
</tr>
<tr>
<td valign="top" width="200">ViewUsageData</td>
<td valign="top" width="200">2097152</td>
</tr>
<tr>
<td valign="top" width="200">CreateSSCSite</td>
<td valign="top" width="200">4194314</td>
</tr>
<tr>
<td valign="top" width="200">ManageSubwebs</td>
<td valign="top" width="200">8388608</td>
</tr>
<tr>
<td valign="top" width="200">CreateGroups</td>
<td valign="top" width="200">16777216</td>
</tr>
<tr>
<td valign="top" width="200">ManagePermissions</td>
<td valign="top" width="200">33554432</td>
</tr>
<tr>
<td valign="top" width="200">BrowseDirectories</td>
<td valign="top" width="200">67108864</td>
</tr>
<tr>
<td valign="top" width="200">BrowseUserInfo</td>
<td valign="top" width="200">134217728</td>
</tr>
<tr>
<td valign="top" width="200">AddDelPrivateWebParts</td>
<td valign="top" width="200">268435456</td>
</tr>
<tr>
<td valign="top" width="200">UpdatePersonalWebParts</td>
<td valign="top" width="200">536870912</td>
</tr>
<tr>
<td valign="top" width="200">ManageWeb</td>
<td valign="top" width="200">1073741824</td>
</tr>
<tr>
<td valign="top" width="200">UseRemoteAPIs</td>
<td valign="top" width="200">137438953472</td>
</tr>
<tr>
<td valign="top" width="200">ManageAlerts</td>
<td valign="top" width="200">274877906944</td>
</tr>
<tr>
<td valign="top" width="200">CreateAlerts</td>
<td valign="top" width="200">549755813888</td>
</tr>
<tr>
<td valign="top" width="200">EditMyUserInfo</td>
<td valign="top" width="200">1099511627776</td>
</tr>
<tr>
<td valign="top" width="200">EnumeratePermissions</td>
<td valign="top" width="200">4611686018427387904</td>
</tr>
<tr>
<td valign="top" width="200">FullMask</td>
<td valign="top" width="200">9223372036854775807</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>There are some considerations you should take in mind:</p>
<p>1. This doesn’t work on “System” pages – in _layouts folder<br />
  <br />2. This is chekcing the security against the actual page you’re viewing (if you put the spsecuritytrimmedcontrol in a masterpage it will check ivisitors permissions on a page he’s viewing, not on a masterpage).</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f9a37046-845a-4805-94bf-fdc23015235a" class="wlWriterEditableSmartContent">Oznake ponudnika Technorati: <a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/Security" rel="tag">Security</a>,<a href="http://technorati.com/tags/XSLT" rel="tag">XSLT</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/01/limit-parts-of-page-or-dataform-webpart-to-the-ones-with-rights/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XSL template for adding days</title>
		<link>http://www.sharepointboris.net/2008/11/xsl-template-for-adding-days/</link>
		<comments>http://www.sharepointboris.net/2008/11/xsl-template-for-adding-days/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 20:21:36 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2008/11/xsl-template-for-adding-days/</guid>
		<description><![CDATA[I can&#8217;t believe it&#8217;s so complex to add couple of days to a certain date. I needed an XSLT way of calculating dates with input parameters for date (format YYYY-MM-DD) and number of days (number). I know, some of you say use EXSLT. After not getting it to work, I&#8217;ve decided to do my own [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t believe it&#8217;s so complex to add couple of days to a certain date. I needed an XSLT way of calculating dates with input parameters for date (format YYYY-MM-DD) and number of days (number). I know, some of you say use EXSLT. After not getting it to work, I&#8217;ve decided to do my own version.</p>
<p>Please note that this template is not for calculating more than one month (for example to add 50 days. And date has to be in ISO format (YYYY-MM-DD). It can be a starting point for your modifications and needs to work with dates.</p>
<pre>&lt;xsl:template name="calcDate"&gt;
    &lt;xsl:param name="date"/&gt;
    &lt;xsl:param name="days"/&gt;
    &lt;xsl:param name="oldMonth"&gt;&lt;xsl:value-of select="substring($date,6,2)"/&gt;&lt;/xsl:param&gt;
    &lt;xsl:param name="oldYear"&gt;&lt;xsl:value-of select="substring($date,1,4)"/&gt;&lt;/xsl:param&gt;
    &lt;xsl:param name="oldDay"&gt;&lt;xsl:value-of select="substring($date,9,2)"/&gt;&lt;/xsl:param&gt;
    &lt;xsl:param name="newMonth"&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test="$oldMonth = '01'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;01&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;02&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '02'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="($oldYear mod 4 = 0 and number($oldDay) + $days &amp;lt;= 29) or ($oldYear mod 4 != 0 and number($oldDay) + $days &amp;lt;= 28)"&gt;02&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;03&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '03'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;03&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;04&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '04'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 30"&gt;04&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;05&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '05'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;05&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;06&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '06'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 30"&gt;06&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;07&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '07'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;07&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;08&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '08'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;08&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;09&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '09'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 30"&gt;09&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;10&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '10'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;10&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;11&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '11'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 30"&gt;11&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;12&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '12'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="number($oldDay) + $days &amp;lt;= 31"&gt;12&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;01&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
        &lt;/xsl:choose&gt;
    &lt;/xsl:param&gt;
    &lt;xsl:param name="newYear"&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test="$oldMonth = '12' and (number($oldDay) + $days) &amp;gt;= 31"&gt;&lt;xsl:value-of select="number($oldYear) + 1"/&gt;&lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;&lt;xsl:value-of select="$oldYear"/&gt;&lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;
    &lt;/xsl:param&gt;
    &lt;xsl:param name="newDay"&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test="$oldMonth = '01'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '02'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;
                        &lt;xsl:choose&gt;
                            &lt;xsl:when test="$oldYear mod 4 = 0"&gt;
                                &lt;xsl:value-of select="number($oldDay) + $days - 29"/&gt;
                            &lt;/xsl:when&gt;
                            &lt;xsl:otherwise&gt;
                                &lt;xsl:value-of select="number($oldDay) + $days - 28"/&gt;
                            &lt;/xsl:otherwise&gt;
                        &lt;/xsl:choose&gt;
                    &lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '03'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '04'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 30"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '05'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '06'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 30"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '07'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '08'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '09'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 30"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '10'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '11'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 30"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$oldMonth = '12'"&gt;
                &lt;xsl:choose&gt;
                    &lt;xsl:when test="$newMonth = $oldMonth"&gt;&lt;xsl:value-of select="number($oldDay) + $days"/&gt;&lt;/xsl:when&gt;
                    &lt;xsl:otherwise&gt;&lt;xsl:value-of select="number($oldDay) + $days - 31"/&gt;&lt;/xsl:otherwise&gt;
                &lt;/xsl:choose&gt;
            &lt;/xsl:when&gt;
        &lt;/xsl:choose&gt;
    &lt;/xsl:param&gt;
    &lt;xsl:value-of select="$newYear"/&gt;
    &lt;xsl:text&gt;-&lt;/xsl:text&gt;
    &lt;xsl:value-of select="$newMonth" /&gt;
    &lt;xsl:text&gt;-&lt;/xsl:text&gt;
    &lt;xsl:if test="$newDay &amp;lt; 10"&gt;0&lt;/xsl:if&gt;&lt;xsl:value-of select="$newDay"/&gt;
    &lt;/xsl:if&gt;
&lt;/xsl:template&gt;</pre>
<p>Usage:</p>
<p>Copy-paste the upper code to the end of your XSL stylesheet (after the last &lt;/xsl:template&gt; tag in your data view. Then in your data view you can call the template.</p>
<p><strong>&lt;xsl:call-template name=&#8221;calcDate&#8221;&gt;<br />
    &lt;xsl:with-param name=&#8221;date&#8221; select=&#8221;substring-before(@Created,&#8217;T')&#8221;/&gt;<br />
    &lt;xsl:with-param name=&#8221;days&#8221; select=&#8221;5&#8243;/&gt;<br />
&lt;/xsl:call-template&gt;</strong></p>
<p>This will return five days from the created date.</p>
<p>There probably IS a better way, I just couldn&#8217;t find it. <img src='http://www.sharepointboris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aa9d4639-0850-408a-950c-86facce1e0f9" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Oznake ponudnika Technorati: <a rel="tag" href="http://technorati.com/tags/SharePoint">SharePoint</a>,<a rel="tag" href="http://technorati.com/tags/XSLT">XSLT</a>,<a rel="tag" href="http://technorati.com/tags/Data%20View">Data View</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2008/11/xsl-template-for-adding-days/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Making &#8220;Post&#8221; and &#8220;Get&#8221; forms from SharePoint&#8217;s pages</title>
		<link>http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/</link>
		<comments>http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 14:30:05 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/</guid>
		<description><![CDATA[If you&#8217;ve tried to insert a form into a sharepoint&#8217;s page you mus have been disappointed. The form just didn&#8217;t work. You can&#8217;t make the form to post or get to some url, because the whole SharePoint&#8217;s page is one big &#60;form&#62; element. So I went a bit deeper on how Microsoft guys are doing [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve tried to insert a form into a sharepoint&#8217;s page you mus have been disappointed. The form just didn&#8217;t work. You can&#8217;t make the form to post or get to some url, because the whole SharePoint&#8217;s page is one big &lt;form&gt; element.</p>
<p>So I went a bit deeper on how Microsoft guys are doing it on their spaces site (blog this functionality makes a post to a certain url) and based on this, I&#8217;ve made this simple script to make &#8220;forms&#8221; to post and to submit.</p>
<p>First thing: Insert your form as it should be</p>
<pre class="html">&lt;form action="http://www.somesite.com/somepage.aspx" method="post"&gt;
      &lt;input name="name"/&gt;
      ... etc. with all the fields you need.
      &lt;input type="submit" value="Submit"/&gt;
  &lt;/form&gt; </pre>
<p>Before you save the page or the content editor webparts, make the three changes:</p>
<p><strong>1. Remove the &lt;form&gt; tags and replace them with &lt;div id=&#8221;contactForm&#8221;&gt;</strong></p>
<pre class="html">&lt;div id="contactForm"&gt;
      &lt;input name="name"/&gt;
      ... etc. with all the fields you need.
      &lt;input type="submit" value="Submit"/&gt;
  &lt;/div&gt; </pre>
<p><strong>2. Add the following script before the form </strong></p>
<pre class="html">&lt;script type="text/javascript"&gt;
  function submitForm(containerElement) {
      var theForm = document.createElement("form");
          theForm.action = 'http://www.somesite.com/somepage.aspx';
          theForm.method = "post";
          theForm.innerHTML = document.getElementById(containerElement).outerHTML;
      var formToSubmit = document.body.appendChild(theForm);
          formToSubmit.submit();
  }
  &lt;/script&gt;</pre>
<p><span style="text-decoration: underline;">Note: be sure to correct the theForm.action and theForm.method to appropriate url and method (for your form)</span></p>
<p><strong>3. Change the submit button </strong>with</p>
<pre class="html">&lt;button onclick="submitForm('contactForm')&gt;Submit&lt;/button&gt;</pre>
<p>Note: Make sure you copy the ID of the layer (in the sample above is the <em>contactForm</em>) to the parameter of the submitForm function.</p>
<p>the end code would look something like below:</p>
<pre class="html">&lt;script type="text/javascript"&gt;
function submitForm(containerElement) {
    var theForm = document.createElement("form");
        theForm.action = 'http://www.somesite.com/somepage.aspx';
        theForm.method = "post";
        theForm.innerHTML = document.getElementById(containerElement).outerHTML;
    var formToSubmit = document.body.appendChild(theForm);
        formToSubmit.submit();
}
&lt;/script&gt;
&lt;div id="contactForm"&gt;
    &lt;input name="name" type="text"/&gt;
    ... etc. with all the fields you need.
    &lt;button onclick="submitForm('contactForm')&gt;Submit&lt;/button&gt;
&lt;/div&gt;</pre>
<p><strong>Update (5.11.): Unfortunately this method works straight only in IE, because it&#8217;s the only one that coppies the innerHTML with the changes (input data). So to get this method to work in FF, Chrome, Safari, Opera,.. you have to copy the field values. Here&#8217;s how</strong></p>
<p>After the line</p>
<pre class="html">var formToSubmit = document.body.appendChild(theForm);</pre>
<p>add code similar to the one below for copying the values for <strong>each</strong> of the input fields</p>
<pre class="html">document.getElementsByName('name')[1].value = document.getElementsByName('name')[0].value;</pre>
<p>Apply the similar methodology for other types of fields. I&#8217;ll try to come up with a universal script to copy values.<!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

