tags:

views:

217

answers:

10

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.

+17  A: 

Take a look at YAML, or JSON.

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

Mark E
+1 for YAML! so much easier than XML for many purposes.
Peter Recore
And XML is so much easier than YAML for many purposes.
Rob
thanks... you answered my question... still, i'm sure i'm gonna get stuck wading through xml one day, but it's nice to know alternatives haven't completely ceased to surface
anonymous
+2  A: 

YAML if you like Python.

slebetman
What does Python have to do with it? There are YAML implementations for most commonly used languages.
Nick Bastin
Well, if you hate Python syntax you'll hate YAML syntax.
slebetman
A: 

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

Rob H
XML represents a tree hierarchy, unstructured text does not.
Roger Pate
But XML *is* text. All Markup languages are.
pavium
XML is *structured* text.
Roger Pate
Apparently, I should have added the emoticon. ;-)
Rob H
A: 

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

Seva Alekseyev
one of XML, JSON, and YAML's key advantages over CSV is that the format is self documenting. CSV formats where each row holds different data can be cumbersome..
Mark E
Colon separated text beats csv because commas are used too often in text but neither can be used to describe data like XML can.
Rob
@Mark: but how often do you see those?
Seva Alekseyev
Consider recording interleaved packets (maybe from ethereal) where you can decode the packets into different data fields -- and the packets themselves may vary in length.
Mark E
+2  A: 

S-expressions! For parentheses-y goodness!

Andrew Medico
Parent-cheesy? Sounds Dahmeresque.
Roger Pate
A: 

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.

CyBerHigh
A: 

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

Andrew McGregor
+1  A: 

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.

slebetman
A: 

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

-- HDF5

-- FITS

-- Harwell-Boeing

-- OK, getting a bit esoteric so I'll stop now,

but 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.

Regards

Mark

High Performance Mark
+2  A: 

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.

funkymushroom
although you didn't directly answer my question, you still made me realize that it doesn't have to be as big a problem so thanks for that
anonymous