Live data from Hacker News

Show HN: I Built a XSLT Blog Framework

vgr.land

41–50 of 71 posts

Re: Show HN: I Built a XSLT Blog Framework

#41
post #6

The core concept behind XSLT is evergreen: Being able to programmatically transform the results of a HTTP request into a document with native tools is still useful. I don't foresee any equivalent native framework for styling JSON ever coming into being though.

If I'm not mistaken, XSLT 3 works with JSON too. It'd be nice to see that shipped in browsers instead of seeing v1 removed.

Re: Show HN: I Built a XSLT Blog Framework

#42

I wonder why everybody want's to use XSLT on the client side. On te Server side it is so powerful and works like a charme with PHP: // XML $xml_doc = new DOMDocument(); $xml_doc->load("file1.xml"); // XSL $xsl_doc = new DOMDocument(); $xsl_doc->load("file.xsl"); // Proc $proc = new XSLTProcessor(); $proc->importStylesheet($xsl_doc); $newdom = $proc->transformToDoc($xml_doc); // Output print $newdom->saveXML();

> I wonder why everybody want's to use XSLT on the client side

Because if you can remove any server processing, it's just the perfect solution for simple websites.

Re: Show HN: I Built a XSLT Blog Framework

#43

Nice one! Although it seems that the engineers at the different browser vendors are committed to remove XSLT due to reasons outlined here [1]. It's a shame these Discussions got so heated, but that's just the nature of the internet, I guess. [1]: https://github.com/whatwg/html/issues/11523#issuecomment-318... //Edit: Rephrased "PRs" to "Discussions".

There is a related issue to instead add XSLT 3 support [1]

[1] https://github.com/whatwg/html/issues/11578

Re: Show HN: I Built a XSLT Blog Framework

#44
post #25

Earlier quoted context omitted.

Fortunately! It was cool to do the easy things, but then you had monstruous path expressions, and all sort of programmatical drama.. Pfff... did you know that XSLT was shown to be Turing complete ? https://staff.emu.edu.tr/zekibayram/Documents/papers/XSLT_Tu... On the other side, I find XML/XSD still much better than JSON. JSON is way too simple...

Depends on the task, JSON won because it was so simple whilst XML is waaay to complex. Maybe an alternative to JSON with just a tad more complexity for sanity could have won 20 years ago, but alas it never happened.

JSON is less complex because it only solves some of the problems that XML solves. That doesn't make it better or worse, but adding schema support or attempting to make REST APIs with JSON because complex, and IMO fragile, quickly.

Re: Show HN: I Built a XSLT Blog Framework

#45

Lighthouse score 0 .. I wonder what are implications on SEO.

Probably abysmal Since xslt is built dynamically in the DOM most crawlers don’t build the site and pick up the metadata. Although I’m not convinced chasing SEO is a useful endeavor any more https://housefresh.com/beware-of-the-google-ai-salesman/ I wonder if AI crawlers would have the same problem and pass over the site

As long as the LLM crawler fetches the XML in the first place I assume it would be fine. Lighthouse is trying to score the rendered HTML, the LLM just needs to understand what's in the document and it can parse the XML directly.

Re: Show HN: I Built a XSLT Blog Framework

#46
post #3

It's nice to see this. Things used to be simple! (XSLT itself should've been simpler of course). BTW, as I commented on earlier HN threads re: removal of XSLT support from HTML spec and browswers, IBM owns a high-performance XSLT implementation that they may want to consider contributing to one or more browsers. (It is a JIT that generates machine code directly from XSLT and several other data transformation and poli…

> XSLT itself should've been simpler of course

I don’t think XSLT 1.0 is all that complicated. It’s a declarative language for transforming trees into trees or strings in an arbitrary manner, and you could argue that problem statement is too wide, but if you’re OK with it then I don’t think there’s any inappropriate complexity in the solution.

The surface syntax is bad, true, but that’s because of its verbosity, not its complexity. Once you put a bit of an Algol veneer on it[1], it becomes perfectly palatable.

[1] https://juniper.github.io/libslax/slax-manual.html

Re: Show HN: I Built a XSLT Blog Framework

#48
Why use HTML specifically? Markdown generator/transformer based frameworks can usually transform markdown into every commonly used html tag and for the tags that it can’t, you can just write html in the markdown file, just seems like you’re adding a ton of extra cruft imo.

Re: Show HN: I Built a XSLT Blog Framework

#49
post #8

Earlier quoted context omitted.

We wouldn't even need anything as complex as XSLT, or a functional language for transforming JSON. Other markup-based template processing systems exist for higher-level languages like Pug, Mustache, etc. for Node.js. You could achieve a lot with a template engine in the browser!

JSX!

That's not... really the same.

Re: Show HN: I Built a XSLT Blog Framework

#50
post #13
post #3

It's nice to see this. Things used to be simple! (XSLT itself should've been simpler of course). BTW, as I commented on earlier HN threads re: removal of XSLT support from HTML spec and browswers, IBM owns a high-performance XSLT implementation that they may want to consider contributing to one or more browsers. (It is a JIT that generates machine code directly from XSLT and several other data transformation and poli…

I think it would be very unlikely browsers would use a jit engine for xslt. They are removing it because they are afraid of the security footprint. A JIT engine would make that footprint much worse.

I don't think that follows, esp. since when we're talking about a mature, actively commercially maintained JIT engine.
Post reply on HN