XSLT Assistance
August 18, 2005 10:31 AM   Subscribe

Can anyone recommend some good sources for learning XSLT? Are there good e-mail groups or forums? Any experts who want to advise a beginner on some good getting started books or suggestions?
posted by rexruff to Technology (12 answers total)
 
Jeni Tennison has written several books and has some good introductory tutorials. I don't own it, but her Beginning XSLT book seemed useful when I paged through it at Borders (although the publisher, Wrox, has since went out of business). I bought Michael Kay's XSLT Reference, but would NOT reccomend that book for learning from scratch.

I remember that XSLT seemed very, very strange when I was first learning it. Fortunately, you can do a lot with just the basic elements... you don't have to learn the whole thing to become productive. One thing that confused me at the very beginning is that XSLT can be used both the way you use CSS (you define certain rules, such as "make this red and bold" that are applied whenever you run into an element of a certain type) and the way that you use traditional templating (like old-fashioned PHP pages... you have a page structure into which you plug dynamic content at certain defined points). The latter kind of XSL stylesheet is definitely easier to start with.
posted by gsteff at 10:49 AM on August 18, 2005


XSLT is a functional programming language. It requires a wholly different mindset than that of traditional programming languages.

Everything you need to know is easily found on the internet. There are some great reference sites. Seek and ye shall find them easily enough. zvon.org is, IIRC, one of the better ones.
posted by five fresh fish at 11:16 AM on August 18, 2005


I'll second Jeni Tennyson's site and add that what people commonly think of as XSLT is actually two specifications: XSL Transformations and XML Path Language.

I learned both from simply reading the W3C specifications, but I had a difficult time grokking how XSLT templates work until I really understood XPath and how nodes are selected from a document; most of the time your XSL fails is because you're selecting the wrong nodes and that's all about the XPath.
posted by Loser at 11:18 AM on August 18, 2005


Some of the Wrox titles were purchased by apress. Jeni Tennison's book was one of them.
posted by bachelor#3 at 12:13 PM on August 18, 2005


MSDN XSLT Reference
posted by matildaben at 12:23 PM on August 18, 2005


I think learned it mainly from this site (they also have xpath if you look around). I'm not sure that it's particularly better than any others (in fact it might be worse), but it was just the one that I happened to come across. There are really a whole lot of reference sites on the web, and if you have a reasonable programming background, I think sites like this are all that you would need.
posted by advil at 12:24 PM on August 18, 2005


I second the w3schools link. It ties everything XML together very succinctly.
posted by catkins at 1:26 PM on August 18, 2005


This XSL FAQ is very useful.
posted by hyperizer at 2:43 PM on August 18, 2005


Forget the MSDN reference, go to the brilliant ZVON XSLT Reference. The reference includes examples (here's a doc, here's the XSLT, here's the output) that can be modified in the browser -- you provide your document and/or XSLT, it shows the output. ZVON also has an XSLT tutorial. The reference is also available in Microsoft Help (.chm) format for offline browsing.

I generally recommend ZVON to all programmers; it's chock full of useful tutorials and references. In the references section they have CSS, DOM, RSS, you name it.
posted by gentle at 6:57 PM on August 18, 2005


Zvon rocks and combined with Tennison's help, is how I learned to write XSL.

In my mind, XSL/XSL:FO is three things:
* a means to apply style and add fixed tagging or content to XML markup.
* a means to identify the XML markup to which to apply the styling.
* a means to programatically manipulate the XML markup to produce new or re-arranged content.

These are also ordered by complexity. The style stuff is a no-brainer. The identification stuff is XPath and can be a bit of a brainfuck when you're trying to be fancy. The programmatic stuff is the functional programming part, and is a complete overturning of all one knows about programming.
posted by five fresh fish at 11:27 AM on August 19, 2005


Beginning XSLT is very helpful, as is Loser's point that to make XSLT useful you need to learn the pieces that comprise/ surround it.
posted by yerfatma at 2:15 PM on August 19, 2005


The syntax, while verbose, is pretty simple, all things considered. XPath felt very natural to me, and very powerful. (Trust the square brackets, they'll let you skip tons of if then when otherwise etcetera logic. It's all about the square brackets.)

I learned from the Wrox XSLT Programmer's Reference, because it was the only one available at the time. It's fine. I would not recommend the O'Reilly XSLT or XSLT Cookbook titles -- normally I'm a complete sucker for any of their books, but this time around they just missed the mark; XSLT seems lightweight compared to Wrox, and the Cookbook is especially bad; it's mostly full of recipes for things you'll never, ever, ever need to do.

The hard part about XSLT, the one unavoidable hurdle, is learning to love recursion. You can't set new variables, so if you're used to doing everything in for/next loops, you're in for some rough times. Wrap your head around recursion, memorize the name "Muenchian grouping" so you can google for it when you forget how it's done -- I do every time I need it -- and you'll be all set.
posted by ook at 3:40 PM on August 19, 2005


« Older Discount broker for Toronto Stock exchange   |   How do I stop sweating? Newer »
This thread is closed to new comments.