<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1749068196640657990</id><updated>2011-04-21T22:18:26.684-05:00</updated><category term='SharePoint'/><category term='Web Parts'/><category term='MOSS'/><category term='SharePoint 2007'/><category term='MOSS 2007'/><category term='XSL'/><category term='XPath'/><category term='Data View'/><category term='WSS'/><category term='SharePoint Development'/><category term='SharePoint Designer'/><title type='text'>SharePoint</title><subtitle type='html'>A blog by members of the SharePoint Solutions team - experts on Microsoft's SharePoint Products and Technologies.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://scottcmayo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749068196640657990/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://scottcmayo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scott C. Mayo</name><uri>http://www.blogger.com/profile/10781238406151919209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp0.blogger.com/_OOLHcbN__qk/SFE6ANXZIiI/AAAAAAAAABQ/8wNNN0G7dQM/S220/me_small.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1749068196640657990.post-5707967836751821895</id><published>2008-06-17T16:04:00.001-05:00</published><updated>2008-06-17T16:04:21.299-05:00</updated><title type='text'>Data View bug on Anonymous Pages</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;I spent two days trying to fix this problem so I thought I would send it along in case any of you run into it. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I noticed that I had a page on a publishing site that worked fine when logged in but one of the three data views on the page gave the following error when I viewed the page anonymously. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator."&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For some reason the data view web part didn't put a "WebURL" select parameter in "DataSources" for this one control. I not sure why this only affected anonymous users. When I added this parameter with a value of {sitecollectionroot} everything worked fine.  &lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749068196640657990-5707967836751821895?l=scottcmayo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottcmayo.blogspot.com/feeds/5707967836751821895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749068196640657990&amp;postID=5707967836751821895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749068196640657990/posts/default/5707967836751821895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749068196640657990/posts/default/5707967836751821895'/><link rel='alternate' type='text/html' href='http://scottcmayo.blogspot.com/2008/06/data-view-bug-on-anonymous-pages.html' title='Data View bug on Anonymous Pages'/><author><name>Scott C. Mayo</name><uri>http://www.blogger.com/profile/10781238406151919209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp0.blogger.com/_OOLHcbN__qk/SFE6ANXZIiI/AAAAAAAAABQ/8wNNN0G7dQM/S220/me_small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749068196640657990.post-6211062485366449510</id><published>2008-06-12T16:08:00.002-05:00</published><updated>2008-06-12T16:20:37.456-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data View'/><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Designer'/><category scheme='http://www.blogger.com/atom/ns#' term='XSL'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='WSS'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Development'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Parts'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>Data View - Using a Conditional Statement to Build a Variable for an XPath Expression</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;I was building a Data View in SharePoint Designer that showed a training schedule. I wanted to use a conditional statement to build the XPath expression that selected the classes. If the page was passed a CourseTitle parameter in the querystring then I wanted to use it to select only classes scheduled for that course. If there wasn't a CourseTitle parameter I wanted to select all scheduled classes.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;First I tried a choose statement like the following...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:choose&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:when test="string-length(CourseTitle) != 0"&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p style='margin-left: 36pt'&gt;&amp;lt;xsl:variable name="Rows" select="/dsQueryResponse/Class_Schedule/Rows/Row[normalize-space(@SC_Course_Title) = $CourseTitle and number(translate(substring before(@Start_x0020_Date,'T'),'-','')) &amp;amp;gt; number(translate(substring-before($Today,'T'),'-',''))]"&amp;gt;  &lt;br /&gt;&lt;/p&gt;&lt;p&gt; &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p style='margin-left: 36pt'&gt;&amp;lt;xsl:variable name="Rows" select="/dsQueryResponse/Class_Schedule/Rows/Row[number(translate(substring-before(@Start_x0020_Date,'T'),'-','')) &amp;amp;gt; number(translate(substring-before($Today,'T'),'-',''))]"&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I also tried just two separate "&amp;lt;xsl:if statements /&amp;gt;" but that didn't work either.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The error message I got was "a required variable (Rows) isn't present". As pointed out by a colleague (Jeremy Luerkens), the error was being caused later in the application when I tried to reference the "Rows" variable. The "Rows" variable was out of scope at that point and no longer valid.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I had to separate the conditional statement into its own variable (condition) then in the "Rows" variable I had to set the node to "self::node" when calling the "condition" variable so the select would get created in the right scope.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:variable name="condition" select="boolean(string-length($QSCourseTitle) = 0)"/&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;xsl:variable name="Rows" select="self::node()[$condition] /dsQueryResponse/Class_Schedule/Rows/Row[number(translate(substring-before(@Start_x0020_Date,'T'),'-','')) &amp;amp;gt; number(translate(substring-before($Today,'T'),'-',''))] | self::node()[not($condition)] /dsQueryResponse/Class_Schedule/Rows/Row[normalize-space(@SC_Course_Title) = $QSCourseTitle and number(translate(substring-before(@Start_x0020_Date,'T'),'-','')) &amp;amp;gt; number(translate(substring-before($Today,'T'),'-',''))]"/&amp;gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749068196640657990-6211062485366449510?l=scottcmayo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://scottcmayo.blogspot.com/feeds/6211062485366449510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749068196640657990&amp;postID=6211062485366449510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749068196640657990/posts/default/6211062485366449510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749068196640657990/posts/default/6211062485366449510'/><link rel='alternate' type='text/html' href='http://scottcmayo.blogspot.com/2008/06/data-view-using-conditional-statement_12.html' title='Data View - Using a Conditional Statement to Build a Variable for an XPath Expression'/><author><name>Scott C. Mayo</name><uri>http://www.blogger.com/profile/10781238406151919209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='http://bp0.blogger.com/_OOLHcbN__qk/SFE6ANXZIiI/AAAAAAAAABQ/8wNNN0G7dQM/S220/me_small.jpg'/></author><thr:total>0</thr:total></entry></feed>
