Tag Info

Hot answers tagged

116

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


99

I've attempted to answer my own question here, but this is incorporating the heatmap idea from @jimp and also the 'make it more XML-ish' idea from @Andrea: Hopefully, the colors in the heat map along with the angular lines help draw the eye between the start and end tags; removing the horizontal line separators improves the 'flow' from start to end. As ...


54

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


54

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


27

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.


25

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


25

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


24

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


23

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.


22

One idea might be to try and add 3D to the text. Increase/decrease the font size based on what level it's at. For example, this code: Would look like this: That might be annoying to work with as it loses fixed text-size-alignment across different levels. Another idea; change the saturation of each level: How well does that hold up for something ...


20

Just tweaking your original idea and switch from squares to capsules. I think these versions (including your original one) are easier to read because they are less complex then the one that shows nesting through nesting the display elements. I think tree elements convey the information in a simpler more intuitive manner. I think the left is great for ...


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


16

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


16

This page outlines quite a bit of the HTML/SGML history, and the rather convoluted rules of the 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 -- starts the comment, and ...


15

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


15

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", ...


15

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


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


13

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


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


12

XML really is a pretty horrible way to represent structured data, but unfortunately it gets (ab)used quite a lot by a lot of developers and websites. So if you're only working with your own stuff, then by all means, stick to JSON and save yourself the hassle. But you still need to learn XML for those times when you end up having to interoperate with ...


12

If you will be doing lots of IO, SQL is your better choice. SQL is designed to work well to get/store data which is why we use it for storing data on something like a website as opposed to XML. XML is good for human readable data that can be shared and interpreted between applications, as was its intention. XML parsing involves LOTS of string manipulation ...


12

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


12

Have you looked into SQLite? It is an embedded SQL database engine with pretty good performance, and it gives you the power of SQL (there are some advanced features it doesn't have, check their website for details), which might make it easier and faster to access your data than reading and processing DOM objects. I believe it's also written in C so ...


12

In your question title, you ask about HTML, SGML and XML as if they are the same thing, but they are not. In fact, they are very different in precisely that area which you are asking about. In particular, SGML has both Null End Tags and Implied End Tags (and Implied Elements as well), and since HTML is an application of SGML, it inherits those. Null End ...


12

As per the standard, an XML document must have exactly one root element in order to be well formed XML. Any parser that accepts otherwise is wrong, and any XML document that is structured any different is not in fact an XML document. It is not merely discouraged by W3C, but simply against the standard.


12

Use a database, thats what they are for. File storage has its place, but I wouldnt use it for this kind of scenario. Consider, for example, getting a list of blog posts containing a certain tag. Doing that with a database is trivial - likely just a single SQL statement. Doing it with files will involve a lot of file manipulation.


12

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


11

From the book Computers & Society The X in XML "XML is both a boon and a threat to the web dream." The X in XML stands for eXtensible. This signifies that XML is open. It is open in the sense that it allows growth. Note that the abbreviation is XML and not EML. There is something daring, attractive, exciting about that X. X ...



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