title: Tips & Traps in Learning XSLT and "Real" Functional Programming?
body: <p>Until recently my knowledge of XSLT was enough for my simple, straightforward needs.  But a more advanced requirement sent me to reference material when "just trying stuff" didn't work.  It was actually fun starting over at the beginning.  I initially learned XSLT in the middle of deadline pressure and in 20/20 hindsight "working" was clearly more important than "understanding."  </p>
  
  <p>I was surprised to read on page 33 of <a href="https://rads.stackoverflow.com/amzn/click/com/0764543814" rel="nofollow noreferrer" rel="nofollow noreferrer">Michael Kay's book</a> that XSLT has its roots in Scheme.  Wikipedia says,  </p>
  
  <blockquote>
    <p>Scheme is one of the two main dialects of the programming language Lisp.  </p>
  </blockquote>
  
  <p>Maybe I know (or will soon know) more about functional programming than I thought I did.  Searching SO for posts like <a href="https://stackoverflow.com/questions/110031/is-xslt-a-functional-programming-language">Is XSLT a functional programming language?</a> and following its working links show there are several opinions whether or not XSTL is a functional language.  From the post <a href="https://stackoverflow.com/questions/2179263/which-functional-programming-language-should-i-choose-as-first-functional-program">Which functional programming language should I choose as first functional programming language?</a>  I got the advice to learn F# first because I come from .NET and I like to get to useful programs quickly.  </p>
  
  <p>My first question is, if someone knows XSLT 2.0 very well, how much of a "real" functional programming language such as F#, Lisp or Haskell does the person already know before learning F#, Lisp or Haskell?  For purposes of discussion assume a person who "Knows XSLT 2.0 very well" learns very few new concepts the first time she reads the <a href="https://rads.stackoverflow.com/amzn/click/com/0596009747" rel="nofollow noreferrer" rel="nofollow noreferrer">XSLT Cookbook</a>.  Instead her reaction to unfamiliar information is, "Of course that's a good way to do that.  I should have thought of that!"</p>
  
  <p>The second question is, are there parts of XSLT 2.0 / XPATH 2.0 I should make sure I understand very well to make learning F# / Lisp / Haskell easier?</p>
  
  <p>Third, are there parts of XSLT that are best ignored if one plans to eventually learn F# / Lisp / Haskell / etc.?  That is, does XSLT have concepts analogous to GOTO, ALTER and ON ERROR RESUME NEXT that are not appropriate in "real" functional programming languages?</p>
  
  <p>Brief answers are fine because learning a functional programming language is an unscheduled future project for me.</p>
  
  <p>P.S. Several hyperlinks removed for lack of reputation.  Drat!  ;-)</p>