4 ms·
We had pretty much this exactly with XML and XSLT. The XML would be entirely about content/data with only suggested presentation based on linked stylesheets. Th
by giantrobot 6y ago
We had pretty much this exactly with XML and XSLT. The XML would be entirely about content/data with only suggested presentation based on linked stylesheets. The browser could use the linked stylesheets or ignore them and use its own. Since the XML would declare its schema a browser could handle pretty much any data so long as it had a handler for that schema.
Since the XML could carry pretty much any sort of data server endpoints could back an "Application Web" just as easily as a "Document Web". A browser could take a music playlist and transform it into a listing of tracks via XSLT while a music player would take that exact same URL and enqueue the tracks for playback.
Unfortunately the mixed presentation and content model had a lot of momentum. By the time a lot of web developers caught on to separating concerns XmlHttpRequest existed and let everyone reimplement all those cool XML/Web 2.0 ideas poorly in JavaScript.
- Mandatum 6y agoAs someone who has done a lot of work in XSLT for data transformation in ESB or integration.. Honestly if I actually improved my tools a bit better, I'd almost enjoy using it. But it sucks, so damn much, in the current state.. And now nobody seems to be interested in XSLT ("XML is legacy"), I don't think I'm ever going to be interested in "fixing" it.
- ilovetux 6y agoThis is sad because as Json seems to be taking over. Despite its terseness Json lacks a standardized way to do validation (ie xsd), transformations (ie xslt) and service definitions (ie wsdl). Its regrettable that such a vast ecosystem exists for a markup language to facilitate its use in data transfer, transformation and validation. It seems like a waste that so many working standards seem to have just been tossed away with nothing to put into their place because Json saves a few bits on the wire. Also regrettable is the fact that there seems to be resistance in developing similar standards for json.
- kungato 6y agoJson is not popular because it saves bits but because it's easily readable and maps 1:1 with js objects. I've worked with xml and xslt and while I see the advantages I still prefer json for anything. Your validation should come from annotated objects on the backend anyways which should be a single source of truth and then it doesn't matter which markup format you are validating
- ilovetux 6y agoI can kind of see what you're saying, but what does "annotated objects on the backend" mean. If there is not a standard I can only hack a solution together. I cannot ensure anything with 100% certainty, instead I'm left guessing if my logic is correct. With a standard, however, I can be sure that what I intend is being validated and if my logic is wrong then I can change it to match the spec.
- dsego 6y agoJson schema maybe http://json-schema.org/ http://json-schema.org/
- giantrobot 6y agoThe tooling did/does leave a lot to be desired in XML workflows. I think, in XML's heyday, it was way easier to template with PHP/ASP/JSP on the server. While those languages could have just as easily spit out XML to be transformed on the client, writing the XSL was non-trivial and lacked good tools to make the process easier. I find JSON to be a lackluster replacement for XML. The efforts to bolt on XML features (JSON Schema etc.) are half assed and not widely supported. Without a bunch of extra complication you can't really know what a value in JSON means beyond its translation to some primitive. The web development world doesn't deserve XML! /s I am a bit of an XML fanboy as it solves complicated problems in a logical way. I also bought into (and continue to believe) in a lot of Web 2.0 ideas beyond pastel colors and pseudo-reflections on logos.