-1

There are a few languages, that developed shorthand notations, notably e.g. ECMAScript can be generated from coffeescript:

CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

Are there any attempts or projects to do for XSLT what coffee represents for JavaScript? Any source-to-source compiler, transcompiler or transpiler? A project, whose description would be:

X is a little language that compiles into XSLT. Underneath that awkward XML-esque patina, XSLT has always had a gorgeous (functional) heart. X is an attempt to expose the good parts of XSLT in a simple way.

Update: Noticed a similar question on SO - but it is five years old.

3
  • 1
    There were several syntax alternatives some time ago, but they're mostly all dead AFAIK. Code is probably the canonical replacement these days. FreeMarker has tools for doing this if you want to stick to templating solutions. Commented Jul 29, 2016 at 11:11
  • @DaveNewton, yes, probably. Just came across this.
    – miku
    Commented Jul 29, 2016 at 11:35
  • Related: programmers.stackexchange.com/a/264714 Commented Jul 29, 2016 at 17:43

1 Answer 1

3

I have come across many attempts to create a "user-friendly" or "compact" non-XML syntax for XSLT over the years, and as far as I know, none of them was ever used by anyone except its inventor. Most of them have even disappeared from the web.

When you write in such a language you have some major usability difficulties to overcome. Chances are, there will be no editing tools (e.g. for auto-completion). Chances are, when you get error messages, they will be in terms of the generated XSLT rather than the original source. So why would anyone bother, just to save a few keystrokes or some perceived surface ugliness (are curly braces really that much more appealing than angle brackets?)

But there is another kind of front-end that has more justification: there's sometimes a need for a special-purpose transformation language oriented to specific tasks. I created one once specifically for conversion of Excel spreadsheets. You can create a nice custom language for that kind of task, and then implement it by either compiling it into XSLT, or by writing an interpreter in XSLT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.