Hot answers tagged

222

The real answer is XML has an L in the name because a guy named Raymond Lorie was among the designers of the first "markup language" at IBM in the 1970'ies. The developers had to find a name for the language so they chose GML because it was the initials of the three developers (Goldfarb, Mosher and Lorie). They then created the backronym Generalized Markup ...


175

Because it is a language. A markup language, not a programming language. Notice that natural human languages like English and Spanish don't "do" anything either. In fact, technically C++ and Java and the like don't "do" anything until they're fed into a compiler and the output gets executed. Doing stuff and being a language are largely orthogonal to each ...


140

The thing that gives XML its power and a lot of its complexity is mixed content. Stuff like this: <p>A <b>fine</b> mess we're in!</p> Don't even try to do that in JSON, or manipulate it in conventional programming languages. They weren't designed for the job. This kind of question usually comes from people who forget that that the ...


102

Let Σ be a non-empty, finite set of symbols, called an alphabet. Then Σ* is the countable infinite set of finite words that can be formed by concatenating zero or more symbols from Σ. Any well-defined subset L ⊆ Σ* is a language. Let's apply this to XML. Its alphabet is the Unicode character set U, which is non-empty and ...


65

Xml is great for what it was designed to be -- a platform neutral, human readable data transfer protocol with some capabilities to enforce data validation at low levels. I doubt anyone who uses Xml in this manner has a real complaint. Is it the most succint wire format? No. But there are worse options. Is it as fast as reading your custom binary format? No. ...


60

I took a very pleasant tour through w3c, google and wikipedia and finally found the answer: an annotated XML spec where we find an excerpt of an email from the inventor of the name, James Clark, an Email from chairman Jon Bosak who suggested to use the X letter, some other ideas for names and the final votes: Votes Acronym Full Name 5 XML Extensible ...


36

Because of the XML Schema Definition (XSD). With XML, you can have an additional file which describes the schema. It indicates, for example, that the element /a/b is an array and contains from 1 to 10 elements, or that the element /a/c is an integer. You can find an example of an XSD here. Validation of a given XML file through an XSD is supported by many ...


31

The main difference, I think, is in the fact that XML is designed to be self-explaining with its dtd's and everything. With JSON, you have to assume alot about the data you are receiving.


30

You'll need to learn XML to get anywhere in the web world. It's what drives of lot of B2B communications and there are many standard XML formats describing important. Just restricting yourself to JSON is hugely self-limiting. Yeah, you'll be chucking AJAX calls around but what happens when you need to communicate with a GeoServer? It'll be adhering to GIS ...


30

In computer science, formal language is just a set of strings, usually infinite and often described using rules (two common versions of those rules are regular expressions and formal grammars). Note that this means that all a language needs is syntax, language doesn't need to describe what each valid string means (that's called semantics). Now, this means ...


28

Because not all data needs to be stored relationally and writing code to process data you've been passed as XML for relational storage is time consuming (and very very tedious). This is particularly true when a lot of XML data is coming from systems which are throwing out large generic responses. I've frequently seen situations where a message is received ...


25

I would recommend reading How Did We Get Here?. Mark Pilgrim gives an excellent and brief history of HTML up to HTML5. Essentially though, my understanding is that many webpages don't even take advantage of the "X" of XHTML because they don't specify the proper MIME type for it.


25

Because "X" is just so much cooler than "E". Also presumably to avoid confusion with things like Extensible ML.


25

This page outlines quite a bit of the HTML/SGML history, and the rather convoluted rules of those two consecutive hyphens (double dash). The relevant part about SGML: To put it simply, the double dash at the start and end of the comment do not start and end the comment. Double dash indicates a change in what the comment is allowed to contain. The first ...


20

XML is lousy for data storage. First, it is very verbose. Data stored in an XML file will take much more disk space then the same data stored in any reasonable database system. In an XML record, the name of a particular field will be stored twice, along with the string representation of the data. So, for example, to store a single integar in a field ...


20

XML can be type safe, since it it possible with XSD schemas to declare the data type of elements. A document validated against a XSD schema is guaranteed to conform to the expected types. But a XML format is not required to have a schema, so a document is not automatically type safe just by being XML. There actually exist a schema language for JSON also, so ...


18

Look at XSLT - its main use it to transform one XML dialect to another (in this case, you would output to HTML/XHTML). Update: Since the OP believes this is not a popular option, here is a link to the standard on the W3 consortium website.


17

it's only important to know it when you need it and when you need it, you can learn it in an hour. or less


17

A literal translation to JSON is often less succinct and less clear. Consider: <foo> <x:bar x:prop1="g"> <quuz /> </bar> </foo> The most effective JSON representation I have seen of this: {"localName":"foo", "children": // you need to have a special array to hold all children [ {"localName": "bar", ...


17

Before choosing a different language, first make sure the language is the bottleneck. So did you actually measure the time for the 4 steps? Do you know that, for example, most waiting time for step 1 is spend in your language interpreter (and not caused by disk IO)? If the latter is the case, then chosing a language like C++ (or even assembler) may not bring ...


17

It's difficult to assess technologies when you don't have deep experience of them, but of course that's exactly when you have to make your decisions, so there's no simple answer to that dilemma. You cite two concerns: performance and usability. I'll try to address both below. Firstly, performance. Performance of course depends not only on the language but ...


15

XML is just a tool that comes in many flavors and uses. XML excels at some things and sucks at others. I think one of the problems is that people have seen "enterprise" xml that is needlessly complex with namespaces and crap strewn around (soap anyone). The trick to designing xml formats for humans is adding real meaning to data while not making them ...


15

The one that wraps all of the products into a single element. You can treat it as a collection in most programming languages that offer serialization/deserialization. See XML Serialization of Arrays and Collections Arrays and collections can be serialized to XML. The standard action when using the default serializer is for the name of the collection ...


14

Jeff Atwood has a pretty good blog post at XML: The Angle Bracket Tax about this if you want a source talking about it. The most common uses I have for it are: Services talking to each other. For example, a website using a content management system has to send some data into a customer relationship management system and this is done with XML. ...


14

Semantics are important here: Marshalling implies moving the data, it does not imply transforming the data from its native representation or storage. Java Objects can be Marshalled over the wire in their native representation. Serializing implies transforming the data to some non-native intermediate representation. For example: transforming a Java Object ...


14

Simple answer: because there has been no-one with the time, skill, and inclination to do the work. One or two people have expressed interest and made a start, but they have had other pressures on their time. There are two ways this project could happen: a skilled individual willing to put a year or two of unpaid free time into it could do it; or a company ...


13

Expat is a specific XML parser. Mozilla's ordinary HTML parser just tries to make the best of what it's given, while a real XML parser is much less lenient, as described on that page.


13

JSON and XML are both ways of formatting data. Both are capable of doing it perfectly well, so can JSON do everything XML does? Yes. But..... A more relevant question might not be what XML/JSON can do, but rather, what can you do with XML/JSON. There are several things you can do with XML that I don't think you can with JSON, such as translate with XLST, ...


13

In general terms, any unique identifier would serve for a namespace; but since it's supposed to be globally unique, the standard would have to either mandate some arbitration authority, or use another resource that is at the same time globally unique but easy to get hold and to prove it's yours. Oh, look! if you have a domain, it's obviously only yours, and ...


13

While you can surely write programs in XML (after all, XML's just a way of serializing a labelled tree structure with embedded strings) it's not going to help you out with programming. The hard part of programming is not writing it down, it's comprehending what exact assembly of concepts need to be told to the computer to make it do what you want to happen. ...



Only top voted, non community-wiki answers of a minimum length are eligible