Elio struyf introduction-xslt-spsbe07

Post on 31-May-2015

364 views 1 download

Tags:

description

The session gives an introduction on using XSLT or Extensible Stylesheet Language Transformations (http://www.w3.org/TR/xslt) in your SharePoint environment, and focuses on SharePoint users which have never used XSLT. XSLT can be used for transforming structured information like XML. You will learn how to retrieve the XML from a particular SharePoint list, and how to transform your list data with the help of a Data View Web Part to in another format like HTML. The last step is to transform some external data, like for example a Twitter search feed.

Transcript of Elio struyf introduction-xslt-spsbe07

Elio Struyf

An introduction to XSLT in SharePoint

#SPSBE

#SPSBE07

About me

• Elio Struyf

• SharePoint Consultant at Xylos

• Brander / Developer

• Twitter: eliostruyf

• Blog: http://estruyf.be/blog

@eliostruyf - #SPSBE07

A big thanks to our sponsors

Venue Sponsor

Platinum Sponsors

Gold Premium Sponsors

Gold Sponsors

@eliostruyf - #SPSBE07

Agenda

• What is XSLT?

• Why use XSLT?

• Where to begin

• Demo’s

@eliostruyf - #SPSBE07

Value = 1Value = 3Value = 5Value = 8Value = 2Value = 1

Total = 20

WHAT IS XSLT

• Extensible Stylesheet Language Transformations• Transforming XML data into something else, ex: HTML

• XSLT >= CSS

First name

Last name

Last name

First nameCombined

XML Doc 1

XML Doc 2

@eliostruyf - #SPSBE07

COMPARISON WITH CSS

@eliostruyf - #SPSBE07

WHAT IS XSLTXML Data

XSL Stylesheet

Output

Processor

XSLT EXAMPLE

http://bit.ly/HwJv7G

@eliostruyf - #SPSBE07

WHY USE XSLT?• It allows you to filter and sort the data

• Apply your own styling and formatting

• Style your data in different formats

• Doing calculations

• Easy to use in SharePoint

@eliostruyf - #SPSBE07

START USING IT!• Good to know: SP 2007 / 2010 = XSLT 1.0

• SP2010 List views are created with XSLT

• “XSLT is a tool, not a religion” – Doug Tidwell

@eliostruyf - #SPSBE07

DEMOData View Web Part: Selecting data

@eliostruyf - #SPSBE07

SELECTING DATA

• <xsl:value-of select="@Priority" />

• <xsl:value-of select="substring-after(@Priority, ') ')" />

@eliostruyf - #SPSBE07

DEMOList View: Statements

@eliostruyf - #SPSBE07

CONDITIONAL FORMATING• If Statements: <xsl:if test=“”></xsl:if>

• Choose Element: <xsl:choose><xsl:when test=“”/><xsl:otherwise /></xsl:choose>

@eliostruyf - #SPSBE07

DEMOTwitter Demo

@eliostruyf - #SPSBE07

SHOW HTML CONTENT• disable-output-escaping=“no”

• “<“ ”&lt;”

• disable-output-escaping=“yes”

• “<“ “<“

@eliostruyf - #SPSBE07

DEMOFiddler – Retrieving the raw XML

http://bit.ly/IrsPwU

@eliostruyf - #SPSBE07

THANK YOU!Feedback via Twitter: #SPSBE07

@eliostruyf - #SPSBE07

We need your feedback!

Scan this QR code or visit http://svy.mk/sps2012be

Our sponsors: