Tutorial :Are there other languages similar in purpose to XML?



Question:

I ask this because i find XML to be visually unappealing. I understand that XML is extremely famous, useful, and that it is accepted by most, if not all, programmers as a very useful language for defining and structuring data; however, i really do not find staring at it, looking at it, or reading it very appealing. I'm just a student and I am quite certain i'm going to have to deal with it sooner or later, but i was just wondering if there are alternatives to XML.


Solution:1

Take a look at YAML, or JSON.

There's also a pretty nice Wikipedia article for a Comparison of data serialization formats.


Solution:2

YAML if you like Python.


Solution:3

S-expressions! For parentheses-y goodness!


Solution:4

XML is not very appealing to look at, but there are plenty of XML Editors that make it easier/"better" to look at. I use oXygen, but there's XML Spy and also Visual Studio. They make it easier to work with XML. Technically speaking, XML is not a Language per se, its a format. You can also use XSL to transform it to HTML if you need to view the XML in certain ways.


Solution:5

Ah, since someone mentioned ASN-1 here's two more binary or hard to read encodings:

  • Google's protobuf. It's the data format used by google servers. Yes, every time you google something you trigger hundreds of protobuf padkets to be sent within Google.

  • Bittorrent's bencoding. It's the data format of .torrent files.


Solution:6

There is a very promising new technology called "text"...


Solution:7

Comma-separated values, AKA CSV :) For tabular data, beats XML any day. And very human-readable, too.


Solution:8

You can use S-expressions. It is a very simple language which allows you to do whatever you'd like with it. It is also easy to parse.


Solution:9

And, to round the list off, for binary hideousness, ASN-1. But, this one has the advantage of being extremely compact in some encodings.


Solution:10

In addition to the ones already mentioned the following may be of interest, depending on your domain:

  • HDF5

  • FITS

  • Harwell-Boeing

If you have specific interests there is probably an existing specific file format or several to choose from. On the other hand XML is very widespread and there are good reasons for that.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »