5 ms·
Was there ever a good reason for XSLT to be an XML document itself? It was painful writing it.
by MattPalmer1086 1y ago
Was there ever a good reason for XSLT to be an XML document itself? It was painful writing it.
- arwhatever 1y agoYo dawg, I heard you like xml … so I made you an xml-based language to turn xml into other xml!
- Mikhail_Edoshin 1y agoThis way you can manipulate XSLT using XSLT. A common case is to generate XSLT.
- MattPalmer1086 1y agoClearly that would be possible, but I never actually saw anyone doing that though. Any pointers to tech that did this, if it was a common case?
- Mikhail_Edoshin 1y agoI doubt it was common. But, for example, there is such thing as Schematron: this is a special notation that checks that an XML document follows business rules and the final tool that it produces is a custom XSLT that transforms the document into the report. (I'm also doing this currently; I need to prepare a sort of an annotated patch to an XML document, so I concocted a notation that describes edits and use it to generate both the documentation that highlights differences and also the patch itself; the patch comes out as XSLT.)
- righthand 1y agoIs XSLT not an XML document itself? I’m confused by your comment. My XSLT stylesheets are like this: ``` <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform http://www.w3.org/1999/XSL/Transform"> ```
- MattPalmer1086 1y agoYes it is, I was asking why it needed to be. Sorry if that wasn't clear.
- cess11 1y agoOnce upon a time HTML was a kind of XML, which is why the current version is very similar to XML and hence painful to write. This in turn is why we tend to use programmatic tools to handle the HTML, and you should if you work with XML too.
- MattPalmer1086 1y agoIn fact, HTML predates XML. Both can be seen as types of SGML.
- samus 1y agoHTML5 is unlike XML in very important regards, which makes it actually quite difficult for tools to handle. But easier than XML. XHTML was quite annoying to write as far as I remember.