Elio struyf introduction-xslt-spsbe07

19
Elio Struyf An introduction to XSLT in SharePoint #SPSBE #SPSBE07

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

Page 1: Elio struyf introduction-xslt-spsbe07

Elio Struyf

An introduction to XSLT in SharePoint

#SPSBE

#SPSBE07

Page 2: Elio struyf introduction-xslt-spsbe07

About me

• Elio Struyf

• SharePoint Consultant at Xylos

• Brander / Developer

• Twitter: eliostruyf

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

@eliostruyf - #SPSBE07

Page 3: Elio struyf introduction-xslt-spsbe07

A big thanks to our sponsors

Venue Sponsor

Platinum Sponsors

Gold Premium Sponsors

Gold Sponsors

@eliostruyf - #SPSBE07

Page 4: Elio struyf introduction-xslt-spsbe07

Agenda

• What is XSLT?

• Why use XSLT?

• Where to begin

• Demo’s

@eliostruyf - #SPSBE07

Page 5: Elio struyf introduction-xslt-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

Page 6: Elio struyf introduction-xslt-spsbe07

COMPARISON WITH CSS

@eliostruyf - #SPSBE07

Page 7: Elio struyf introduction-xslt-spsbe07

WHAT IS XSLTXML Data

XSL Stylesheet

Output

Processor

Page 8: Elio struyf introduction-xslt-spsbe07

XSLT EXAMPLE

http://bit.ly/HwJv7G

@eliostruyf - #SPSBE07

Page 9: Elio struyf introduction-xslt-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

Page 10: Elio struyf introduction-xslt-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

Page 11: Elio struyf introduction-xslt-spsbe07

DEMOData View Web Part: Selecting data

@eliostruyf - #SPSBE07

Page 12: Elio struyf introduction-xslt-spsbe07

SELECTING DATA

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

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

@eliostruyf - #SPSBE07

Page 13: Elio struyf introduction-xslt-spsbe07

DEMOList View: Statements

@eliostruyf - #SPSBE07

Page 14: Elio struyf introduction-xslt-spsbe07

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

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

@eliostruyf - #SPSBE07

Page 15: Elio struyf introduction-xslt-spsbe07

DEMOTwitter Demo

@eliostruyf - #SPSBE07

Page 16: Elio struyf introduction-xslt-spsbe07

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

• “<“ ”&lt;”

• disable-output-escaping=“yes”

• “<“ “<“

@eliostruyf - #SPSBE07

Page 17: Elio struyf introduction-xslt-spsbe07

DEMOFiddler – Retrieving the raw XML

http://bit.ly/IrsPwU

@eliostruyf - #SPSBE07

Page 18: Elio struyf introduction-xslt-spsbe07

THANK YOU!Feedback via Twitter: #SPSBE07

@eliostruyf - #SPSBE07

Page 19: Elio struyf introduction-xslt-spsbe07

We need your feedback!

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

Our sponsors: