开发者

Creating an XPath Expression in SharePoint's "Add Formula Column" based on meta data

开发者 https://www.devze.com 2023-02-13 13:25 出处:网络
OK, So this is my first post to stack overflow, and I DID search and couldn\'t find exactly what I was looking for with regard to my question (although I might be terrible at searching). Essentially

OK,

So this is my first post to stack overflow, and I DID search and couldn't find exactly what I was looking for with regard to my question (although I might be terrible at searching). Essentially, this is my first pass at Xpath expressions and I honestly am having a tough time creating an if/else statement.

I have a DWVP that is displaying a list of documents from a document library on separate site. I have a column that notes whom a document is checked-out to (if it is checked-out), and if that document is checked out, I have conditional formatting that will highlight the row.

All is well so far. I have a list of documents that have a bunch of meta data and one or two of the rows in this list is highlighted yellow because they are checked-out, and the users name is listed in the "@checkedouttouser" column.

My issue is that I want to create another column (I'm assuming a formula column) within this DVWP that will display a link to the source document library (specifically with a view enabled that filters the content to "checked out to" [ME], but that's no issue) if the column "@checkedouttouser" has anything in it.

My thought process here is that this new formula column will check to see if anything is written (or alternatively not written) in this column, and if so it will create a link that says "Check-In this Document". So if you look at the DVWP, you will see a yellow row that indicates that the document has been checked out, and since it is yellow and since it is checked out, the right-hand most formula column will show a link that says "Check-In this Document".

I have never written an Xpath expression before, but got somewhere with the following expression:

if /@CheckedoutToUser!=" ",

I ha开发者_StackOverflow中文版ve a feeling it will start something like that?

What would this expression look like?!


not quite sure what you want to do, a little bit of the xslt and the xml would help

<xsl:if test="@CheckedOutToUser"><span>add extra content<span></xsl:if>

If you need to display the underlying xml from your page, the deprecated tag

<xmp><xsl:copy-of select="." /></xmp>

will do the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消