Live data from Hacker News

XSLT – Native, zero-config build system for the Web

github.com

331–337 of 337 posts

Re: XSLT – Native, zero-config build system for the Web

#331
post #186

Earlier quoted context omitted.

the downside to xslt is xslt itself, and lack of maintenance of xslt support in the browser. (browsers only supports xslt 1.0 and it looks like even that may be dropped in the future, making its use not futureproof without server side support)

I'm not sure how xslt itself is a downside. It's a pretty natural template language to use if you already know HTML. You don't need more than 1.0 for your simple use-case. e.g. here's a complete example (tested in Firefox and Chrome): Page 1 Page 2 Contact Then here's a page to use it: Welcome to my page Welcome to the page! This is the content Anywhere you want more templates, you add another And now you can use you…

you are right. xslt is not that bad. especially not for simple cases. your example would be just about enough for my website. thanks for that. i have used xslt before, but that was a long time ago.

however if you read through the comments there are a lot of people complaining, so they definitely see a downside to using xslt. as for longevity, well, a search led me to a chrome proposal to remove it that was made 10 years ago and ultimately rejected at the time. so maybe you are right about that too.

Re: XSLT – Native, zero-config build system for the Web

#333
post #325
post #311

Earlier quoted context omitted.

Universal love is one factor, best tool for a job may leave only a few choices including XML. It's not my first choice, but I won't rule it out because I know how relatively flexible and capable it can be. XSLT might just need a higher abstraction level on top of it?

Perhaps it rather needs a facelift and support for JSON. I would imagine one day something regex or jq-level concise emerges, something reasonably short and descriptive, to allow transforming arbitrary tree into another arbitrary tree. The idea behind XSLT is genial, but the real essence of it is XPath which makes it possible. And we've seen XPath evolve into CSS Selectors, and being useful on its own. So in essence…

I recall seeing some libraries on github that convert back and forth between xslt and json... and another short hand version that was much clearer from Juniper I believe.

Re: XSLT – Native, zero-config build system for the Web

#334

Earlier quoted context omitted.

Can you name a non-Saxon XSLT processor? I'd really like one. Preferably, open-source.

I only know libxslt, but it's XSLT 1.0 and some of EXSLT. I don't recommend.

libxslt, despites being available widely, must not be recommended. https://lwn.net/SubscriberLink/1025971/73f269ad3695186d/

Re: XSLT – Native, zero-config build system for the Web

#335

Earlier quoted context omitted.

I just posted this in another comment: https://github.com/Juniper/libslax/wiki/Intro

SLAX is great, unfortunately it was released a bit too late. XML world is full of ugly standards and failed contenders. None remembers RelaxNG. But had reacher expressive power than XMLSchema and a human-readable syntax.

Schematron!

Re: XSLT – Native, zero-config build system for the Web

#337
post #186

Earlier quoted context omitted.

the downside to xslt is xslt itself, and lack of maintenance of xslt support in the browser. (browsers only supports xslt 1.0 and it looks like even that may be dropped in the future, making its use not futureproof without server side support)

I'm not sure how xslt itself is a downside. It's a pretty natural template language to use if you already know HTML. You don't need more than 1.0 for your simple use-case. e.g. here's a complete example (tested in Firefox and Chrome): Page 1 Page 2 Contact Then here's a page to use it: Welcome to my page Welcome to the page! This is the content Anywhere you want more templates, you add another And now you can use you…

for the record for anyone finding this in the future. this example works in firefox, but not in chromium. there it loads the page and the xsl stylesheet, but it displays an empty page.

a more elaborate example has the same results. chromium is empty. firefox works except that it looks like attributes to tags in the main content are ignored, which prevents css classes or links from working and images from loading. both work in the menu that is included from the template.

found it: the problem was that doesn't copy attributes. it needs to be:

    
      
        
      
    
oh, and the inspector doesn't work with my example, making this thing hard to debug. xsl support in the browser appears to be limited. and unfortunately, if i can't get it to work in chrome, i won't be able to use it.
Post reply on HN