Presentation is loading. Please wait.

Presentation is loading. Please wait.

#RefreshCache Effective XSLT Making use of XSLT to better customize your data. Daniel Hazelbaker Information Technology Manager High Desert Church Email:

Similar presentations


Presentation on theme: "#RefreshCache Effective XSLT Making use of XSLT to better customize your data. Daniel Hazelbaker Information Technology Manager High Desert Church Email:"— Presentation transcript:

1 #RefreshCache Effective XSLT Making use of XSLT to better customize your data. Daniel Hazelbaker Information Technology Manager High Desert Church Email: daniel@highdesertchurch.com

2 What is XSLT? XSLT is used to transform an XML document into another XML document, or another type of document that is recognized by a browser, like HTML. XSLT uses XPath to reference the elements inside the XML document.

3 Common Element Functions

4 Full Element Function List

5 XSLT/XPath Basics “group” – All node elements whose name is “group” “@name” – The “name” attribute of the current node “group[@active = 1]” – All node elements whose name is “group” and has an attribute called “active” whose value is 1.

6 XSLT/XPath Basics (cont.) “group/member” – All node elements whose name is “member” and whose parent node name is “group” (that is, all group members). “group[@active = 1]/member[@firstname = ‘Daniel’]” – All small group members whose first name is “Daniel” and is a member of a currently active group. “group[@active = 1 and contains(@name, ‘Victorville’)]” – All small groups which are active and whose name contains the word “Victorville”

7 Using ‘if’ statements

8 Using ‘choose’ statements

9 Using Parameters no <![CDATA[... ]]>

10 Looping through a list More Info

11 Embedding Javascript or CSS <![CDATA[ $(document).ready(function() { alert('Document is ready!'); }); ]]>

12 Comparison Operators andLogical-and (&&) author[degree and award] orLogical-or (||) author[degree or award] =Equality (==) @attribute = ‘yes’ !=Not equal (!=) @attribute != ‘yes’

13 Comparison Operators (cont.) <Less than (<) book[@price < 20] <=Less than or equal (<=) book[@pages <= 400] >Greater than (>) book[@price > 20] >=Greater than or equal (>=) book[@pages >= 400]

14 XPath Functions count() id() last() local-name() name() namespace-uri() position() concat() contains() normalize-space() starts-with() string() string-length() substring() substring-after() substring-before() translate() boolean() false() lang() not() true() ceiling() floor() number() round() sum()

15 Counting Tiny Small Groups There are small groups with less than 6 members.

16 Debugging for-each loops Processing element number of...

17 Cheat Sheets http://www.refcards.com/subject/xml – XPath by DeepX Ltd – XSLT 1.0 Quick Reference by DeepX Ltd


Download ppt "#RefreshCache Effective XSLT Making use of XSLT to better customize your data. Daniel Hazelbaker Information Technology Manager High Desert Church Email:"

Similar presentations


Ads by Google