Question about parsing string in xsl file

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am editing an xsl file used to style a page in the Productivity Hub site in Sharepoint 2010.
I have the following:
/_layouts/WordViewer.aspx?id={@FileRef} <xsl:value-of select="@Title"/>
The problem with this is that not all of the files in the document library are .docx files. I need to conditionally change the web service reference based on the file extension specified in @FileRef.

@FileRef contains the name of the file that ends with either .xlsx, .docx, or .pptx (other extensions may also exist).
I need to parse the last 5 characters of @FileRef and conditionally place the following in the url:
.docx: /_layouts/WordViewer.aspx?id=<br/>
.xlsx: /_layouts/xlviewer.aspx?id=<br/>
.pptx: _layouts/PowerPoint.aspx?PowerPointView=ReadingView&PresentationId=

How would I go about accomplishing this?


<br/>

View the full article
 
Back
Top