3 ms·
XML is easier to edit by humans than JSON any-day. SVG is one of the few graphic markup languages whose basics one can pick up in a couple of hours and go to pr
by lenkite 2y ago
XML is easier to edit by humans than JSON any-day. SVG is one of the few graphic markup languages whose basics one can pick up in a couple of hours and go to production. If folks object to XML, then they should also object to HTML, JSX, etc.
We just need browsers to implement SVG 2.0
- mort96 2y agoIMO most of the problem with XML, and the reason why I hate using XML but find JSX and HTML perfectly fine, is that every XML document needs to start with some bullshit like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> or: <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> It's not only verbose and extremely ugly but also impossible to remember.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- lenkite 2y agoThat old doctype header has been deprecated for ~15 years. You can omit it and need not remember the same. svg header is simply: <svg version="1.1" xmlns="http://www.w3.org/2000/svg"> Maybe read the manual once per decade ? Its like saying JS does not have support for lambdas.
- mort96 2y agoI found them on a website listing the doctors for various XML-based file formats, I didn't realise it was out of date, sorry. Still, that doesn't change anything, my point stands. XML typically has horrible doctypes which are impossible to remember and ugly to look at or parse. I'm not critiquing SVG but XML after all.
- lenkite 2y agoIts one optional line in a header that you don't even need to use if you don't want to. But sure, lets throw out the baby with the bathwater. The fact that JSON cannot have comments is a far more serious drawback than a single line at the top of the document.
- mort96 2y agoI like formats which are XML except without the <?xml?> and xmlns stuff. However, most XML I encounter does have that stuff, so it's a reason why I usually hate dealing with XML. This shouldn't be difficult to comprehend. You don't have to run defence for a file format like this.
- hju22_-3 2y agoThis reads more like a case of you having left ambiguity in what exactly you disliked. And rather than defending the position, I found the reply fitting towards what it seemed like you disliked: the need for rather specific header tags. Now you've clarified it further, and it's clearer that it's not the need for header tags specifically that is the problem. For what it's worth, I do agree that the syntax may be a tad strange. But I feel that, as with many of these issues, this is a tooling issue. Now, whether or not tooling will be made or not, for these kinds of problems, is unrelated. As an aside, I rarely remember the HTML header tag; but that's fine, I have tooling that does it for me.
- felixfbecker 2y agoIf you just use it in the browser, <svg> is all you need. The browser is smart enough to parse it as SVG based on the context (e.g. if it's embedded inside HTML, if it's linked from an <img>, or if it's served as Content-Type: image/svg+xml). And you can omit the version.