XSLT or Velocity

Fernando's Avatar

Fernando

29 Oct, 2014 02:28 PM

I recently started using cascade around 3 months ago. I am use to the CMS interface, and i understand how all of the content types work in favor with template files. The one thing I have being working on is learning XSLT and Velocity, I have found myself to be more familiar with XSLT than Velocity. My question is if I where to invest my time into learning in depth one coding language which one would be the most beneficial to learn? XSLT or Velocity? I did some google research and it seems that you guys are moving more towards velocity since it is easier to write than XSLT and when writing functions you can implement javascript and php but i guess for beginners what is a better starting point XSLT or Velocity?

Thanks!

  1. 1 Posted by Eric L. Epps on 29 Oct, 2014 03:26 PM

    Eric L. Epps's Avatar

    I'd definitely suggest putting some time into learning Velocity. HH has been more actively developing it, adding great features like the Locator Tools and Query API, so there's a lot more you can do with that. For me, it's still much easier to whip up a quick XSLT for simpler tasks but I use Velocity more and more for the more complex transformations.

  2. 2 Posted by Wing Ming Chan on 29 Oct, 2014 04:27 PM

    Wing Ming Chan's Avatar

    I don't have any bad feeling toward Velocity. In fact, I am currently exploring its Java side (by writing Java classes to be used by Velocity). But there is one thing that I can do with XSLT but not with Velocity: template formats. I use them for rendering every page, and they cannot be written in Velocity--not until HH decides to make it possible.

    Wing

  3. 3 Posted by Fernando on 29 Oct, 2014 08:49 PM

    Fernando's Avatar

    Thanks for the suggestions, makes sense. Looking over Velocity files it seems to be a lot easier to read and understand than XSLT specially since javascript and php to it. What are the best place to start learning velocity? Do I go through Java training course and then move towards velocity? or do you guys know of a place a website that i can learn velocity from?

    Thanks again!

  4. 4 Posted by Fernando on 29 Oct, 2014 08:52 PM

    Fernando's Avatar

    I understand and agree with you guys. Initially I started working with XSLT because I was able to find plenty of information in it but couldn't really find any reference for velocity outside there website which it seems to be mostly general information but no tutorials. Do you guys suggest me going through basic Java tutorials and then move towards velocity or a different place?

    Thanks!

  5. 5 Posted by Wing Ming Chan on 29 Oct, 2014 09:25 PM

    Wing Ming Chan's Avatar

    Velocity does not look like Java, so that you don't have to know Java to use it efficiently. You may want to start with the book written by Jamie Johnson. You may also want to check Apache Velocity Project for more details.

    Wing

  6. 6 Posted by Ryan Griffith on 30 Oct, 2014 05:22 PM

    Ryan Griffith's Avatar

    Hi Fernando,

    I wanted to add that you may find the Velocity and XSLT Showdown session by Alvin Chao and Jason at the 2013 User's Conference helpful for a quick comparison of the two languages.

    You can find the video here and the slides here.

    From personal experience, I wouldn't count out one over the other, because they both have their advantages and disadvantages. If you can learn some of both, you definitely can't go wrong.

  7. 7 Posted by Wing Ming Chan on 30 Oct, 2014 05:33 PM

    Wing Ming Chan's Avatar

    I absolutely agree. I don't plan to rewrite all my XSLT formats using Velocity.

    There is one more thing that is possible with XSLT but not with Velocity. I can read an XSLT format, using web services, from Cascade, and transform some XML definition, also read from Cascade (for example, data definition, or workflow definition), and transform the definition into something like SVG XML to be embedded in a page. This can be done on the server, though all the data comes from Cascade. I don't have the slightest idea how to do this with Velocity.

    Wing

  8. Ryan Griffith closed this discussion on 10 Nov, 2014 08:25 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac