If any of you have made a website using only XML + XSLT – how did you structure the content and what strategies did you use to write and include repeating elements (like header, footer etc)?
Feel free to leave real world examples or write-ups in the comments!
For you, I recommend checking out the Docbook transformations and Saxon-JS. The former is a tool for publishing technical documentation to HTML, the latter is an compliant XSLT processor implemented in the browser/NodeJS.
XSLT/XQuery/XPath are excellent tools for querying and restructuring tree-structured data. There are a lot of people out there who have very little experience but great big opinions: you should ignore them.
Note that these technologies are functional programming languages. It will likely take some effort to wrap your head around it all. Michael Kay’s book is a good start, but unfortunately is not updated for the v3 spec.
The website itself was hosting various resources for researchers, etc. Each resource was annotated via a specific XML format and XSLT was used to dynamically create HTML pages, as well as to transform the XML files into various other file formats.
The by far biggest problem was, and still is, that XSLT is very verbose and not well-maintainable. Small changes here and there were possible, but larger changes almost always required rewriting the entire stylesheet. On top of that, the XML format got bigger and bigger as well (as it was used and modified by Universities across Europe), edge cases were added, etc., that did not help when it came to writing the XSLT stylesheets, but that's a different problem. We also had to switch to XSLT 3.0 at some point and had to render the HTML server-side, since browsers don't support anything beyond XSLT 1.0.
Overall, I still kind of enjoyed working with it. For complex XML, it was by far the easiest way to work with them.