Paul Galvin's (old) SharePoint space [SharePoint

Just another WordPress.com site

Will the real XPath step forward?

Overview:

Created a custom list that manages a content type with some dozen columns.

Added it to a page and then via SPD, converted into a data view.

Problem:

My Xpath expression was returning blank for a column named "Current Position".  I referenced it thusly:

    <table border="1">
      <xsl:for-each select="/dsQueryResponse/Rows/Row" >
        <tr>
          <td>
            Current Status:
            <xsl:value-of select="@Current_x0020_Status"></xsl:value-of>
          </td>
        </tr>
      </xsl>
    </table>

The column in the CT is named "Current Status".  It shows up in the lookup as "Current Status".  Everywhere you look, you see "Current Status".

While thrashing madly about, looking for a solution, I instead referred to "@Recruiter" and behold! — that actually returned back the current status.  I expected it to return back the recruiter when I did that.

Solution:

I poked about in SPD.  Go to that page in SPD and it shows the data view.  You can inspect the actual data provided to the view and associated Xpath.  Here I found out that indeed, the Xpath pointed at "Recruiter".  Strangely enough, the "actual" recruiter field pointed from "Recruiter1".

Take Away:

SPD provides authoritative Xpath expressions for rows & columns in a data view.

Second, it shows the actual data.  So for example, a column of type shows this:

<nobr><span><A HREF="/sites/Corporate/HumanResources/TalentAcquisition/_layouts/userdisp.aspx?ID=17">Galvin, Paul</A><img border="0" height="1" width="3" src="/_layouts/images/blank.gif"/><a href=’javascript:’ onclick=’IMNImageOnClick();return false;’ class=’ms-imnlink’><img name=’imnmark’ title=” border=’0′ height=’12’ width=’12’ src=’/_layouts/images/blank.gif’ alt=’No presence information’ sip=’PGalvin@xxx.com’ id=’imn_77,type=smtp’/></a></span></nobr>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: