2012-12-10 4 views
0

아무도 도움이 될지 궁금합니다.Sharepoint Xpath에 포함되어 있음

저는 Xpath를 처음 사용했습니다. & SharePoint 2010이지만 지금까지 나와 함께 해왔지만,이 작은 문제는 나에게 커다란 고통을주고 있습니다!

SharePoint 목록의 동일한 열에 비슷한 이름의 다른 값이없는 경우 필드의 값을 표시하는 것이 좋습니다.

비교 대상 값을 하드 코드로 지정하면 다음 선택 항목이 적용됩니다. <xsl:value-of select="$thisNode/@Txt_x0020_Doc_x0020_Ref[contains(.,'Test')]"/>이 경우 테스트에 포함 된 모든 값이 표시됩니다.

은 무엇 난 후 누군가가 놀라운 것이 올바른 방향으로 날 지점 수 경우 Txt_x0020_Doc_x0020_Ref 열

다른 모든 결과에 대한 현재의 선택 Txt_x0020_Doc_x0020_Ref 열을 비교하는 것입니다!

* @Ian 업데이트 여기에는 공유 지점 디자이너의 페이지 전체 내용이 나와 있습니다.

는 내가 그것을하고 싶은 최고 값을 값을 명명 중복을 제거하고 만 표시 즉

현재 목록

  • 테스트 1
  • 테스트 1
  • 안녕하세요 1
  • 로버트 1
  • 내가 원하는 내용

    (210)

  • 테스트 1
  • 안녕하세요 1
  • 로버트 하나는 그냥 SharePoint 목록의 목적에 좀 더 많은 정보를 제공합니다. 입력 된 양식을 저장하는 양식 라이브러리입니다. 모든 양식이 제출되어 모든 버전이 보관되므로보기의 목적은 양식의 최신 버전 만 표시 한 다음 다른 버전을 표시 할 다른보기를 갖습니다. . select 문은 다음과

    에 "AllRows"select 문을 변경이 다음 하나가 표시됩니다 테이블에

    <code> 
    <asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server"> 
    <SharePoint:ListProperty Property="TitleOrFolder" runat="server"/> - 
    <SharePoint:ListProperty Property="CurrentViewTitle" runat="server"/></asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server"> 
    <SharePoint:ListProperty Property="TitleBreadcrumb" runat="server"/> 
    <SharePoint:UIVersionedContent UIVersion="4" runat="server"> 
    <ContentTemplate> 
          <span class="ms-ltviewselectormenuheader" runat="server"> 
           <SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" /> 
          </span> 
         </ContentTemplate> 
        </SharePoint:UIVersionedContent> 
    </asp:Content> 
    <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server"> 
        <SharePoint:RssLink runat="server"/> 
    </asp:content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"> 
        <SharePoint:ViewIcon Width="145" Height="54" runat="server"/></asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server"> 
    <SharePoint:RecentChangesMenu runat="server" id="RecentChanges"/> 
    <SharePoint:ModifySettingsLink runat="server"/> 
    </asp:Content> 
    <asp:Content ContentPlaceHolderId ="PlaceHolderBodyLeftBorder" runat="server"> 
        <div height="100%" class="ms-pagemargin"><img src="/_layouts/images/blank.gif" width='6' height='1' alt="" /></div> 
    </asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> 
         <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate> 
         <WebPartPages:XsltListViewWebPart runat="server" Description="" PartOrder="2" Default="TRUE" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="False" IsIncludedFilter="" DataSourceID="" Title="Demand Management" ViewFlag="5" AllowConnect="True" DisplayName="Main View" PageType="PAGE_DEFAULTVIEW" FrameState="Normal" PageSize="-1" PartImageLarge="" AsyncRefresh="False" ExportMode="NonSensitiveData" Dir="Default" DetailLink="/Strategy-and-Architecture/Business-Account-Managers/Demand Management" ShowWithSampleData="False" ListId="cafbbdc7-079d-4ae1-bf40-4a695834e510" ListName="{CAFBBDC7-079D-4AE1-BF40-4A695834E510}" FrameType="Default" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" ViewGuid="{1766D7BE-7DC0-4277-8418-EBA815716C60}" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" WebId="00000000-0000-0000-0000-000000000000" ViewContentTypeId="0x" InitialAsyncDataFetch="False" GhostedXslLink="main.xsl" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ID="g_1766d7be_7dc0_4277_8418_eba815716c60" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" TitleUrl="/Strategy-and-Architecture/Business-Account-Managers/Demand Management" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{1766D7BE-7DC0-4277-8418-EBA815716C60}" __AllowXSLTEditing="true" __designer:CustomXsl="fldtypes_Ratings.xsl" WebPart="true" Height="" Width=""><ParameterBindings> 
          <ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/> 
          <ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/> 
          <ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/> 
          <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/> 
          <ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)" /> 
          <ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)" /> 
          <ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)" /> 
          <ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)" /> 
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noitemsinview_doclibrary)" /> 
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noitemsinview_doclibrary_howto2)" /> 
         </ParameterBindings> 
    <XmlDefinition> 
          <View Name="{1766D7BE-7DC0-4277-8418-EBA815716C60}" DefaultView="TRUE" Type="HTML" DisplayName="Main View" Url="/Strategy-and-Architecture/Business-Account-Managers/Demand Management/Forms/Main View.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png"> 
           <Query/> 
           <ViewFields> 
            <FieldRef Name="LinkFilename"/> 
            <FieldRef Name="Txt_x0020_Doc_x0020_Ref"/> 
            <FieldRef Name="Txtdescription"/> 
            <FieldRef Name="Txt_x0020_Doc_x0020_Status_x0020_Hidden"/> 
            <FieldRef Name="Ddl_x0020_DM_x0020_Project_x0020_Status"/> 
            <FieldRef Name="Modified"/> 
            <FieldRef Name="Editor"/> 
            <FieldRef Name="Txt_x0020_Version"/> 
            <FieldRef Name="Title" Explicit="TRUE"/> 
           </ViewFields> 
           <RowLimit Paged="TRUE">30</RowLimit> 
           <Toolbar Type="Standard"/> 
          </View> 
         </XmlDefinition> 
    <DataFields> 
    </DataFields> 
    <Xsl> 
    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 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" xmlns:o="urn:schemas-microsoft-com:office:office"> 
        <xsl:include href="/_layouts/xsl/main.xsl"/> 
        <xsl:include href="/_layouts/xsl/internal.xsl"/> 
          <xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/> 
          <xsl:param name="dvt_apos">'</xsl:param> 
          <xsl:template match="FieldRef[@Name='LinkFilename']" name="LinkFilenameNoMenu.LinkFilename" mode="Computed_LinkFilename_body" ddwrt:tag="a" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal"> 
           <xsl:param name="thisNode" select="."/> 
           <xsl:param name="ShowAccessibleIcon" select="0"/> 
           <xsl:param name="folderUrlAdditionalQueryString"/> 
           <xsl:param name="IncludeOnClick" select="1"/> 
           <xsl:choose> 
    
            <xsl:when test="$thisNode/@FSObjType='1'"> 
             <xsl:choose> 
              <xsl:when test="$RecursiveView"> 
          <xsl:value-of select="$thisNode/@FileLeafRef" /> 
          </xsl:when> 
              <xsl:otherwise> 
               <xsl:variable name="FolderURL"> 
           <xsl:value-of select="$PagePathFinal" />RootFolder=<xsl:value-of select="$thisNode/@FileRef.urlencode" /><xsl:value-of select="$ShowWebPart"/>&amp;FolderCTID=<xsl:value-of select="$thisNode/@ContentTypeId" />&amp;View=<xsl:value-of select="$View"/><xsl:value-of select="$folderUrlAdditionalQueryString"/> 
          </xsl:variable> 
               <xsl:choose> 
                <xsl:when test="$IsDocLib"> 
                 <xsl:variable name="OnMouseDownJS"> 
            javascript:VerifyFolderHref(this,event,'<xsl:value-of select="$thisNode/@File_x0020_Type.url" />','<xsl:value-of select="$thisNode/@File_x0020_Type.progid" />','<xsl:value-of select="$XmlDefinition/List/@DefaultItemOpen" />','<xsl:value-of select="$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon" />','<xsl:value-of select="$thisNode/@HTML_x0020_File_x0020_Type" />','<xsl:value-of select="$thisNode/@serverurl.progid" />');return false; 
           </xsl:variable> 
                 <xsl:variable name="OnClickJS"> 
            return HandleFolder(this,event,&quot;<xsl:value-of select="$PagePathFinal" />RootFolder=&quot; + escapeProperly(&quot;<xsl:value-of select="$thisNode/@FileRef" />&quot;) + '<xsl:value-of select="$ShowWebPart" />&amp;FolderCTID=<xsl:value-of select="$thisNode/@ContentTypeId" />&amp;View=<xsl:value-of select="$View" /><xsl:value-of select="$folderUrlAdditionalQueryString"/>','TRUE','FALSE','<xsl:value-of select="$thisNode/@File_x0020_Type.url" />','<xsl:value-of select="$thisNode/@File_x0020_Type.progid" />','<xsl:value-of select="$XmlDefinition/List/@DefaultItemOpen" />','<xsl:value-of select="$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon" />','<xsl:value-of select="$thisNode/@HTML_x0020_File_x0020_Type" />','<xsl:value-of select="$thisNode/@serverurl.progid" />','<xsl:value-of select="$thisNode/@CheckoutUser.id" />','<xsl:value-of select="$Userid" />','<xsl:value-of select="$XmlDefinition/List/@ForceCheckout" />','<xsl:value-of select="$thisNode/@IsCheckedoutToLocal" />','<xsl:value-of select="$thisNode/@PermMask" />'); 
           </xsl:variable> 
           <a onfocus="OnLink(this)" href="{$FolderURL}"> 
                 <xsl:choose> 
                  <xsl:when test="$IncludeOnClick = '1'"> 
                   <xsl:attribute name="onmousedown"> 
             <xsl:value-of select="$OnMouseDownJS"/> 
             </xsl:attribute> 
                   <xsl:attribute name="onclick"> 
             <xsl:value-of select="$OnClickJS"/> 
             </xsl:attribute> 
            </xsl:when> 
                 </xsl:choose> 
            <xsl:value-of select="$thisNode/@FileLeafRef" /> 
                 <xsl:choose> 
                  <xsl:when test="$ShowAccessibleIcon"> 
             <img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="{$idPresEnabled}" /> 
            </xsl:when> 
                  <xsl:otherwise></xsl:otherwise> 
                 </xsl:choose> 
           </a> 
           </xsl:when> 
                <xsl:otherwise> 
                 <xsl:variable name="OnClickJS"> 
            javascript:EnterFolder(&quot;<xsl:value-of select="$PagePathFinal" />RootFolder=&quot; + escapeProperly(&quot;<xsl:value-of select="$thisNode/@FileRef" />&quot;) + '<xsl:value-of select="$ShowWebPart" />&amp;FolderCTID=<xsl:value-of select="$thisNode/@ContentTypeId" />&amp;View=<xsl:value-of select="$View" /><xsl:value-of select="$folderUrlAdditionalQueryString" />');return false; 
           </xsl:variable> 
           <a onfocus="OnLink(this)" href="{$FolderURL}"> 
                 <xsl:choose> 
                  <xsl:when test="$IncludeOnClick = '1'"> 
                   <xsl:attribute name="onclick"> 
             <xsl:value-of select="$OnClickJS"/> 
             </xsl:attribute> 
            </xsl:when> 
                 </xsl:choose> 
            <xsl:value-of select="$thisNode/@FileLeafRef" /> 
                 <xsl:choose> 
                  <xsl:when test="$ShowAccessibleIcon"> 
             <img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="{$idPresEnabled}" /> 
            </xsl:when> 
                  <xsl:otherwise></xsl:otherwise> 
                 </xsl:choose> 
           </a> 
           </xsl:otherwise> 
               </xsl:choose> 
          </xsl:otherwise> 
             </xsl:choose> 
         </xsl:when> 
            <xsl:otherwise> 
         <a onfocus="OnLink(this)" href="{$thisNode/@FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@serverurl.progid}')" 
          onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}')"> 
          <xsl:value-of select="/dsQueryResponse/Rows/Row[1]" /> 
    
          <xsl:value-of select="$thisNode/@FileLeafRef.Name" /></a> 
    
             <xsl:if test="$thisNode/@Created_x0020_Date.ifnew='1'"> 
              <xsl:call-template name="NewGif"> 
               <xsl:with-param name="thisNode" select="$thisNode"/> 
              </xsl:call-template> 
    
         </xsl:if> 
         </xsl:otherwise> 
           </xsl:choose> 
        </xsl:template> 
        <xsl:template name="FieldRef_Text_body.Txt_x0020_Doc_x0020_Ref" ddwrt:dvt_mode="body" match ="FieldRef[@Name='Txt_x0020_Doc_x0020_Ref']" mode="Text_body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal"> 
         <xsl:param name="thisNode" select="."/> 
    
    
    <!--- This is the field I wish to change ---> 
    
    <xsl:value-of select="$thisNode/@Txt_x0020_Doc_x0020_Ref[contains(.,'Test')]"/> 
    
        </xsl:template></xsl:stylesheet></Xsl> 
    </WebPartPages:XsltListViewWebPart> 
    
    </ZoneTemplate></WebPartPages:WebPartZone> 
    </asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server"> 
    <style type="text/css"> 
    .ms-bodyareaframe { 
        padding: 0px; 
    } 
    </style> 
    </asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server"> 
    <SharePoint:ListProperty CssClass="ms-listdescription" Property="Description" runat="server"/> 
    </asp:Content> 
    <asp:Content ContentPlaceHolderId="PlaceHolderCalendarNavigator" runat="server"> 
        <SharePoint:SPCalendarNavigator id="CalendarNavigatorId" runat="server"/> 
        <ApplicationPages:CalendarAggregationPanel id="AggregationPanel" runat="server"/> 
    </asp:Content> 
    
    </code> 
    
    +0

    작업중인 XML의 예와 예상되는 출력의 종류를 제공 할 수 있습니까? –

    +0

    @Ian - 답변 해 주셔서 감사합니다.여기에 쉐어 포인트 목록의 행이 있습니다. \t Matt

    +0

    행에서 중복 된 값을 숨기고 싶습니다. 순간 나는이 시험 1 개 시험과 같은 목록이 1 안녕하세요 1 새로운 목록이 코드 블록이 의견에 매우 잘 작동하지 않습니다 1 – Matt

    답변

    0

    :

    아래 셰어 디자이너에서 전체 코드를 찾아주세요 결과를 같은 문서 이름으로 작성한 다음 아래 표시된 것처럼 xml에 order by 절을 추가하여 최신 결과를 표시하십시오.

    <Query> 
           <OrderBy> 
            <FieldRef Name="Modified" Ascending="FALSE"/> 
           </OrderBy> 
           <GroupBy> 
           </GroupBy> 
          </Query> 
    
    관련 문제