Earlier quoted context omitted.
> It's generally speaking part of the problem with the entire "XML as a savior" mindset of that earlier era and a big reason of why we left them Generally speaking I feel like this is true for a lot of stuff in programming circles, XML included. New technology appears, some people play around with it. Others come up with using it for something else. Give it some time, and eventually people start putting it everywhere…
A controversial opinion, but JSON is that too. Not as bad as XML was (̶t̶h̶e̶r̶e̶'̶s̶ ̶n̶o̶ ̶"̶J̶S̶L̶T̶"̶)̶, but wasting cycles to manifest structured data in an unstructured textual format has massive overhead on the source and destination sides. It only took off because "JavaScript everywhere" was taking off — performance be damned. Protobufs and other binary formats already existed, but JSON was appealing because…
XSLT – Native, zero-config build system for the Web
221–230 of 337 posts
Re: XSLT – Native, zero-config build system for the Web
#222I built an actual shipping product that used this approach over 25 years ago. The server would have the state of every session, that would be serialized to xml, and then xslt templates would be used to render html. Idea was that this would allow customers to customize the visual appearance of the webpages, but xslt was too difficult. Not a success.
Re: XSLT – Native, zero-config build system for the Web
#223https://zvon.org/xxl/XSLTutorial/Books/Output/contents.html
Still a great resource.
--
I would say CSS selectors superseeded XPath for the web. If one could do XSLT using CSS selectors instead, it would feel fresh and modern.
Re: XSLT – Native, zero-config build system for the Web
#224// XML $xml_doc = new DOMDocument(); $xml_doc->load("file1.xml");
// XSL $xsl_doc = new DOMDocument(); $xsl_doc->load("file.xsl");
// Proc $proc = new XSLTProcessor(); $proc->importStylesheet($xsl_doc); $newdom = $proc->transformToDoc($xml_doc);
print $newdom->saveXML();
XSLT lacks functionality? No problem, use php functions in xslt: https://www.php.net/manual/en/xsltprocessor.registerphpfunct...
RTFM
Re: XSLT – Native, zero-config build system for the Web
#225Earlier quoted context omitted.
Hmm my memory is fuzzy but I remember seeing backend processing of xml files a lot around 2005.
Yeah, I was using Novell DirXML to do XSLT processing of inbound/outbound data in 2000 ( https://support.novell.com/techcenter/articles/ana20000701.h... ) for directory services stuff. It was full XML body (albeit small document sizes, as they were usually user or identity style manifests from HR systems), no streaming as we know it today.
Re: XSLT – Native, zero-config build system for the Web
#226Re: XSLT – Native, zero-config build system for the Web
#227"XSLT is a failure wrapped in pain"
original article seems offline but relevant HN discussion: https://news.ycombinator.com/item?id=8708617
Re: XSLT – Native, zero-config build system for the Web
#228Re: XSLT – Native, zero-config build system for the Web
#229Earlier quoted context omitted.
XSLT/XPath have evolved since XSLT 1.0. Features are now available like key (index) to greatly speedup the processing. Good XSLT implementation like Saxon definitively helps as well on the perf aspect. When it comes to transform XML to something else, XSLT is quite handy by structuring the logic.
XSLT just needs a different, non-XML serialization. XML (the data structure) needs a non-XML serialization. Similar to how Semantic Web's Owl has four different serializations, only one of them being the XML serialization. (eg. Owl can be represented in Functional, Turtle, Manchester, Json, and N-triples syntaxes.)
That's YAML, and it is arguibly worse. Here's a sample YAML 1.2 document straight from their spec:
%TAG !e! tag:example.com,2000:app/
---
- !local foo
- !!str bar
- !e!tag%21 baz
Nightmare fuel. Just by looking at it, can you tell what it does?--
Some notes:
- SemWeb also has JSON-LD serialization. It's a good compromise that fits modern tooling nicely.
- XML is still a damn good compromise between human readable and machine readable. Not perfect, but what is perfect anyway?
- HTML5 is now more complex than XHTML ever was (all sorts of historical caveats in this claim, I know, don't worry).
- Markup beauty is relative, we should accept that.
Re: XSLT – Native, zero-config build system for the Web
#230What is this "XSLT works natively in the browser" sourcery? The last time I used XSLT was like 20 years ago- but I used it A LOT, FOR YEARS. In those days you needed a massive wobbly tower of enterprise Java to make it work which sort of detracted from the elegance of XSLT itself. But if XSLT actually works in the browser- has the holy grail of host-anywhere static templating actually been sitting under our noses thi…
Plug: here is a small project to get the basic information about the XSLT processor and available extensions. To use with a browser find the 'out/detect.xslt' file there and drag it into the browser. Works with Chrome and Firefox; didn't work with Safari, but I only have an old Windows version of it.