none
XPath expression question

    Question

  • Dears,

    I have a Current User Filter Webpart connected with a DataFormWebPart filterring by the current user.

    I have set the Xpath expression for my DataFormWebPart below, but why i get nothing, thanks for any inputs.


    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[substring(@FileLeafRef,21,7)=substring($CurrentAgencyID,24)]"/>

    @FileLeafRef is the field that for file name like 'Agency Daily Report (8000001-2009-06-18).txt'
    $CurrentAgencyID is the parameter from current user filter webpart like 'agentmembershipprovider:8000001'

    I really don't understand why give me nothing.
    Chong
    • Moved by Mike Walsh FIN Tuesday, June 23, 2009 4:31 PM cust q (From:SharePoint - Development and Programming)
    Tuesday, June 23, 2009 3:56 PM

Answers

  • Fixed by myself,

    I don't know why Sharepoint is different than .Net

    The Query must be like this
    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[substring(@FileLeafRef,22,7)=substring($CurrentAgencyID,25)]"/>

    It seems like the substring of Sharepoint count from 1 not 0.

    If someone knows more details pls let us know.
    Chong
    • Marked as answer by Rosefinch Tuesday, June 23, 2009 4:34 PM
    Tuesday, June 23, 2009 4:33 PM

All replies