| ▲ | ErroneousBosh 6 hours ago |
| > it would tell you about things like separating content from styles and layout, yes. That's what CSS does. |
|
| ▲ | antod 4 hours ago | parent | next [-] |
| XSLT is really separating (XML) data from markup in the case of the web. More generally it's transforming between different XML formats. But in the case of docs (eg XML-FO for docbook, DITA etc) XSLT does actually separate content from styling. |
|
| ▲ | ndriscoll 6 hours ago | parent | prev [-] |
| Yes that's why XSLT is such a natural fit when you learn about HTML+CSS. It's the same idea, but applied to HTML templates, which is something you immediately want when you hand-write HTML (e.g. navbars, headers, and footers that you can include on every page). |
| |
| ▲ | ErroneousBosh 6 hours ago | parent [-] | | Your problem here is that you're hand-writing HTML including all the templates. This wasn't a good way to do it 30 years ago and it's not a good way to do it now. See all these "static site generators" everyone's into these days? We used those in the mid-90s. They were called "Makefiles". | | |
| ▲ | ndriscoll 6 hours ago | parent [-] | | Yeah because I was 11 and didn't know what a Makefile was. That's my point. I wanted to make web pages, and didn't know any programming. HTML is designed to be hand-written. You just write text, and when you want it to look different, you wrap it in a thing. When doing this, you'll quickly want to re-use snippets/invent your own tags. XSLT gives a solution to this without saying "okay let's back up and go learn how to use a command line now, and probably use an entirely different document format" (SSGs) or "okay let's back up and learn about functions, variables, classes, and callbacks, and maybe a compiler" (Javascript). It just says "when you want to make your own tags, extract them into a 'template' tag, then include your templates just like you include a CSS file for styles". |
|
|