Lisp had assoc-lists, but those were a convention, not a specialized structure. Many languages had K-V maps as libraries, but not core structures, and most lacked literal syntax. Eventually most scripting languages starting getting them as native, and even having literal syntax, but they weren't the "go-to" data structure for doing things. In Python, for example, all of its objects are really just hash maps, but when you're working with them you pretend that they're objects and not hash maps, and you use lists more than maps anyways.
JavaScript (and maybe Lua) was the first language to build itself around K-V maps, so it was the first language where idiomatic usage included a lot of map literals. Like Python, its objects were all really just maps, but unlike it encouraged taking advantage of that fact. Also, because it was on the web, there was a lot of need to be serializing data structures and passing them around. Eventually someone realized "this is much better than XML!" and gave it a name, and that's how we got where we are today.
XML's popularity is an accident of history, due in part to the rise of HTML, which is also an accident of history.
I'm not sure what you mean by this. What's the difference, syntactically, between a convention and a specialized structure?
XML is Lisp. In fact, the XML grammar and Lisp's grammar are (almost) homomorphic[1]. SXML is a trivial mapping of XML to s-expressions which demonstrates this.
There's no point in comparing XML and S-expressions like that; they're essentially the same thing!
If you're talking about internal representation, well, that's up to the compiler. But since you have to declare the format either explicitly or by context, there's no 'advantage' of XML over s-expressions.
[1] To be pedantic, XML is homomorphic to SXML, which is a subset of the Lisp grammar, but that just means that Lisp recognizes some strings that aren't in the XML grammar, so if anything, Lisp is more powerful, but that's beside the point.
The big difference is how people look at it, not what it really is. JavaScript has a built-in key-value map data structure. An assoc-list isn't a built-in data structure, it's a way of using a more primitive data structure (lists). In particular, assoc-lists don't really look different than normal lists, so it's a slightly larger mental leap to think in terms of them. Furthermore, Lisp doesn't use assoc-lists as often as JavaScript uses key-value maps, preferring flat lists instead, so even if there were a specialized reader-macro for assoc-lists it wouldn't have been as ubiquitous.
I agree that XML and Lisp grammars are basically interchangeable. My comment was answering a question about the emergence of JSON, and my comments about assoc-lists were only in relation to JSON, not XML.
For instance (:name "Bob" :age 50) being a plist called person would give (getf person :age) as 50.
That seems pretty similar to {"name": "Bob", "age": 50} and person.age to retrieve the value 50.
In the end, I think it's just subjective. All of the above formats are equally capable of representing the same data.
XML looked like HTML at a time when the web was the "next big thing". Like, not a technology on the web, or social media, HTML itself was this big revelation. So a solution that looks like HTML has a leg up.
Then, once there were mature parsers in a lot of languages, server software configured by it, etc, XML had some inertia that takes time to displace.
For some reason they stopped using text plists and replaced it with an ugly xml serialization, but you still see these in Xcode's debugger if you log an NSArray or NSDictionary to the console.
The only reason I still use XML every now and then is XPath. There are third-party alternatives for JSON, but XPath is ubiquitous.
Lisp s-exps date to the original McCarthy paper in 1958, and could represent pretty much everything you can do with JSON, key-value pairs, lists, nested structure, etc.
JSON, at its core, is essentially a hierarchy of maps and lists -- which seems a very intuitive and useful way to store data.
XML on the other hand has always baffled me with its attributes and the redundant and verbose tags (why do I need <tag attr="data">data</tag>?). I'm sure there was a good reason at the time for this, so perhaps someone can enlighten me.