Category Archives: SharePoint

Snippet of XSLT to create a link to the parent folder of an item in a search result

I wanted to add a link to the parent folder of an item in FAST search results.

I had found an article that said I could use the “SiteName” property.

Unfortunately, this content wasn’t from a SharePoint site, it was from a File Share.

The “SiteName” only returned \\Server\Sharename for each result, never the folder path

For example \\Server\ShareFolder1\SubFolderA\myfile.txt is where the file is

SiteName retured \\ServerShare

I wanted \\Server\Share\Folder1\SubFolderA

The following XSLT uses a few chained string commands to return the desired results

<xsl:if test="isdocument = 'True'">
   <br/>
   <a>
      <xsl:attribute name="href">
         <xsl:value-of select="substring(url,1,string-length(url) - string-length(title))"/>
      </xsl:attribute>
      <i>Link to Containing Folder</i>
   </a>
</xsl:if>

Snippet of XLST to dump the output of search results

This is one of those posts more to serve as a reminder to me than anything.

While watching a video on SharePoint-Videos.com about customizing search results with XSLT, the presenter showed how to use a small bit of XSL to dump all the search results returned by the search engine – the original video can be found here: http://www.sharepoint-videos.com/sp10-customize-search-results-using-xslt/

 

<?xml version=”1.0″ encoding=”UTF-8″>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xls:template match "/">
<textarea rows="20" cols="100">
 <xsl:copy-of select="*"/>
</textarea>
</xsl:template>
</xsl:stylesheet>

SOAP query for pulling data from a sharepoint list into Report Builder with a specific View

<Query><SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction> 
   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems"> 
      <Parameters> 
         <Parameter Name="listName"> 
            <DefaultValue>{8529D70B-D632-4CC8-A1E7-2C25F29BE1E0}(this could also be a list name, it doesn't have to be a GUID)</DefaultValue> 
         </Parameter> 
         <Parameter Name="viewName"> 
            <DefaultValue>{2FC6AA42-EA95-4C18-AB07-33E25EBBA85D}(could also be a view name)</DefaultValue> 
            <ViewFields> 
               <FieldRef Name="Resolve_x0020__x0023_" /> 
               <FieldRef Name="Product" /> 
               <FieldRef Name="Release" /> 
               <FieldRef Name="Theme" /> 
               <FieldRef Name="Pre_x002d_Req_x0020_Estimate" /> 
            </ViewFields> 
         </Parameter> 
      </Parameters> 
   </Method> 
   <ElementPath IgnoreNamespaces="True">*</ElementPath> 
</Query>