2. About me
• Elio Struyf
• SharePoint Consultant at Xylos
• Brander / Developer
• Twitter: eliostruyf
• Blog: http://estruyf.be/blog
@eliostruyf - #SPSBE07
3. A big thanks to our sponsors
Platinum Sponsors
Gold Premium Sponsors Venue Sponsor
Gold Sponsors
@eliostruyf - #SPSBE07
4. Agenda
• What is XSLT?
• Why use XSLT?
• Where to begin
• Demo’s
@eliostruyf - #SPSBE07
5. WHAT IS XSLT
• Extensible Stylesheet Language Transformations
• Transforming XML data into something else, ex: HTML
• XSLT >= CSS
Value = 1
XML Doc31
Value =
First name Last name
Value = 5 Combined
XML name
Last Doc82 Total = 20
First name
Value =
Value = 2
Value = 1
@eliostruyf - #SPSBE07
8. XSLT EXAMPLE
http://bit.ly/HwJv7G
@eliostruyf - #SPSBE07
9. 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
10. 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
11. Data View Web Part: Selecting data
DEMO
@eliostruyf - #SPSBE07
19. We need your feedback!
Scan this QR code or visit
http://svy.mk/sps2012be
Our sponsors:
Notas del editor
TwoKeywords: Stylesheet – TransformationsXSLT canbecomparedwith CSS, but it is more powerful. They are bothusedtotellhoweach element shouldbedisplayed.XSLT is based on pattern matching. It mainlycontains templates that are usedtotransform the document.CSS cannot do forexample:Change the elements order in whichtheyappear in the document;Cannot do computations, ifyou want tocalculateand output a value;Cannot combine multiple documents.
Processor:- Client Side – on the fly: http://www.w3schools.com/xsl/xsl_client.asp- Server Side (SharePoint)Test XSLT online tool: http://xslttest.appspot.com/<?xml version="1.0" ?><greeting> Welcome to the #SPSBE07 session!</greeting><?xmlversion="1.0" ?><xsl:stylesheetversion="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:outputmethod="html" /> <xsl:template match="/"> <html> <body> <xsl:apply-templates select="greeting" /> </body> </html> </xsl:template> <xsl:template match="greeting"> <h1> <xsl:value-of select="." /> </h1> </xsl:template></xsl:stylesheet>
You do notdepend on the XML structure.
Normallyyouneedtocreate a separate XSL file, butwith SharePoint Designer thisprocessisn’tneeded.
Optional. "yes" indicates that special characters (like "<") should be output as is. "no" indicates that special characters (like "<") should be output as "&lt;". Default is "no"