Smooks – A Java Based Alternative to XSLT?

Discussions

News: Smooks – A Java Based Alternative to XSLT?

  1. Smooks – A Java Based Alternative to XSLT? (21 messages)

    Smooks was built out of an interest in exploring an XML Transformation Solution based on Java. A solution that can allow organisations that already have a high degree of expertise in Java to reuse these skills to build transformation solutions that are more maintainable, and higher performing, than solutions they might produce using technologies they have less experience with.

    The primary goals behind the development of Smooks were as follows:
    • Componentised Transformation Logic in Java: To develop a component based framework for developing, and applying, componentised transformation logic in Java.
    • Context Aware Transformations: To develop a framework that allows different transformation logic to be applied to an XML Document depending on the context in which the transformation is being performed e.g. application of different transformation logic to web content based on the requesting browser make, capabilities etc.
    What do you think? Could Smooks be an option for you? We're very interested in all feedback on this project!

    Threaded Messages (21)

  2. Pretty Weak Documentation[ Go to top ]

    For something so intriguing the documentation is a little sparse in my opinion.....
  3. Pretty Weak Documentation[ Go to top ]

    For something so intriguing the documentation is a little sparse in my opinion.....

    *nod* I tried looking at it, but only having the javadocs as a resource quite put me off. I think a 5-10 minute tutorial should be added to show how it's used in practice.
  4. Pretty Weak Documentation[ Go to top ]

    For something so intriguing the documentation is a little sparse in my opinion.....
    *nod* I tried looking at it, but only having the javadocs as a resource quite put me off. I think a 5-10 minute tutorial should be added to show how it's used in practice.

    I was hoping that the Chiba Integration Notes would provide this sort of info. I guess what you're saying is that it doesn't. Any suggestion for a format that might suit this project??

    There's also the CNN Mobility Sample which includes a QuickTime video.

    Thanks Geert.
  5. Pretty Weak Documentation[ Go to top ]

    The Chiba integration assumes familiarity with Chiba, with not many people will have. I suggest you write out a tutorial for dummies that focuses on the core features: how to transform XML with Smooks with short and to the point sample snippets. A comparison with XSLT there would also be a good idea, since that is what most people already know.

    Just my 2c
  6. Pretty Weak Documentation[ Go to top ]

    The Chiba integration assumes familiarity with Chiba, with not many people will have. I suggest you write out a tutorial for dummies that focuses on the core features: how to transform XML with Smooks with short and to the point sample snippets. A comparison with XSLT there would also be a good idea, since that is what most people already know.Just my 2c

    Fair point, thanks Geert.

    On this, are you saying that the documentation has complete failed? Has it made any impression on you in the sense of how you might use it? It disappoints me to hear people say the docs are poor because it is something I put a lot of effort into - obviously not my forte :-(
  7. Pretty Weak Documentation[ Go to top ]

    It disappoints me to hear people say the docs are poor because it is something I put a lot of effort into - obviously not my forte :-(

    Lack of documentation allows people to dismiss your effort.
  8. Pretty Weak Documentation[ Go to top ]

    On this, are you saying that the documentation has complete failed? Has it made any impression on you in the sense of how you might use it?

    Honestly, yes it failed. I spent 5 minutes looking around for something useful and clear to read, and couldn't find that. The Javadocs I saw left me a "yeah, so what" impression without grasping what Smook's real benefits are (I'm sure they are present, just not clear to me with the available docs).

    For something as focused as an XML processing library, looking at the PicoContainer tutorials might help you:
    http://www.picocontainer.org/5.1+Tutorials
    (not saying anything about the Pico project itself, just that it's easy to see what to do with it)
  9. Pretty Weak Documentation[ Go to top ]

    For something as focused as an XML processing library, looking at the PicoContainer tutorials might help you:http://www.picocontainer.org/5.1+Tutorials(not saying anything about the Pico project itself, just that it's easy to see what to do with it)

    I'm hearing you Geert, thanks for your honesty.
  10. Pretty Weak Documentation[ Go to top ]

    For something so intriguing the documentation is a little sparse in my opinion.....

    Point taken in the sense that the right sort of documentation may not be as up front as it should be. I think this may be a symptom of the fact that I've been working on this on my own and so perhaps the observation you've made is not as obvious to me.

    It's early stages for this project but I think you'll find that there's quite a bit of documentation there. I guess I need to pull chunks up from the Javadoc and onto the web to make it more accessible.

    Thanks for the feedback Michael!
  11. I gave the examples a short look, but indeed, for people that want a quick idea/ impression what the project is all about a short annotated example on your site would make a big difference.
  12. I gave the examples a short look, but indeed, for people that want a quick idea/ impression what the project is all about a short annotated example on your site would make a big difference.

    Thanks Eelco. I'm going to build a short tutorial/sample on the site ASAP. Hopefully I'll get it up there in time for you guys to see it and give some feedback.

    Thanks again all!
  13. Tutorial now posted...[ Go to top ]

    Based on the advice from all who have been kind enough to provide feedback, I've posted a Two Minute Tutorial.

    I hope this helps to make things clear!
  14. Tutorial now posted...[ Go to top ]

    Based on the advice from all who have been kind enough to provide feedback, I've posted a Two Minute Tutorial.I hope this helps to make things clear!

    Thanks a lot, that helped. Looks useful.

    One taste remark: <cdres uatarget="...
    Imo, that's a bit cryptic. As this is just configuration data, there wouldn't be much wrong with making those names longer?

    Does the framework depend on those definitions being there, or can they be configured programatically too? Just curious :)
  15. Tutorial now posted...[ Go to top ]

    Thanks a lot, that helped. Looks useful.One taste remark: <cdres uatarget="...Imo, that's a bit cryptic. As this is just configuration data, there wouldn't be much wrong with making those names longer?

    I'd tend to agree with you. It's something I had been planning to do.
    Does the framework depend on those definitions being there, or can they be configured programatically too? Just curious :)

    You can. Smooks executes within a container (see javadoc). For unit testing purposes I put together a very simple Mock container implementations that can be primed by the test code.

    Not sure of the value of it in practice, but it wouldn't be a big task to create a more formal container within the framework for executing Smooks transformations in this way.

    Thanks Eelco.
  16. Tutorial now posted...[ Go to top ]

    ... it wouldn't be a big task to create a more formal container within the framework for executing Smooks transformations in this way.

    Actually, this could be made to work with a few small enhancements to the Standalone Container. Currently it's initialised with a "baseDir" telling it where to fond this configuration data. It could easily be extended such that this data could be supplied programmatically.
  17. As far as transformations go, you can do most things with XSLT, and the performance is not appalling if you reuse your compiled stylesheets. It is always the last 10% that get you though and you start crying for things like Java.

    The performance issue can be fine, but the usability of XSLT can be abysmal when the transformations get tricky. I would also like to reuse what I have done in Java to make the transformations happen.

    Velocity has a subproject that might ease this pain:

    http://jakarta.apache.org/velocity/dvsl/index.html

    I just never tried it and don't know what the support is for it. Apparently it looks and feels like XSLT, including the 'templating' idea, but at any time you can resort to velocity scripting and access your java components.
  18. As far as transformations go, you can do most things with XSLT, and the performance is not appalling if you reuse your compiled stylesheets.

    I'm not trying to spin this as a Smooks Vs XSLT thread. I'm simply offering it up as an alternative to XSLT. Many people are very happy with XSLT. I'm not even trying to say that Smooks is an alternative in all usecases.
    Velocity has a subproject that might ease this pain:http://jakarta.apache.org/velocity/dvsl/index.htmlI just never tried it and don't know what the support is for it. Apparently it looks and feels like XSLT, including the 'templating' idea, but at any time you can resort to velocity scripting and access your java components.

    The main difference between Smooks and technologies such as XSLT and Velocity (as I see it) is that these technologies are true templating solutions. The build a new document from an existing XML document, or Java object tree. Smooks takes an pre-constructed XML document and allows manipulation of the source. Hopefully that makes sense!

    Thanks Tero.
  19. Velocity has a subproject that might ease this pain
    I believe Freemarker also can be used as an XSLT replacement though I haven't tried it myself.
    I imagine that Smooks could be handy for some tasks (not xhml rendering) that don't require huge amounts of different output elements.
    Perhaps a simple Hello World type example would be helpful?
  20. I imagine that Smooks could be handy for some tasks (not xhtml rendering) that don't require huge amounts of different output elements.

    As I currently see it, the likes of Chiba (an XForms Engine for supporting XForms on browsers without XForms support) is a good example of where Smooks can be used to good effect. Chiba generates XForms + XHTML which is filtered by Smooks. Smooks transforming the XForms components of the document to standard forms for browsers without XForms support, leaving the rest of the document content unmodified.

    So from that point of view, Smooks does render XHTML, but it's typically not responsible for building the full XHTML document - it relies on something else to do that (e.g. a web framework).
    Perhaps a simple Hello World type example would be helpful?

    Sure, I need to put together some tutorials. I have most/all the material but I need to pull it into a more digestible form.
  21. This might be a starting point to understand a little bit how it works with fair effort:

    http://www.milyn.org/javadoc/smooks/org/milyn/delivery/SmooksXML.html
  22. Those docs are linked all over the Smooks homepage so I'm guessing people still find them difficult to use?