Chapter 7

Adding Programming Logic Isn’t Just for Propheads

In This Chapter

bullet Finding out about conditional and looping structures

bullet Testing for conditions with xsl:if

bullet Deciding among a set of conditions with xsl:choose

bullet Looping through a set of nodes with xsl:for-each

A re you a prophead? (Prophead is short for propeller head or geek.) If you aren’t sure, I’m going to give you a simple test that can tell you exactly whether you qualify. Here goes:

if-else

for 

while 

switch-case 

When you read those lines, what was your reaction? Did you have a quizzical look on your face? Did you groan? A nod of the head? Or perhaps you screamed out in excitement and felt your pulse racing?

Well, if you cried out in exultation and felt your heart skipping a beat, my guess is that you’ve got programming in your blood and are as “excited as a prophead” about getting into a discussion on adding programming logic to your XSLT stylesheets.

Kidding aside, no matter your reaction, I think you’ll find this chapter to be extremely useful to expand the scope of what you can do with XSLT.

Conditional ...

Get XSLT for Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.