5 ms·
> The current CSS effort provides a style mechanism well suited to the relatively low-level demands of HTML but incapable of supporting the greatly expanded ran
by jazzyjackson 5y ago
> The current CSS effort provides a style mechanism well suited to the relatively low-level demands of HTML but incapable of supporting the greatly expanded range of rendering techniques made possible by extensible structured markup. The counterpart to XML is a stylesheet programming language that is...Published in April, 1996, DSSSL is the stylesheet language of the future for XML documents.
I started building a custom JSON representation of HTML templates with embedded functions for importing fragments and generating markup etc and soon realized I was re-inventing XSLT [0] but kept going anyway. I haven't really seen another template language that can translate one DOM tree to another. It seems like XSLT is the eventual implementation of DSSSL in TFA, I'd be curious if anyone can speak to why it never caught on.
[0] https://en.wikipedia.org/wiki/XSLT https://en.wikipedia.org/wiki/XSLT
- christkv 5y agoHaving used XSLT professionally in the early 2000s I think it was that most developers found it hard to reason about due to the recursive nature of the language.
- Devasta 5y agoAbsolutely, so many tried to go about it procedurally and fought the language rather than adapt to its way of thinking. Once you understand apply-templates though, it becomes much easier.
- spiralx 5y agoFor me it was understanding the differences between creating output by digging down from a root or by transforming a document by matching parts of it and letting the default rules handle the rest. Which is the basis of my stylesheet that turns an HTML file into its own formatted and highlighted source code: https://gist.github.com/spiralx/dcb7e5fa4e5dedd800e292848ed22aa9 https://gist.github.com/spiralx/dcb7e5fa4e5dedd800e292848ed2...
- vbezhenar 5y agoCDuce is a sane XSLT alternative. Although it's mostly research project, AFAIK.
- bjoli 5y agoFor scheme there is SXML which has SXSLT, SSAX and SXPath. Translating between xml and SXML is trivial, and SXML is just an S-expression representation of XML, meaning it is in the canonical list form. Working with lists in scheme is pretty great. I stopped using any other xml tools for my own projects.