← Back to context

Comment by phatskat

3 months ago

On the link in the post you can scroll down to someone’s comment with a few links to XSLT in action.

It’s been years since I’ve touched it, but clicking the congressional bill XML link and seeing a perfectly formatted and readable page reminded me of exactly why XSLT has a place. To do the same thing without it, you’d need some other engine to parse the XML, convert it to HTML, and then ensure the proper styles get applied - this could of course be backend or frontend, either way it’s a lot of engineering overhead for a task that, with XSLT, requires just a stylesheet.

> To do the same thing without it, you’d need some other engine to parse the XML, convert it to HTML, and then ensure the proper styles get applied

No, you can use <?xml-stylesheet ?> directives with CSS to attach a css stylesheet directly to an xml file.

CSS is not as flexible as xslt, but this seems to be very simple formatting which is well within what css is capable of.