Slashdot Mirror


The Future of XML

An anonymous reader writes "How will you use XML in years to come? The wheels of progress turn slowly, but turn they do. The outline of XML's future is becoming clear. The exact timeline is a tad uncertain, but where XML is going isn't. XML's future lies with the Web, and more specifically with Web publishing. 'Word processors, spreadsheets, games, diagramming tools, and more are all migrating into the browser. This trend will only accelerate in the coming year as local storage in Web browsers makes it increasingly possible to work offline. But XML is still firmly grounded in Web 1.0 publishing, and that's still very important.'"

273 comments

  1. "How will you use XML in years to come?" by Ant+P. · · Score: 5, Insightful

    Sparingly. JSON is just plain better, and doesn't inflict an enterprisey mindset on anyone that tries to use it.

    1. Re:"How will you use XML in years to come?" by DragonWriter · · Score: 4, Interesting

      Sparingly. JSON is just plain better, and doesn't inflict an enterprisey mindset on anyone that tries to use it.


      JSON/YAML is/are better (not considering, of course, the variety and maturity of available tools; but then, perhaps, you don't always need most of what is out there in XML tools, either) for lots of things (mostly, the kinds of things TFA notes XML wasn't designed for and often isn't the best choice for),things that aren't marked-up text. Where you actually want an extensible language for text-centric markup, rather than a structured format for interchange of something that isn't marked-up text, XML seems to be a pretty good choice. Of course, for some reason, that seems to be a minority of the uses of XML.

    2. Re:"How will you use XML in years to come?" by MagikSlinger · · Score: 3, Insightful

      Sparingly. JSON is just plain better, and doesn't inflict an enterprisey mindset on anyone that tries to use it.

      JSON is inflicting Javascript on everyone. There are other programming languages out there. Also, XML can painlessly create meta-documents made up of other people's XML documents.

      --
      The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
    3. Re:"How will you use XML in years to come?" by larry+bagina · · Score: 2, Interesting

      OpenStep property lists kick json's ass 7 ways to sunday.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:"How will you use XML in years to come?" by DragonWriter · · Score: 4, Informative

      JSON is inflicting Javascript on everyone.


      No, it really doesn't, but if "JavaScript" in the name bothers you, you might feel better with YAML.

      There are other programming languages out there.


      And there are JSON and/or YAML libraries for quite a lot of them. So what?
    5. Re:"How will you use XML in years to come?" by MagikSlinger · · Score: 5, Insightful

      JSON is inflicting Javascript on everyone.

      No, it really doesn't, but if "JavaScript" in the name bothers you, you might feel better with YAML.

      No, it wouldn't because JSON is bare bones data. It's simply nested hash tables, arrays and strings. XML does much more than that. XML can represent a lot of information in a simple, easy-to-understand format. JSON strips it out for speed & efficiency. Which sort of gets into the point I did want to make but was too impatient to explain: JSON is good where JSON is best, and XML is good where XML is best. I dislike the one-uber-alles arguments because it's ignoring other situations and their needs.

      There are other programming languages out there.

      And there are JSON and/or YAML libraries for quite a lot of them. So what?

      Would you like to live in a world of S-expressions? The LISP people would point out there are libraries to read/write S-expressions, so why use JSON? The answer of course is that we want more than simply nesting lists of strings. We want our markup languages to fit our requirements, not the other way around. And saying "JSON for Everything", which the original poster did was... silly.

      My problems with JSON are:

      • No schema: XML Schema not only makes it easier to unit test, but it can be fed into tools that can do useful things like automatic creation of Java classes and code to read/write. Does JSON have anything like that? Of course not, because it would defeat JSON's purpose: easy Javascript data transmission.
      • Expressability: With XML, I can create a model that fits my logical model of the data where I use attributes to augment the data in the child elements. Doing that in JSON is a kludge with a hash-table to represent an element which can't be easily converted into a graph for easy understanding.
      • Diversity: I use GML in my day job. A lot. I can easily set up an object conversion rule with Jakarta Digester that I can painlessly drop into future projects without modification. That's the power of namespaces. I can build an XML document using tags from a dozen different schema, and then feed it to another application that only looks for the tags it cares about.
      • XPath. 'Nuff said. Ok, one thing: this should have replaced SAX/DOM years ago.

      JSON is great for AJAX where XML is clunky and a little bit slower (my own speed tests hasn't shown there's a huge hit, but it is significant). XML is great for document-type data like formatted documents or electronic data interchange between heavy-weight processes. My point was that the original poster's JSON is everything was narrow-minded, and that XML answers a very specific need. There are tonnes of mark-up languages out there, and I think XML is a great machine-based language. I hate it when humans have to write XML to configure something though. That really ticks me off. But that's the point: there should not be one mark-up language to rule them all. A mark-up language for every purpose.

      --
      The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
    6. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 0

      Why not just use s-expressions?

    7. Re:"How will you use XML in years to come?" by filbranden · · Score: 2, Insightful

      JSON is inflicting Javascript on everyone. There are other programming languages out there.

      On the browser? If you want to use AJAX-like technology, JavaScript is still the only viable and portable option as the programming language for the client side.

    8. Re:"How will you use XML in years to come?" by aoteoroa · · Score: 4, Insightful

      Hear! Hear!

      One file (format) will not rule them all.

      XML is good if you want to design a communication protocol between your software, and some other unknown program.

      JSON is much lighter. Far less kilobits needed to transfer the same information so when performance is important and you control everything then use JSON.

      When it comes to humans editing config files I find traditional ini files, or .properties easier to read and perfectly suitable in most cases.

      Writing more complex, relational data to disk? Sqlite often solves the problem quickly.

    9. Re:"How will you use XML in years to come?" by slawo · · Score: 2, Insightful

      JSON is fit mostly for communication and transfer of simple data between JS and server side scripts through object serialization. But it remains limited. You can compare JSON to XML only if your knowledge of XML stops at the X in AJAX
      Beyond that scope comparing these two unrelated "things" is irrelevant.

      The tools and libraries available for XML go well beyond JSON's scope. DOM, RSS & ATOM, OASIS, Xpath, XSLT, eXist DB are just few examples of tools and libraries surrounding XML.
      XML is designed to let you create your own protocols and formats while using only one simple base format (XML), one simple descriptor language (Schema or DTS) and you can convert your formats and protocols using one transformation technology (XSLT).
      There are languages to query XML files and collections, XLM databases and many more examples including scientific, vectorial and 3d imaging formats.
      I believe the word Interoperability was created with XML in mind... Or maybe the other way round... whatever.

      --
      The road to hell is paved with good intentions...
    10. Re:"How will you use XML in years to come?" by frank_adrian314159 · · Score: 4, Funny
      Would you like to live in a world of S-expressions?

      If you're giving me a choice... why yes, please! Where can I get one of these worlds you're talking about?

      --
      That is all.
    11. Re:"How will you use XML in years to come?" by jhol13 · · Score: 3, Interesting

      You forgot XSLT.

      It is extremely powerful tool, I once (ages ago) made a pure XSLT implementation to convert XML into C. Whith a CSS the XSLT was even browser/human viewable (the output was somewhat similar to the C program output).

      I do not think JSON can do that.

    12. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 0

      I do not think JSON can do that.

      Neither XML nor JSON can "do" anything, they're just data formats. You're talking about the tools that are available to process that data.
    13. Re:"How will you use XML in years to come?" by Furry+Ice · · Score: 1

      Given that XPath is a query language for the DOM, I'm not really sure how it would replace it. Given that SAX is a way that a DOM can be built, I'm not sure it would replace that, either. I suppose you're just talking about all the tedious code to traverse a DOM to find the elements and attributes you're looking for, or the stacks and other data structures necessary to figure out where you are in a document when using SAX? Yeah, XPath is way better than that stuff, but it's never going to replace them. They're complementary.

    14. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 5, Insightful
      I'm so depressed. You represent an entire generation of programmers who can't figure out the difference between marked-up text and data, and why mark-up languages suck so bad for data interchange.

      Pop quiz. Here's an excerpt of GML from that page you linked to.

      <gml:coordinates>100,200</gml:coordinates>
      Do the contents of this node represent:
      1. the text string "100,200"
      2. the number 100200 (with a customary comma for nice formatting)
      3. the number 100.2 (hey, that's the way that the crazy Europeans do it)
      4. a tuple of two numbers: 100 and 200
      "Obviously it's two numbers, they're coordinates" you may say. But such things are not "obvious" to an XML parser. If you're an XML parser the answer is (1): it's a simple text string. So to get to the real data you have to parse that text string again to split on a comma, and to turn the two resulting text strings into numbers. Note this is a completely separate parser and is completely outside the XML data model, so all your fancy schema validation, xpath, etc. are useless to access data at this level.

      Why all this pain? Because XML simply has no way to say "this is a list of things" or "this is a number."

      Sure, you can approximate such things. You could write something like:

      <gml:coordinates>
          <gml:coordinateX>100</gml:coordinateX>
          <gml:coordinateY>200</gml:coordinateY>
      </gml:coordinates>
      But the fact remains that even though you may intuitively understand this to be two coordinates when you look at it (and at least you can select the coordinates individually with xpath in this example, but they're still strings, not numbers) to XML this is still nothing but a tree of nodes.

      Did you catch that? A tree of nodes. You're taking a concept which is logically a pair of integers, and encoding it in a format that's representing it in a tree of nodes. Specifically, that tree looks something like this:

      elementNode name=gml:coordinates
      \-> textNode, text="\n " *
      \-> elementNode name=gml:coordinateX
          \-> textNode text="100"
      \-> textNode, text="\n " *
      \-> elementNode name=gml:coordinateY
          \-> textNode, text="200"
      \-> textNode, text="\n" *


      (*: yep, it keeps all that whitespace that you only intended for formatting. XML is a text markup language, so all text anywhere in the document is significant to the parser.)

      So let's recap. Using XML, we've taken a structure which is logically just a pair of integers and encoded it as a tree of 7 nodes, three of which are meaningless whitespace that was only put there for formatting, and even after all this XML has no clue that what we're dealing with is a pair of integers.

      Now let's try this example in JSON:

      {"coordinates": [100, 200]}
      JSON knows two things that your fancy shmancy XML parser will never know: that 100 and 200 are numbers, and that they are two elements of an array (which might be more appropriately thought of as a "tuple" in this context). It's smart enough to know that the whitespace is not significant, it doesn't build this complex and meaningless node tree; it just lets you express, directly and succinctly, the data you are trying to encode.

      That's because JSON is a data format, and XML is a marked up text format. But we're suffering from the fact that no one realized this ten years ago, and compensated for the parity mismatch by layering mountains of horribly complex software on top of XML instead of just using something that is actually good at data interchange.
    15. Re:"How will you use XML in years to come?" by Simon+Brooke · · Score: 1

      There are other programming languages out there.

      And there are JSON and/or YAML libraries for quite a lot of them. So what?

      Would you like to live in a world of S-expressions? The LISP people would point out there are libraries to read/write S-expressions, so why use JSON? The answer of course is that we want more than simply nesting lists of strings. We want our markup languages to fit our requirements, not the other way around. And saying "JSON for Everything", which the original poster did was... silly.

      These sort of arguments are simply, to use your own word, silly. It's all data, and it's trivial to mung it from one expression to another. XML isn't different from SEXPRs, it's simply an alternative, more prolix notation for SEXPRs. What's bad about XML is that it's prolix; what's good about it is that it has made formal grammars easy to write and easy to police, and in the process has made it extremely easy to write editors which can learn new formal grammars. That's a big win. But once you've used your formal grammar to structure your data, what syntax you convert it into for passing it down the wire is up to you.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    16. Re:"How will you use XML in years to come?" by dkf · · Score: 3, Insightful

      My problems with JSON are:
      • No schema: XML Schema not only makes it easier to unit test, but it can be fed into tools that can do useful things like automatic creation of Java classes and code to read/write. Does JSON have anything like that? Of course not, because it would defeat JSON's purpose: easy Javascript data transmission.
      While I hate XML Schema, it's still better for many uses than just throwing random crap on the wire and hoping that the other end can make sense of it. And no, throwing some javascript on the wire as well doesn't help that much. I want the computer to do stuff with the data without having to ship a program specifically for the purpose; after all, I can't think of all the purposes for the data right now and I want to let others come up with new cool stuff too.

      • XPath. 'Nuff said. Ok, one thing: this should have replaced SAX/DOM years ago.
      I use a DOM library that includes XPath support so that I can simply do a search starting at any node. It makes working with DOM much more pleasant.

      I hate it when humans have to write XML to configure something though. That really ticks me off. Simpler stuff works quite well when you've got configuration of software from a single vendor, but when you've got to combine stuff from lots of sources, XML stops being quite such a bad choice. (If only people who edit config files would actually demonstrate an ability to write well-formed XML though. Idiots...)
      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    17. Re:"How will you use XML in years to come?" by Simon+Brooke · · Score: 2, Interesting

      You forgot XSLT.

      It is extremely powerful tool, I once (ages ago) made a pure XSLT implementation to convert XML into C. Whith a CSS the XSLT was even browser/human viewable (the output was somewhat similar to the C program output).

      I do not think JSON can do that.

      XSLT is a nice backwards chaining theorem prover, very similar to Prolog. I like it and use it a lot - currently for me it venerates SQL, Hibernate mappings, C# code and Velocity macros from a single source XML document. But there's nothing magic about it, and if we didn't have XSLT it would be very easy to do the same sort of thing in LISP or Prolog, or (slightly more awkwardly) in conventional programming languages.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    18. Re:"How will you use XML in years to come?" by Stan+Vassilev · · Score: 2, Interesting

      Sparingly. JSON is just plain better, and doesn't inflict an enterprisey mindset on anyone that tries to use it.

      While I understand your pain, XML is still a very nice *markup* language, for marking up documents and simple content trees.

      Can you imagine HTML / XHTML implemented as JSON? I doubt that.

      The fault with people here lies in XML abuse, namely SOAP-like XML API-s and using XML for everything, where binary formats, or more compact and simpler formats, like JSON, do better.

    19. Re:"How will you use XML in years to come?" by mugenjou · · Score: 1

      obligatory xkcd: http://xkcd.com/224/

      --
      DualBrain - Level Up Your Brain! - now available on your iPhone!
    20. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 4, Insightful

      You are arguing the merits of isolated XML, while in fact it is a collective technology. Yes, the XML itself is not strongly typed, that is why you have SCHEMA (formerly DTD). Using XML-SCHEMA (coincidently also written in XML) you DO get a strongly typed document where you can say that a tag can only contain one letter followed by 12 digits or whatever. Then you can use XSL to transform the document, knowing with certainty every single bit of the format.

      The only difference here is that XML separates these 3 (markup, validation, transformation) operations, since you might find situations where you don't need all of them.

    21. Re:"How will you use XML in years to come?" by ArAgost · · Score: 1

      currently for me it venerates SQL, Hibernate mappings, C# code and Velocity macros from a single source XML document. Those are truly wonderful things but... are you really venerating C#?
    22. Re:"How will you use XML in years to come?" by kestasjk · · Score: 1

      JSON is inflicting Javascript on everyone. There are other programming languages out there.

      On the browser? If you want to use AJAX-like technology, JavaScript is still the only viable and portable option as the programming language for the client side.

      But do we want to make that even harder to change?
      --
      // MD_Update(&m,buf,j);
    23. Re:"How will you use XML in years to come?" by The_reformant · · Score: 1

      Only if your XML Parser doesnt support W3C XML Schema Part 2.

      --
      I have discovered a truly remarkable sig which this post is too small to contain.
    24. Re:"How will you use XML in years to come?" by kahei · · Score: 1


      That was excellent, thanks.

      The problem is that XML is a brand with a lot of recognizability. It's kind of like brand-name clothes versus well made, appropriate clothes. There's always going to be a lot of people who wouldn't know 'well made and appropriate' if it hit them in the face and who will therefore retreat to a recognisable brand.

      XML has succeeded in the face of the fact that hardly anyone actually likes it, simply because whenever a plan or product is discussed someone says "Will it support XML?" and the answer always has to be yes. And so yet another format or application has a layer of tags and namespaces wrapped round it.

      People who *do* like XML do exist but they are spooky and remind me of Sadako.

      --
      Whence? Hence. Whither? Thither.
    25. Re:"How will you use XML in years to come?" by filbranden · · Score: 1

      JSON is inflicting Javascript on everyone. There are other programming languages out there. On the browser? If you want to use AJAX-like technology, JavaScript is still the only viable and portable option as the programming language for the client side. But do we want to make that even harder to change?

      Do we really need other languages in the browser? Unless the language is implemented by everyone, it's not worth it. Requiring yet another language makes it harder for new browsers to hit the market. I think it's better to have one well supported language, than several buggy ones.

    26. Re:"How will you use XML in years to come?" by TheRaven64 · · Score: 1
      OpenStep plists are almost identical to JSON, both semantically and syntactically. You can very easily write an NSCoder that will create and parse JSON using exactly the same code paths that the Foundation classes use to generate plists.

      Comparing XML to JSON or plists isn't exactly fair though, since they XML does not define any semantics. A better comparison would be with S-expressions, which are as expressive as XML and less verbose.

      As to the future of XML, there is one feature I would really like to see added, a BDATA equivalent to the existing CDATA stuff. You can use <[CDATA[ {arbitrary character data} ]]> to insert character data in to XML, but it's a pain trying to use this for binary data since you need to ensure that it doesn't contain the sequence ]]> anywhere, and you end up using ad-hoc escaping schemes, or just base-64 encoding everything (which bloats up the data even more. I would like to see something like <[BDATA[{length}[ {arbitrary binary data} ]]]> added to the spec, where the length is the number of bytes between the open and close square brackets. This would make things like sending JPEG avatar images over XMPP significantly more efficient.

      --
      I am TheRaven on Soylent News
    27. Re:"How will you use XML in years to come?" by jrumney · · Score: 1

      XPath. 'Nuff said. Ok, one thing: this should have replaced SAX/DOM years ago.

      SAX is a parser. DOM is a data representation. XPath is a query language. None can replace the others, in many implementations, they are different levels of the same stack (DOM trees are built by the SAX parser, and XPath works on the DOM tree - though a subset of XPath could as easily work on the SAX output on the fly if you are using it as a filter and don't want to use memory on the data you're not interested in).

    28. Re:"How will you use XML in years to come?" by gayak · · Score: 1

      Actually, what you did there is why people hate XML, you didn't define anything. First of all, using nodelist for something like coordinates would be utter useless, since it's much easier to create it with attributes: After that, using schema you define what the data actually means. Where's the problem with parsing? It's easy to use XPath to search through all nodes with the x being 200. Or y between 1 and 10. I'm not JSON expert, but where's the advantage in JSON vs. XML here?

    29. Re:"How will you use XML in years to come?" by balls199 · · Score: 1
      Though I agree with you that many people don't understand the difference between marked-up text and data, your xml solution is inappropriate. A better version of the xml solution would be something like:

      <gml:coordinates x="100" y="200" />
      Also, as mentioned by The_reformant, with W3C XML Schema Part 2, the coordinates actually are numbers, and not text strings.
    30. Re:"How will you use XML in years to come?" by DragonWriter · · Score: 1

      Comparing XML to JSON or plists isn't exactly fair though, since they XML does not define any semantics.


      Its perfectly fair, since they are often alternatives for the same use.
    31. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 2, Insightful

      What you are describing is the "mountains of horribly complex software on top of XML" that I was referring to. Sure, you can always add one more layer of standards and software to address the deficiencies of what you started with. You could add a validation layer on top of absolutely anything; that doesn't mean that what you started with is any good.

      Also, this isn't just a matter of validation. It's a matter of actually being able to access the structure of the data you're trying to encode. OK, so let's say you've written an XML schema rule for gml:coordinates that says "this must contain numbers, then a comma, then numbers." You still have to run a separate parser to pull that information apart at parse time and convert strings to integers, and that data is still not accessible through the DOM or xpath or whatever.

    32. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 1

      Though I agree with you that many people don't understand the difference between marked-up text and data, your xml solution is inappropriate.

      Hey, I took the example (the first one, anyway) from a real XML technology! But another big problem with XML is that there isn't one single obvious way to encode this sort of data. What makes my solution objectively inappropriate compared with yours? What makes yours objectively better? Since there is no objectively correct way to map a 2-tuple of integers onto a tree of nodes and elements, people just do whatever comes to mind. And since there's no canonical way to turn a tree of nodes back into a 2-tuple, you're forced to do that yourself at parse time (or rely on your autogenerated code to do so).

    33. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 0
      You are either intentionally FUD'ing the issue, or you don't know what you're talking about.

      Do the contents of this node represent: [...]
      Any of the above--that's the point. XML parses text; meaning is applied by XML Schema (and/or the application).

      If you're an XML parser the answer is (1): it's a simple text string.
      Right. But, for most people I've talked with, "XML" != "XML parser". "XML" is used to imply a set of related technologies (which I'll call XML* for clarity), and in that context the contents can mean any number of things.

      So to get to the real data you have to parse that text string again to split on a comma, and to turn the two resulting text strings into numbers.
      I could, or I could use XML Schema and XPath to do it for me.

      Note this is a completely separate parser and is completely outside the XML data model, so all your fancy schema validation, xpath, etc. are useless to access data at this level.
      Er, no. This is exactly what those fancy technologies do for you.

      Because XML simply has no way to say "this is a list of things" or "this is a number."
      Again, no. It has several.

      yep, it keeps all that whitespace that you only intended for formatting. XML is a text markup language, so all text anywhere in the document is significant to the parser.
      DOM parsers do, SAX/Pull-DOM usually don't. There's a reason you have a choice. You were using the right parser for the job, right?

      JSON knows two things that your fancy shmancy XML parser will never know: that 100 and 200 are numbers, and that they are two elements of an array (which might be more appropriately thought of as a "tuple" in this context). It's smart enough to know that the whitespace is not significant [...]
      Why does JSON "know" this? Because it assumes it. That's the critical difference: JSON assumes a basic set of semantics, and shoe-horns everything into it. XML* assumes almost nothing, but requires a (sometimes hefty) set of additional definitions to encode the desired semantics. XML* allows the application to view the data at several levels of increasing abstraction; with JSON, the data is available exactly one way.

      it doesn't build this complex and meaningless node tree;
      Sure it does--you just don't see it. Just like you can do with XML*. JSON effectively combines a parser with a fixed schema and a sprinkling of predetermined queries thrown in. XML + XML Schema + XPath does a similar task, with scads more flexibility.

      it just lets you express, directly and succinctly, the data you are trying to encode.
      Finally you say something interesting. JSON is much more succinct than XML*. The price you pay is drastically reduced flexibility, introspection, and querying. Each has it's place.

      That's because JSON is a data format, and XML is a marked up text format.
      And you're off into bullshit again. If that were truly the case, then JSON would be passing around data preferentially in a binary format instead of formatting integers as strings only to parse them apart again on the far side. JSON is a text format designed to transfer a particular set of data primitives in a spatially and computationally efficient manner. It can be used to store information as well, but its lack of strong schema versioning and validation make stored JSON brittle over time.

      Did you catch that?
      Did you? Get your facts straight before you start calling other people dumb, bucko.
    34. Re:"How will you use XML in years to come?" by DragonWriter · · Score: 2, Interesting

      JSON is inflicting Javascript on everyone.

      No, it really doesn't, but if "JavaScript" in the name bothers you, you might feel better with YAML.

      No, it wouldn't because JSON is bare bones data. It's simply nested hash tables, arrays and strings.

      "You might feel better..." -> "No, it wouldn't..."? WTF is that supposed to mean? How is taht even a response to what precedes it?

      XML does much more than that.

      "JSON is..." -> "XML does much more than that." Again, this is incoherent. XML is simply tree-structured markup. It has less inherent semantic content than JSON/YAML. OTOH, JSON/YAML can do a lot more than what it is, just as XML can. Both JSON/YAML and XML can present pretty arbitrary data in manner which is fairly easy to parse automatically and fairly readable. XML strengths, IMO, is that its a more natural format for text-centric markup, and that it has a lot more maturity in the available tools and applications.

      The point is, though, JSON doesn't force JavaScript on anyone.

      Which sort of gets into the point I did want to make but was too impatient to explain: JSON is good where JSON is best, and XML is good where XML is best.

      That's kind of a dumb point to make without any discussion about which those areas are; as discussed above, the areas I see where XML is intrinsically superior are fairly narrow, though its currently probably better for lots of projects simply because its been established longer and has better tool support.

      There are other programming languages out there.

      And there are JSON and/or YAML libraries for quite a lot of them. So what?

      Would you like to live in a world of S-expressions?

      You missed the point again. Sure, there are other programming languages out there. The fact that there are JSON libraries for many of them underlines that the argument "JSON is forcing JavaScript on everyone" is false. JSON is an interchange format. It may be inspired by JavaScript, but it isn't forcing JavaScript on anyone.

      But, yeah, S-expressions are great.

      The LISP people would point out there are libraries to read/write S-expressions, so why use JSON?

      Since I didn't say "there are libraries to use JSON, so why use XML", but "there are libraries to use JSON from other languages, so JSON isn't forcing JavaScript on anyone", I think you miss the point. Anyone, real Lispers are more likely to say that "there are libraries to read/write S-expressions, so why use XML, which is essentially a more verbose but no more expressive or clear variant of S-expressions?*"

      The answer of course is that we want more than simply nesting lists of strings. We want our markup languages to fit our requirements, not the other way around.

      S-expressions are not "nesting lists of strings".

      We want our markup languages to fit our requirements, not the other way around.

      And, very often, a markup language inherently isn't a natural fit to data interchange requirements. JSON/YAML are both motivated by that specific fact. In fact, but for XHTML and office document formats, I've rarely seen an application where XML was used where a markup language was a really natural tool to start with. XML is popular because its a hammer that everyone's gotten really comfortable using, so every data interchange need is treated as if it were a nail, whether or not its actually a nail, a screw, or glue-on wallpaper.

      My problems with JSON are:

      This is certainly a limitation in JSON/YAML tool support. I don't think its an inherent limitation in the formats: either has

    35. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 1
      Only if your XML Parser doesnt support W3C XML Schema Part 2.
      1. you can add layers like validation onto absolutely anything -- it doesn't mean that what you started with was any good.
      2. JSON has a schema specification in the works too if validation is what you really want. But validation is a separate concern from having real data types, and JSON's design illustrates this. Validation is for checking the structure of the data -- putting data types at this level also is a hack.
      3. from what I can tell, you still don't get real data types from even an XML Schema-respecting parser (like an array of two integers) unless the parser supports the "post schema validation infoset," and it's not even clear to me whether you get real data types then.
      4. it should tip you off that you're using the wrong tool for the job when it takes 2 long and complicated specifications, and something called the "post schema validation infoset" to achieve what JSON achieves in one short and simple one.
      Seriously, the argument amounts to "a screwdriver is a great tool for hammering in nails, as long as your screwdriver supports the 'heavy piece of metal taped to the end' specification." Sure, you can probably get that to work, but why did you reach for the screwdriver in the first place?
    36. Re:"How will you use XML in years to come?" by DragonWriter · · Score: 2, Insightful

      While I hate XML Schema, it's still better for many uses than just throwing random crap on the wire and hoping that the other end can make sense of it.


      XML Schema may let the other end validate it, but it doesn't let the other end make sense of it. The other end can only make sense of it if they've got code written to handle the kind of data it contains: which is true, really, of any data format.
    37. Re:"How will you use XML in years to come?" by anomalous+cohort · · Score: 1

      JSON is great for AJAX where XML is clunky and a little bit slower

      I used to believe this until I started the web2newsportal project whose client component is a pure AJAX web app. The prototype javascript library and getElementsByTagName does a lot to remove the clunkiness of XML. Also, I am uncomfortable with the script injection vulnerabilities of JSON.

    38. Re:"How will you use XML in years to come?" by balls199 · · Score: 1

      There is a slight advantage to my solution over yours in the way it is parsed. Your version, as you have written it, is:

      elementNode name=gml:coordinates
      \-> textNode, text="\n " *
      \-> elementNode name=gml:coordinateX
      \-> textNode text="100"
      \-> textNode, text="\n " *
      \-> elementNode name=gml:coordinateY
      \-> textNode, text="200"
      \-> textNode, text="\n" *

      To write mine in the same format:

      elementNode name=gml:coordinates
      \-> attributeNode name=gml:coordinateX
      \-> textNode text="100"
      \-> attributeNode name=gml:coordinateY
      \-> textNode, text="200"

      Note how the text nodes between your inner element nodes do not show up if you use attributes. Though of little use in this example, if there are thousands of coordinates, when parsing my solution would save time and memory when parsing.

      This is not a major difference, but I think you can see why my solution is more appropriate.

    39. Re:"How will you use XML in years to come?" by ttfkam · · Score: 1

      Because they only work with LISP and LISP-like languages, because they don't fail-fast on invalid data, because you can't validate the input easily, because they don't support multiple character encodings, because the default character encoding isn't Unicode compatible...

      Should I go on?

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    40. Re:"How will you use XML in years to come?" by Ankh · · Score: 1

      For what it's worth, XPath is not a query language for the DOM, and is unrelated to the DOM: they were developed entirely separately, with different constraints, and in fact there is not a perfect match.

      XPath is an abstract addressing language for XML documents; XPath 2.0 makes it clear that you can use XPath (and XQuery and XSLT for that matter) over a wide range of things, as long as they can conform sufficiently well to a particular data model (XDM). there are implementations that let you use XPath over relational databases, with neither DOM nor in fact SQL under the covers.

      --
      Live barefoot!
      free engravings/woodcuts
    41. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 0

      Sorry, I'm quite a newbie in developerland, and I don't understand lots of things in your comment. Why do you want the XML parser to be aware of if it's dealing with a string or with an integer? The parser will be used only to select with DOM or XPath some parts of the document, and will return that parts to the application is using it. IIRC, there are schema-aware parsers that will allow or refuse documents that don't have content that fits some rules (and that rules can be "this element only can have integers").

      The point of XML (to me) is: you need to store data somehow (let's say it's application's configuration, for example); if the configuration is complex enough to reject INI-like files, you can create your custom format, and a parser for that, or you can use XML, and use one of the dozens of available parsers out there.

    42. Re:"How will you use XML in years to come?" by jhol13 · · Score: 1

      XSLT is a nice backwards chaining theorem prover, very similar to Prolog. I have never thought it that way. Maybe my limited knowledge of Prolog is the reason.

      I have used XSLT as an "improved-sed", i.e. kinda "extended" pattern-matching (& reg. exp.) engine. This is a huge simplification, obviously.

      Of course there is no magic in there. But I do not think it would be easy to do the same in Lisp or other conventional language, i.e. I do not think XSLT is "very easy" to implement.
    43. Re:"How will you use XML in years to come?" by Simon+Brooke · · Score: 1

      XSLT is a nice backwards chaining theorem prover, very similar to Prolog. I have never thought it that way. Maybe my limited knowledge of Prolog is the reason.

      I have used XSLT as an "improved-sed", i.e. kinda "extended" pattern-matching (& reg. exp.) engine. This is a huge simplification, obviously.

      Of course there is no magic in there. But I do not think it would be easy to do the same in Lisp or other conventional language, i.e. I do not think XSLT is "very easy" to implement.

      You can write a simple Prolog interpreter in about thirty lines of LISP. Of course there's more to XSLT than that, because of namespace handling; but not a lot more.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    44. Re:"How will you use XML in years to come?" by Anonymous Coward · · Score: 0

      Why all this pain? Because XML simply has no way to say "this is a list of things" or "this is a number."

      Sure, you can approximate such things. You could write something like:

      <gml:coordinates>
          <gml:coordinateX>100</gml:coordinateX>
          <gml:coordinateY>200</gml:coordinateY>
      </gml:coordinates>

      But the fact remains that even though you may intuitively understand this to be two coordinates when you look at it (and at least you can select the coordinates individually with xpath in this example, but they're still strings, not numbers) to XML this is still nothing but a tree of nodes. Wow, dude. Did you stop to think that there are many markup languages built on top of XML that can represent such things?

      <?xml version="1.0"?>
      <!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">]>
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                              xmlns:myns="http://www.example.com/namespace">

      <rdf:Description rdf:about="http://www.example.com/datasets/2007/ny">
          <myns:coords rdf:parseType="Resource">
              <myns:x rdf:datatype="decimal">100.0</myns:x>
              <myns:y rdf:datatype="decimal">200.0</myns:y>
          </myns:coords>
      </rdf:Description>

      Simple enough. Spec here and any RDF parser should handle it just fine, as both a coordinate pair and an individual value. The examples on that w3 page also include value/unit pairs. You're right though, it is just a tree of nodes until you parse it. In fact, it's just one long string until you parse it. Imagine that....
    45. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 2, Interesting

      Wow, dude. Did you stop to think that there are many markup languages built on top of XML that can represent such things?

      Yes in fact I did. That's what I was referring to when I talked about the "mountains of horribly complex software" on top of XML.

      [0.5k of RDF that expresses 100, 200 as integer coordinates]

      Simple enough.


      Thank you for expressing so succinctly exactly why I am so depressed. How did you XML people come to have such low standards? How can you call "simple enough" a fragment of code that takes 0.5k of text to express a pair of coordinates, and takes 3 hefty specifications worth of software to make any sense of it (XML, XML Namespaces, and RDF)? Do you realize that the comparable JSON is {"coords": {"x": 100, "y": 200}} which can be fully parsed with well under 500 lines of C?

      What words did XML seduce you with that you're willing to put up with this kind of abuse? How can you be convinced that this relationship is good for you?

      You're right though, it is just a tree of nodes until you parse it. In fact, it's just one long string until you parse it. Imagine that....

      Um, no. It's a tree of nodes after you parse it with an XML parser -- that's the problem.

    46. Re:"How will you use XML in years to come?" by rmerry72 · · Score: 1

      As to the future of XML, there is one feature I would really like to see added, a BDATA equivalent to the existing CDATA stuff. You can use to insert character data in to XML, but it's a pain trying to use this for binary data...

      XML is a text standard. Its not for describing binary data. Some might say XML is for "human readable" text at that and that CDATA has no place (I don't agree). But it is for describing text not binary.

      As is email, BTW. That's why email has MIME and base-64 encoding. Come to think of it, so does news. UseNet is for text and aslo has base-64 for binary encoding.

      Sounds like for what you are trying to do a standard for describing text is not what the best fit. Try a binary standard / format. I'd suggest not bastardising a standard just because some people are trying to use it for what it was not intended. If you do, you'll end up with non-standard standard (think Javascript).

      --
      We do not inherit the Earth from our parents. We borrow it from our children.
    47. Re:"How will you use XML in years to come?" by rmerry72 · · Score: 1

      Seriously, the argument amounts to "a screwdriver is a great tool for hammering in nails, as long as your screwdriver supports the 'heavy piece of metal taped to the end' specification." Sure, you can probably get that to work, but why did you reach for the screwdriver in the first place?

      Because a "Team Leader" with an MBA told him to. After all the screwdriver is "industry standard" and was cheaper than the hammer. Well, our budget covers screw drivers but not hammers, so it will do fine, you'll never notice the difference. God, you can't leave such important decisions to tech people, they just want toys to play with.

      --
      We do not inherit the Earth from our parents. We borrow it from our children.
    48. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 1

      Note this is a completely separate parser and is completely outside the XML data model, so all your fancy schema validation, xpath, etc. are useless to access data at this level. Er, no. This is exactly what those fancy technologies do for you. Please write for me an XPath expression that gives you the number "100" from the XML fragment <gml:coordinates>100,200</gml:coordinates>, without using XPath to manually break apart the string "100,200."

      You can't. Why? Because XPath doesn't have access to the part of your application in which you broke apart the opaque string "100,200" into actual data. Q.E.D.

      Why does JSON "know" this? Because it assumes it. That's the critical difference: JSON assumes a basic set of semantics, and shoe-horns everything into it. XML* assumes almost nothing, but requires a (sometimes hefty) set of additional definitions to encode the desired semantics. XML* allows the application to view the data at several levels of increasing abstraction; with JSON, the data is available exactly one way. This is a really fundamental misunderstanding of the difference between JSON and XML. To demonstrate, I will blow your mind by showing that you can quite effortlessly encode XML semantics using JSON if you really want to:
      ["html",
          ["head",
              ["title", "Some Crappy Web Page"],
              ["script", "alert('Hello, world!')"],
              ["link" {"rel": "stylesheet", "href": "foo.css"}],
          ],
          ["body",
              ["h1" "My crappy headline"]
          ]
      ]


      If this was a useful way to encode data, you could use JSON do to this. But it's not, so nobody does.
    49. Re:"How will you use XML in years to come?" by shutdown+-p+now · · Score: 1

      You still have to run a separate parser to pull that information apart at parse time and convert strigs to integers, and that data is still not accessible through the DOM or xpath or whatever.
      No idea about DOM, but schema is certainly accessible from XPath/XQuery/XSLT if you're using a schema-aware parser. You can query for types, do casts etc, and the interpreter will bark if you do it wrong, just as any strongly-typed language would have done. And, of course, you can embed the schema into the XML document itself, and a schema-aware XML parser would read it just as it reads the document, and start applying it immediately afterwards to validate the rest of the document.
    50. Re:"How will you use XML in years to come?" by shutdown+-p+now · · Score: 1

      The fault with people here lies in XML abuse, namely SOAP-like XML API-s and using XML for everything, where binary formats, or more compact and simpler formats, like JSON, do better.
      And the reason why they do so is that existing libraries for XML parsing/generation/validation etc are generally much more mature. This doesn't justify every single case, of course - I still firmly believe that using XML for any sort of RPC that is intended to handle more than one request per second is madness - but for many cases, it's far simpler to use the stock XML parser that comes with your favorite framework (Java/.NET/whatever), than to go looking for a third-party JSON lib. A good example of where this mentality is very common, and actually reasonable, are config files.
    51. Re:"How will you use XML in years to come?" by CoughDropAddict · · Score: 1

      No idea about DOM, but schema is certainly accessible from XPath/XQuery/XSLT if you're using a schema-aware parser. You can query for types, do casts etc, and the interpreter will bark if you do it wrong, just as any strongly-typed language would have done. Let's take the XML document <gml:coordinates>100, 200</gml:coordinates> (this is real GML). You get to use whatever schema you want, and parse it all with a schema-aware parser. Now write for me an XPath expression that gives you the number "100" as an integer, without using XPath to manually break apart the string "100, 200."

      XQuery I'm not familiar with -- maybe this really is possible at that level.
    52. Re:"How will you use XML in years to come?" by shutdown+-p+now · · Score: 1

      Can't do that with either XPath or XQuery (they use the same type system anyway, the XSD one), but that's because GML is apparently designed without thinking of how it would have to be Schema-typed. XSD is certainly rather more limiting than plain untyped XML (or RELAX NG, for that matter), but is expressive enough for pretty much all purposes. In this case, the obvious answer is that the proper (for XSD anyway) way to define coordinates would've been

    53. Re:"How will you use XML in years to come?" by tola2000 · · Score: 1

      100 and 200 are not "just" numbers. These are representation of a geographical position. If you consider it as numbers I do not agree that you are using the correct strong types. If you add the restrictions that they represent a geographical position in degrees, only then you have a really strong type. This is what XML Schema offers you. Maybe XML Schema is not the best standard ever. But to be interoperable you have to have a common weadly spread standard. And that is what XML Schema is.

  2. You know the saying by Anonymous Coward · · Score: 5, Funny

    XML is like violence. If it doesn't solve your problem, you're not using enough of it.

    1. Re:You know the saying by palegray.net · · Score: 1, Funny

      Taking your advice, I set up my server to output 10 MB of randomized XML for every pageview on all my websites, but all I got was this lousy bandwidth bill... thanks a lot, buddy.

    2. Re:You know the saying by Anonymous Coward · · Score: 0

      XML is like violence. If it doesn't solve your problem, you're not using enough of it.

  3. I don't understand... by ilovegeorgebush · · Score: 5, Insightful

    I don't get it. We can argue the merits of data exchange formats 'till we're blue in the face; yet I cannot see why XML is so popular. For the majority of applications that use it, it's overboard. Yes, it's easier on the eye, but ultimately how often do you have to play with the XML your CAD software uses?

    I'm a programmer, just like the rest of you here, so I'm quite used to having to write a parser here or there, or fixing an issue or two in an ant script. The thing that puzzles me, is why it's used so much on the web. XML is bulky, and when designed badly it can be far too complex; this all adds to bandwidth and processing on the client (think AJAX), so I'm not seeing why anyone would want to use it. Formats like JSON are just as usable, and not to mention more lightweight. Where's the gain?

    1. Re:I don't understand... by daeg · · Score: 1

      I can see using it for some program data formats, but for one reason only: upgrading old file formats to a new format via XSL. In practice, I'm unaware of many software packages that do this, though.

    2. Re:I don't understand... by Anonymous Coward · · Score: 0

      > how often do you have to play with the XML your CAD software uses?

      Quite frequently I'll dump XML from applications and manipulate it using a script. Inkscape for example - I'm more skilled at programming than using the app. Having the option to dump to XML is always welcome -- it's not difficult to generate.

      > I'm quite used to having to write a parser here or there

      So a parser for an undocumented binary format takes you how long on average to write? It takes me 30 seconds to write a script that loads an XML document (and hopefully the format isn't OOXML style blob in XML).

      I'm no fan of verbosity or bloat but XML is fine for webpages (XHTML/deflate), business documents and config files that require nested data structures. It's not always the answer though and is surely misused for things like SVG. I'd like to see a standardized JSON serialization for SVG, not one that requires script to parse -- just a more compact format for stuff that nobody in their right mind will ever edit by hand.

    3. Re:I don't understand... by SpaceHamster · · Score: 5, Insightful

      My best stab at the popularity:

      1. Looks a lot like HTML. "Oh, it has angle brackets, I know this!"
      2. Inertia.
      3. Has features that make it a good choice for business: schemas and validation, transforms, namespaces, a type system.
      4. Inertia.

      There just isn't that much need to switch. Modern parsers/hardware make the slowness argument moot, and everyone knows how to work with it.

      As an interchange format with javascript (and other dynamically typed languages) it is sub-optimal for a number of reasons, and so an alternative, JSON has developed which fills that particular niche. But when I sit down to right yet another line of business app, my default format is going to be XML, and will be for the foreseeable future.

      --
      "BeOS is a great operating system" -Doug Miller, Microsoft
    4. Re:I don't understand... by El+Cubano · · Score: 3, Funny

      For the majority of applications that use it, it's overboard.

      You mean like this?

    5. Re:I don't understand... by GodfatherofSoul · · Score: 5, Insightful

      XML gives you a parsable standard on two levels; generic XML syntax and specific to your protocol via schemas. It's verbose enough to allow by-hand manual editing while the syntax will catch any errors save semantic errors you'll likely have. It's also a little more versatile as far as the syntax goes. Yes, there are less verbose parsing syntaxes out there, but you always seem to lose something when it comes to manual viewing or editing.

      Plus, as far as writing parsers, why burn the time when there are so many tools for XML out there? It's a design choice I suppose like every other one; i.e. what are you losing/gaining by DIYing? Personally, I love XML and regret that it hasn't taken off more. Especially in the area of network protocols. People have been trying to shove everything into an HTML pipe, when XML over the much underrated BEEP is a far more versatile. There are costs, though as you've already mentioned.

      --
      I swear to God...I swear to God! That is NOT how you treat your human!
    6. Re:I don't understand... by machineghost · · Score: 5, Interesting

      The "bulkiness" of XML is also it's strength: XML can be used to markup almost any data imaginable. Now it's true that for most simple two-party exchanges, a simpler format (like comma separated values or YAML or something) would require less characters, and would thus save disk space, transmit faster, etc.

      However, the modern programming age is all about sacrificing performance for convenience (this is why virtually no one is using C or C++ to make web apps, and almost everyone is using a significantly poorer performing language like Python or Ruby). We've got powerful computers with tons of RAM and hard drive space, and high-speed internet connections that can transmit vast amounts of data in mere seconds; why waste (valuable programmer) time and energy over-optimizing everything?

      Instead, developers choose the option that will make their lives easier. XML is widely known, easily understood, and is human readable. I can send an XML document, without any schema or documentation, to another developer and they'll be able to "grok it". There's also a ton of tools out there for working with XML; if someone sends me a random XML document, I can see it syntax colored in Eclipse or my browser. If someone sends me an XML schema, I can use JAXB to generate Java classes to interact with it. If I need to reformat/convert ANY XML document, I can just whip up an XSLT for it and I'm done.

      So yes, other formats offer some benefits. But XML's universality (which does require a bit of bulkiness) makes it a great choice for most types of data one would like to markup and/or transmit.

      P.S. JSON is just as usable? Try writing a schema to validate it ... ok I admit, that wasn't so hard, just some Javascript right? But now you have to write a new batch of code to validate the next type of JSON you use. And another for the next, and so on. With XML, you have a choice of not one but four different schema formats; once you learn to use one of them, you can describe a validation schema far more quickly than you ever could in Javascript.

      Same deal with transformations: if you want to alter your JSON data in a consistent way, you have to again write custom code every time. Sure XSLT has a learning curve, but once you master it you can accomplish in a few lines of code what any other language would need tens or even hundreds of lines to do.

    7. Re:I don't understand... by Anonymous Coward · · Score: 5, Insightful

      I don't get it. We can argue the merits of data exchange formats 'till we're blue in the face; yet I cannot see why XML is so popular.

      Because it's a standard that everyone (even reluctantly) can agree on.

      Because there are well-debugged libraries for reading, writing and manipulating it.

      Because (as a last resort) text is easy to manipulate with scripting languages like perl and python.

      Because if verbosity is a problem, text compresses very well.

    8. Re:I don't understand... by maxwell+demon · · Score: 1
      Of course the right level of bloat would be like this:

      <node type="tagged">
        <tag>
          rootNode
        </tag>
        <properties />
        <content>
          <node type="tagged">
            <tag>
              numberOfAddresses
            </tag>
            <properties />
            <content>
              <node type="text">
                <text>
                  110
                </text>
              </node>
            </content>
          </node>
          <node type="tagged">
            <tag>
              address_1
            </tag>
            <properties />
            <content>
              <node type="text">
                <text>
                  442 Fake St.
                </text>
              </node>
            </content>
          </node>
      ...
        </content>
      </node>
      --
      The Tao of math: The numbers you can count are not the real numbers.
    9. Re:I don't understand... by Xtifr · · Score: 4, Interesting

      Like a lot of things, XML is popular because it's popular. Parsing is done with libraries, so programmers don't have to see or care how much overhead is involved, and it's well-known and well-understood, so it's easy to find people who are familiar with it. Every programmer and his dog knows the basics. It's easy to cobble up some in a text editor for testing purposes. You can hand it off to some guy in a completely separate division without worrying that he's going to find it particularly confusing. And you can work with it in pretty much any modern programming language without having to worry about the messy details. It's the path of least resistance. It may not be good, but it's frequently good enough, and that's usually the bottom line.

      I mean, yeah, when I was a kid, we all worked in hand-optimized C and assembler, and tried to pack useful information into each bit of storage, but systems were a lot smaller and a lot more expensive back then. These days, I write perl or python scripts that spit out forty bytes of XML to encode a single boolean flag, and it doesn't even faze me. Welcome to the 21st century. :)

    10. Re:I don't understand... by batkiwi · · Score: 5, Insightful

      XML IS:
      -Easily validated
      -Easily parsed
      -Easily compressed (in transit or stored)
      -Human readable in case of emergency
      -Easily extendable

    11. Re:I don't understand... by Anonymous Coward · · Score: 3, Insightful

      For one, it has off-the-shelf parsers and validation tools. Parsing XML is, at it's hardest, a matter of writing a SAX parser. XML binding APIs make things even easier. The standardized validation tools also make it great for ensuring that people in charge of generating the data are using the form expected by those receiving the data.

      Our biggest usage is in our customer data feeds. These feeds are often 1GB+ when compressed. Since switching to an XML format from a tab-delimited format, we've been able to give our customers an XSD to validate the file before sending it to us. The result has been far fewer round trips between us and our customers before receiving an acceptable feed. As you can probably imagine, fewer round trips is a very good thing when each round trip involves sending 1GB+ of data over the internet.

      Also, gzip and other compression methods do very well with XML files...to the point where the difference between a compressed XML file and a compressed JSON or other formatting of the same data is pretty minimal. So your point about AJAX applications isn't particularly relevant once you've enabled gzip content coding.

      The human-readable benefit is more of a nice side effect rather than a must have, though it does come in quite handy when debugging.

      So you might want to ask yourself why not use it? What are the drawbacks of your CAD program using XML to store its files, especially if it does something like OpenOffice does by compressing them. Why not take advantage of tools that make it simple to parse information? If it's just the "XML is bulky" complaint, that's basically been addressed.

    12. Re:I don't understand... by kwerle · · Score: 2, Insightful
      I don't get it. We can argue the merits of data exchange formats 'till we're blue in the face; yet I cannot see why XML is so popular. For the majority of applications that use it, it's overboard. Yes, it's easier on the eye, but ultimately how often do you have to play with the XML your CAD software uses?

      Let's say you need to store data, and a database is not an option. What format shall you store it in?
      1. Proprietary binary
      2. Proprietary text
      3. JSON
      4. XML


      1 & 2 are untried, untested, and it is not possible to find 3rd party tools for working with/validating/generating/etc.
      3 is just insane.
      With XML you get a very well tested format. You get a million libraries and tools (a few of which don't suck) in any language you care to mention. Your users get all the benefits of an open spec and all the same tools. The question becomes: why would you not use XML?
    13. Re:I don't understand... by maxwell+demon · · Score: 2, Insightful

      -Easily compressed (in transit or stored)

      Which just means that it has lots of redundancy. Or, as one might call it, bloat.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    14. Re:I don't understand... by mi · · Score: 0, Flamebait

      Yes, it's easier on the eye

      Except it is not even that! Even when nicely formatted, it is not... It sucks. It can't be processed with the likes of awk and sed. You can't print it. It takes A LOT more space (try compressing it) and it is hard to author. In addition it takes noticeable CPU-power to parse and application memory to store.

      I'm forced to use it by the software vendor (who are stupid enough to use it even between their own components), and am fed up to the gills... These idiots use it for log-files, which they consequently don't write out, until a task is done, defeating most of the purpose of a log file.

      I wish, it was never invented...

      --
      In Soviet Washington the swamp drains you.
    15. Re:I don't understand... by Sta7ic · · Score: 1

      Much agreed with 2, 3, and 4. For better or worse, one of the project managers is big on XML and web services, to the point that developing web services is the first thing that I think of with their name.

      You know what they say about round holes and square pegs? I've come to learn that XML is like play-doh. It's not round and it's not square, but it doesn't feel strong enough to last at the end of the day.

    16. Re:I don't understand... by solafide · · Score: 2, Insightful

      so programmers don't have to see or care how much overhead is involved

      Which is how we got to the point where, Dr. Dewar and Dr. Schonberg:

      ...students who know how to put a simple program together, but do not know how to program. A further pitfall of the early use of libraries and frameworks is that it is impossible for the student to develop a sense of the run-time cost of what is written because it is extremely hard to know what any method call will eventually execute.
      And you're saying overhead doesn't matter?
    17. Re:I don't understand... by Anonymous Coward · · Score: 0

      Because if verbosity is a problem, text compresses very well. This gave me an idea for a new image format:

      <image>
          <row>
              <pixel color="#FFFFFF"/>
              <pixel color="#000000"/>
              <pixel color="#FFFFFF"/>
          </row>
          <row>
              <pixel color="#000000"/>
              <pixel color="#FFFFFF"/>
              <pixel color="#000000"/>
          </row>
          <row>
              <pixel color="#FFFFFF"/>
              <pixel color="#000000"/>
              <pixel color="#FFFFFF"/>
          </row>
      </image>

      It may look a little too verbose for a 3x3 image, but it's text, so it compresses very well!

      Patent pending
    18. Re:I don't understand... by Xtifr · · Score: 3, Insightful

      From an academic viewpoint, it probably matters. From a point of view of trying to get the job done...not so much. I studied the performance and efficiency of a wide variety of sort algorithms when I was in school, but nowadays, I generally just call some library to do my sorting for me. It may not be quite as efficient for the machine to use some random, generic sort, but for me, it's the difference between a few seconds to type "sort" vs. a few hours to code and debug a sort routine that is probably, at best, only a few percent faster.

      XML is, in many cases (including mine), the path of least resistance. It's not particularly fast or efficient, but it's simple and quick and I don't have to spend hours documenting my formats for the dozens of other people in the company who have to use my data. Many of whom are probably not programmers by Dewar and Schonberg's definition, but who still do valuable work for the company.

    19. Re:I don't understand... by Anonymous Coward · · Score: 0

      Pure memory dump. Fast, painless, just works. Those other options are only worth bothering with if you have to interoperate with some other programs. That's usually handled better with a database.

    20. Re:I don't understand... by Anonymous Coward · · Score: 0

      It may look a little too verbose for a 3x3 image, but it's text, so it compresses very well!

      You're trying to be sarcastic but base32 and base64 are fairly efficient methods for encoding binary data as text and therefore as valid XML data. And it still compresses very well.

      And if all you're sending are images, you're not sending them as XML to begin with are you.

    21. Re:I don't understand... by martin-boundary · · Score: 1
      Two things:

      How do you know if what you've done actually gets the job done? Any monkey can type away randomly and get something done, but it's usually not the job that actually needs doing. For that, you need the skills academic work teaches.

      You missed the point of studying sorting algorithms. They are taught not so that you can reimplement a quicksort later in life, they are taught because they are a great no-frills case study of the basic concepts you need to get a job done while knowing that you got the job done. Sorting is how you were taught to think logically and methodically, which are the skills you use every day in your programming career.

    22. Re:I don't understand... by Otto · · Score: 4, Insightful

      -Easily compressed (in transit or stored)

      Which just means that it has lots of redundancy. Or, as one might call it, bloat. Test question: Which is quicker?
      1. Spending a few hours coding your formats in some binary format making maximum use of all the bits.
      2. Spending a few minutes writing code to send your internal data structure to a library that will serialize it into XML and then running the XML through a generic compression routine (if space/speed actually makes any difference to your particular application).

      Consider the question in both the short and the long term. Also consider that you're paying that programmer a few hundred an hour.

      Discuss.

      --
      - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
    23. Re:I don't understand... by filbranden · · Score: 1

      It can't be processed with the likes of awk and sed.

      Just because you can't use tools made for processing text in Unix line-based format, doesn't mean there aren't tools for this purpose. You can even find tools inspired on awk for XML processing, like xmlgawk (also here).

      However...

      I agree with you that XML is not the answer for everything. For instance, I just hate XML configuration files, exactly because you can't reliably grep, sed, awk, ex, them. Editing XML with vi is not the nicest task either. For config files I usually like INI-style files, for which there are modules in Python and Perl, and you can easily get around with simple shell tools when you just need a dirty hack. A config file usually has a simple enough structure to allow you to specify anything you need in the constraints of INI files (if it doesn't, you should probably rethink your config, it's probably bloated!).

      For other tasks such as tabular data, CSV or just plain text delimited by tabs or ":" (think /etc/passwd) are more suited than XML, exactly for the ability to use simple universal tools (grep, sed, awk) on the data. It's even easier to visually inspect a table if it's in CSV or tab-delimited than it is to inspect an XML file and try to see through the tag soup.

      Your comment about logfiles is right on the spot! Log files are just made to be grepped. Anything that doesn't write all relevant information of an action on one line, at the time the action happened, really defeats the purpose of logging.

    24. Re:I don't understand... by batkiwi · · Score: 2, Insightful

      Why is it bloat? How does it affect anything?

      -it doesn't affect transit time when compressed
      -it minimally takes more cpu to gunzip a stream, but the same could be said of translating ANY binary format (unless you're sending direct memory dumps, which is dangerous)
      -it's never really in memory as the entire point is to serialize/deserialize

    25. Re:I don't understand... by bluFox · · Score: 2, Informative

      | And if all you're sending are images, you're not sending them as XML to begin with are you. hmmm maybe

      --
      ~561
    26. Re:I don't understand... by Timothy+Brownawell · · Score: 1

      Either sqlite or custom binary, depending on what the data is and why a database is "not an option".

    27. Re:I don't understand... by ianare · · Score: 1

      For some config files, XML is the easiest way to go. I wrote an app that stores the entire hierarchy of the GUI's frames, panels, and values as nested nodes of XML. The app then looks at those XML nodes and recreates itself accordingly when loading the config. Using python's xml.dom.minidom makes it easier to work with.

      I agree that in most cases it is overkill, if you know exactly which values need to go where, python's config parser is much easier and the resulting files are smaller.

      Regarding CSV files and the like, again they are sufficient when dealing with 2D data, but once you get into hierarchal structures it becomes much more effort on the part of the program's logic and processing. Also the legibility of the files are better, if indented correctly with something like toprettyxml of course. At that point though it's even easier to go with SQL, unless high portability and/or transfer is required.

      As more often than not it's the application that is good or bad, not the tool. XML can be a great tool, if chosen and used correctly.

    28. Re:I don't understand... by Anonymous Coward · · Score: 0

      And if all you're sending are images, you're not sending them as XML to begin with are you. hmmm maybe

      Ahem, if all you're sending are bitmapped images, you're not sending them as XML to begin with are you.

      Better?

    29. Re:I don't understand... by TummyX · · Score: 1

      Duh.

      Because XML is a standard. Almost all languages have a standards compliant XML parser that you can easily use. Why invent a new format and a parser, when you can use an existing standard that has most of the issues already sorted out? You don't have to spend time working out if a bug is caused by your parser or something else. XML handles things like character escaping, unicode, etc gracefully whereas a format you design may not unless you spend a lot of time on it.


      Formats like JSON are just as usable, and not to mention more lightweight. Where's the gain


      Again, because XML is a standard. Everyone speaks the language. The pitfulls and caveats of XML are well understood by most, if not all, developers and companies.

    30. Re:I don't understand... by C10H14N2 · · Score: 1

      this all adds to bandwidth and processing on the client (think AJAX),

      Why? You can perform XSL transformations on the server and return plain HTML.

    31. Re:I don't understand... by MrNaz · · Score: 1

      You've obviously never worked with accounts. Or networks. Or anything requiring reliability, really. Redundancy != bloat, although sometimes it may be.

      --
      I hate printers.
    32. Re:I don't understand... by elloGov · · Score: 1

      yet I cannot see why XML is so popular I will take a stab at XMLs popularity as well. 1. Looks like HTML 2. Came to the scene with a huge hype 3. It's more complex(more headache is what I meant) than YML or JSON, hence has the feel that it is more capable. Ironically, it is to simplify your life and your work. 4. It can be used as a properties file, data transfer file, SOAP calls, etc... Multiple uses of it. 5. Finally ton of complimenting technology and applications built around it. Like most of you, I do not think the future of XML envisioned is accurate as JSON and YML are far more superior in the arena that the article specifies.
    33. Re:I don't understand... by cyborch · · Score: 1

      Which just means that it has lots of redundancy. Or, as one might call it, bloat. Test question: Which is quicker?
      1. Spending a few hours coding your formats in some binary format making maximum use of all the bits.
      2. Spending a few minutes writing code to send your internal data structure to a library that will serialize it into XML and then running the XML through a generic compression routine (if space/speed actually makes any difference to your particular application).

      Consider the question in both the short and the long term. Also consider that you're paying that programmer a few hundred an hour.

      Discuss.

      or...

      3. Spending a few minutes writing code to send your internal data structure to a library that will serialize it into YAML and then NOT running the YAML through a generic compression routine (since YAML has far less bloat and therefore far less need for compression).

      I think I'll go for option 3.

    34. Re:I don't understand... by cyborch · · Score: 1

      Redundancy != Bloat

      but

      Unneeded redundancy == Bloat

      See YAML for an alternative to XML which has the same features with less bloat.

    35. Re:I don't understand... by l0b0 · · Score: 2, Insightful

      Maybe another comparison would help: QWERTY vs. Dvorak. The one "everyone" knows and uses - and, incidentally, design keyboard shortcuts according to; I'm looking at you, Vim - was designed to avoid jams in mechanical keyboards way back in the ass-end of time, while the other was designed to be efficient on electronic hardware.

      A "Dvorak solution" for XML would have to solve some fundamental problem while keeping all the good attributes (no pun intended) of the original. IMO, that would mean more readable cdata separators, less or no attributes (most data is not truly atomic, and having lists in attributes is just ugly), and doctype declarations moved to the XML header.

    36. Re:I don't understand... by Otto · · Score: 1

      YAML? Are you serious? Yet another data structure that is basically worthless in the real world?

      I mean, I'm no fan of JSON in general (it's fine for certain cases), but at least it has the advantage of not necessarily needing a parser since it's just javascript syntax.

      Looking through YAML, you get all the disadvantages of XML (must require a parser), along with it being both whitespace and character set dependent.

      --
      - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
    37. Re:I don't understand... by Slugbait · · Score: 1

      Just to be clear, the first two of these things are (relatively) easy because the libraries that perform the functions are already written. Actually writing an XML parser is unnecessarily of tricky because it requires schema understanding (in ... is there a text element between foo and bar?). Writing a validator is tricky because validation is a hard problem.

    38. Re:I don't understand... by Hal_Porter · · Score: 1

      If you want error correction, add error correction with a code designed by people who know what they're doing. Like one of the ones here -

      http://en.wikipedia.org/wiki/Error_correction

      And if you want redundancy look at databases or log structured filesystems.

      Encoding as data as ASCII can be thought of adding redundancy I suppose, but it's very primitive compared to these technologies.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    39. Re:I don't understand... by oliderid · · Score: 1

      Formats like JSON are just as usable, and not to mention more lightweight. Where's the gain?

      The first thing coming to my mind:
      no schema.

      When you work in extremely complex environment, with different companies located in different cities/countries/continent...You need it.

    40. Re:I don't understand... by Tony+Hoyle · · Score: 1

      I was looking at a document management system the other week. Checkout a single document..? 4 A4 pages of XML.

      It started endless DAV requests apparently wanting the same information in a slightly different format each time.
      Then there was the deltaV checkout and about a half a page of xml just to describe exactly what it wanted.
      Then it went into a proprietary protocol, and spend 2/3rds of a page spooling xml with mostly empty tags to the server.

      And that was to get *one* document.

      Well over 90% of that was markup, not useful data. XML was the *wrong* thing to use for this, but it was used anyway.

    41. Re:I don't understand... by ProfessionalHostage · · Score: 1

      The only reason for me to stick with XML is because other 'markup language' doesn't have anything close to XPath, that and XSLT, and maybe DTD.

      We're working on this project where we take input from the client, process it, and eventually generates output as printable-report sheet. It was a lot easier when our reporting-engine of choice uses XML internally, so all we have to do is to whip out XSLT to manually create XML document and feed it to the report-engine so it can render the report and send it back to the client via internet.

      Sure, you can say "that's because the reporting engine uses XML dumb ass". But what I'm trying to say is there's no other ML (at least the ones I aware of) that capable doing something like XSLT (and XPath, expressions to figure out the data inside the document) does.

      Compared to JSON and YAML, I can't help to say that it's true that XML is uglier and bulky, but it gets the job done and still a damn-good alternative than serialization/memory dump. Maybe that's why XML is so popular around here, not sure about you though.

      There's a place for everything, the gain is inside your choice based on technical merit to the problem at hand.

    42. Re:I don't understand... by R_Dorothy · · Score: 2, Informative

      How do you know if what you've done actually gets the job done?

      If it doesn't get bumped back to me in UAT then it's getting the job done.

      --
      Stupid flounders!
    43. Re:I don't understand... by squiggleslash · · Score: 1

      Well, never came across it before before reading this discussion, but having read the Wikipedia page on the subject, assuming the latter is accurate, I'd say YAML doesn't have all the disadvantages of XML. It looks more efficient, and moreover it looks genuinely readable and editable, something XML rarely is (simply being in text format does not make you human readable.)

      Any format you write to requires some kind of "parser", whether it's a custom format, something built-in to the interpreter, or "libmypreferredgenericmarkupformat.o"; so saying that "all" the disadvantages of XML constitute "must require a parser" is, well, overstating it. XML's major issues are that it's unbelievably inefficient in storage and CPU/memory usage, difficult to read for any non-trivial amount of data, difficult to edit outside of specialized editors for non-trivial amounts of data, and completely unsuitable for high volume information (such as images, sound, or video.) YAML looks like it is more efficient than XML for storage and memory usage, and easier to read and edit using generic text manipulation tools. It's still not going to beat CSVs for generic lists, but it's a start.

      --
      You are not alone. This is not normal. None of this is normal.
    44. Re:I don't understand... by grumbel · · Score: 1

      ...at best, only a few percent faster. True, when you compare one fast sorting algorithm with another fast one you likely won't find much advantage unless you have some special case. However with XML the situation is very different, since XML is slow and not just a little bit. A custom format can easily outperform XML by a factor of 1000% or even 10000% and that can be quite significant.
    45. Re:I don't understand... by squiggleslash · · Score: 1

      The pitfulls and caveats of XML are well understood by most, if not all, developers and companies.

      And yet they still use it!

      --
      You are not alone. This is not normal. None of this is normal.
    46. Re:I don't understand... by SimonInOz · · Score: 2, Interesting

      >> Test question: Which is quicker?
      >> 1. Spending a few hours coding your formats in some binary format making maximum use of all the bits.
      >> 2. Spending a few minutes writing code to send your internal data structure to a library that will serialize it into XML and then running the XML through a generic compression routine (if space/speed actually makes any difference to your particular application).

      A while back (before XML parsers were common) I built a kinda cool system whereby a mainframe programmer built a system that read 3270 page descriptions and converted them to XML. At the other end, I wrote a generator that built huge amounts of VB (hey - it worked .. it had to build corresponding page objects) to handle it at the other end.
      This replaced a complex and incredibly expensive system using a proprietary binary format.

      I was amazed (and delighted) to find the XML system was actually faster - even before we put compression on the data.

      And it was was a damned sight easier to handle, upgrade, extend - and pay for!

      Go XML, I say.

      (And it was soo cool to generate, say, 100,000 lines of code and have it compile and work straight off the bat).

      --
      "Cats like plain crisps"
    47. Re:I don't understand... by TheRaven64 · · Score: 1
      You missed a big one:

      5. It has an X in the name.

      Every cool technology has an X in the name (UNIX, ActiveX, DirectX), and the existence of the X allows people to overlook the fact that they are just plain bad ideas.

      --
      I am TheRaven on Soylent News
    48. Re:I don't understand... by Viol8 · · Score: 2, Informative

      "Especially in the area of network protocols."

      Oh please. Its bad enough having this bloated standard in data files , but please don't start quadrupaling the amount of bits that need to be sent down a pipe to send the same amount of data just so it can be XML. XML is an extremely poor format to use for any kind of streamed data because you have to read a large chunk of it to find suitable boundaries to process. Not good for efficiency or code simplicity. And if you say "so what" to that then you've obviously never done real network coding where throughput is THE number one priority. I've written data links to stock exchanges and clustered systems amongst other things and believe me , speed is where its at. Anyone suggesting using XML would be laughed out of the building

      "People have been trying to shove everything into an HTML pipe"

      I think that about says it all. God help us if people like you ever get into a decision making position. Oh , wait...

      Do yourself a favour pal, go learn about network systems programming from the ground up - start with ethernet frames and work up from there to IP/TCP, sockets, memory mapped packets etc. Then you may just get a clue.

    49. Re:I don't understand... by Viol8 · · Score: 0, Troll

      You're wasting your breath. Lego brick style programmers like him do the minimum of what they need to do and no more. They take no pride in their work nor do they care how well it works so long as they get away with it. They're the bain of the IT industry and the reason for a lot of the current issues with software unfortunately.

    50. Re:I don't understand... by fatphil · · Score: 1

      Classic falacy of false dichotomy

      --
      Also FatPhil on SoylentNews, id 863
    51. Re:I don't understand... by Viol8 · · Score: 1

      "but the same could be said of translating ANY binary format "

      Ever heard of mapping a raw byte array onto a structure? No? Didn't think so. Welcome to the world of programming for grown ups.

    52. Re:I don't understand... by IkeTo · · Score: 1

      > Try writing a schema to validate it ... ok I admit, that wasn't so hard, just some
      > Javascript right? But now you have to write a new batch of code to validate the next
      > type of JSON you use.

      If you constantly need to validate JSON (which I doubt I need it), and then start validating each with "a new batch of code" rather than a generic library with configurations that you can quickly adapt to your new type of JSON, I doubt your programming competence.

      Of course, same goes with transformation. And of course, XSLT is one of the worst language that I have ever seen. Try look at any nontrivial XSLT that you have written a couple of months ago. If you can still understand what it does, count yourselves atypical.

      XML have their strengths, but I doubt that it is because of validation or transformation.

    53. Re:I don't understand... by ErroneousBee · · Score: 1

      I don't get it. ... yet I cannot see why XML is so popular. For the majority of applications that use it, it's overboard.

      For most journeys, a car is overboard. But they dominate the transport infrastructure because:

      • Everybody knows how to drive one.
      • Its capable of carrying everyday loads such as shopping and the kids.
      • Vehicles that carry larger loads (HGV = binary format) require specialist loading and maintenence.
      • Light vehicles (JSON = moped) cant carry as diverse a load.
      --
      **TODO** Steal someone elses sig.
    54. Re:I don't understand... by poot_rootbeer · · Score: 1

      Now it's true that for most simple two-party exchanges, a simpler format (like comma separated values or YAML or something) would require less characters, and would thus save disk space, transmit faster, etc.

      True, but mitigated by at least two factors:

      1. It is trivial to design and work with an XML schema that provides equivalent features to simple/dumb interchange formats like CSV and YAML.

      2. Compression is HIGHLY effective on XML documents (all that <element> and </element> stuff tokenizes very well). A well-compressed XML doc should not be much larger or harder to work with than the raw data contained within it.

    55. Re:I don't understand... by GodfatherofSoul · · Score: 1

      Leave it to Slashdot comments for know-nothings to show their ignorance. I never said anything about supplanting every network protocol with XML-based standards. BTW, I have XML code running in OFX servers on Fortune 100 companies. In fact, if you've ever used a personal financial manager to download account information, there's a good chance you've used my code. Dumbass.

      --
      I swear to God...I swear to God! That is NOT how you treat your human!
    56. Re:I don't understand... by Tetsujin · · Score: 1

      You missed a big one:


      5. It has an X in the name.


      Every cool technology has an X in the name (UNIX, ActiveX, DirectX), and the existence of the X allows people to overlook the fact that they are just plain bad ideas.

      Don't forget "XBox"!
      --
      Bow-ties are cool.
    57. Re:I don't understand... by Tetsujin · · Score: 1

      2. Compression is HIGHLY effective on XML documents (all that <element> and </element> stuff tokenizes very well). A well-compressed XML doc should not be much larger or harder to work with than the raw data contained within it. That always seemed ass-backwards to me.

      "Sure, the data format I use for this application contains large amounts of unnecessary, redundant, excessively verbose tagging, and sure the data itself is needlessly encoded into a representation that only uses about 6 bits out of any 8, tops, but on the bright side, it compresses real well"

      Well, of course it compresses real well... You've just encoded everything with a lot of redundancy and used a fraction of your "bandwidth"... But if you had encoded your data efficiently in the first place, you wouldn't have to compress it...

      And all this for, what, so your document is easy to read in Notepad? All these parsing libraries have been written for XML (and that's a great asset!), but if the same had been done for an efficient meta-format, then the addition of one application - a data editor - would make a binary format just as easy to work with...
      --
      Bow-ties are cool.
    58. Re:I don't understand... by kwerle · · Score: 1

      Either sqlit

      SQLite is a better option every year. But there are some data types that just don't map well to SQL (trees are not a natural fit, IMHO). What's more, you can't just look at an SQLite file and see the data. I also think it is easier to version XML files than SQL files.

      custom binary

      And then you lose the data validation, transparency, use extensibility, etc.

    59. Re:I don't understand... by Viol8 · · Score: 1

      "never said anything about supplanting every network protocol with XML-based standards."

      You implied using it as a data format to pass down a wire. Who cares what the protocol is? Its still bloated and zipping it just slows everything down and at both ends not to mention adding complexity to both ends of the system.

      "have XML code running in OFX servers on Fortune 100 companies. In fact, if you've ever used a personal financial manager to download account information, there's a good chance you've used my code."

      You mean you wrote some itty bitty little component? We've all done that pal.

    60. Re:I don't understand... by maxwell+demon · · Score: 1

      You don't want to tell me that sending gzipped XML is more reliable than anything else, do you? Compressed data is the absolutely worst you can send over an unreliable link. You don't have any advantage if what you compressed is XML. And of course, as someone else already noted, if you need redundancy for reliability, error correction codes are almost certainly the better choice anyway.

      Don't get me wrong, XML is great for what it was originally meant for, which is markup (hey, it's even in its name: eXtensible Markup Language!) It's only the misuse as general data structure language which makes it bad.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    61. Re:I don't understand... by Anonymous Coward · · Score: 0

      Further test question.

      Someone drops a 100 MB of data from a 30 year old military application on your desk. The software that used to parse this data is not compatible with any modern OS or hardware. It's in a proprietary binary format, or it's in XML. Which is quicker for you to write a new parser for?

      People here seem to be short-sighted, but XML is likely to be parseable for the next 100 years, and your binary format probably will not be. ASCII text files that are 40 years old are still useful, but they can't be as rich or as rigorous as XML. This is a major advantage of XML.

    62. Re:I don't understand... by FooBarWidget · · Score: 1

      And I suppose your definition of "worthless" is "anything not supported by Microsoft/IBM/Sun/(insert big name company here)"?

      I'd rather define "worthless" as "something nobody whatsoever can ever use for any reason whatsoever". But YAML is already used as the Ruby on Rails database configuration file. I use it myself for configuration files for my own apps. It works, it does its job. So by definition, YAML cannot be worthless.

      Saying YAML is worthless is like saying .ini files are worthless.

    63. Re:I don't understand... by ttfkam · · Score: 1

      Because most of us have better things to do than write yet another data parser. I've written plenty. I'm over it. Now I want to work on other things.

      As for the XML my CAD software uses, I'd convert it to other formats using XSLT or STX, I'd extract values from it using XPath or XQuery, and I'd validate it for correctness using DTDs, XML Schema, or RelaxNG.

      And I would never have to write a parser or big logic block just for some input. All that time saved can be spent on things like -- oh, I don't know -- my actual program and the problem I'm actually trying to solve.

      But you go on ahead writing your parsers. Be sure to put your five hundred parsers on display in some museum. I'm sure other folks will find them fascinating.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    64. Re:I don't understand... by jgrahn · · Score: 1

      I don't get it. We can argue the merits of data exchange formats 'till we're blue in the face; yet I cannot see why XML is so popular. For the majority of applications that use it, it's overboard. Yes, it's easier on the eye, but

      Easier on the eye than *what*? Virtually all languages I have encountered are easier to read and edit than XML-based languages. Most are so simple they can be parsed with sed or awk.

      The thing that puzzles me, is why it's used so much on the web.

      My cynical conclusion (so far, and as an onlooker) is that we have a whole industry more interested in architecture and Holy Grails than in getting work done, and that someone is, surprisingly, willing to pay for it.

    65. Re:I don't understand... by msouth · · Score: 1


      <friend>sally</friend>
      </bob>

      Is that bob with an array of friends? Is that bob, an associative array, with a key "friend" whose value is "sally"?

      Over and over and over again I've hit this in systems using XML. I hate that. JSON you can look at and you know how the program will be using it. XML you can't. Just a couple months ago I was working with a system and there was code all over the place checking to see if the parser had given back a single value, and if so, coercing it into an array.

      Now, that's not the right solution, you should have a schema and then you would know...now you need a schema, the parser needs to interact with the schema to get it right, etc. So, my answer is

      (3) JSON

      --
      Liberty uber alles.
    66. Re:I don't understand... by martin-boundary · · Score: 1

      That's why there are so many bugs in some types of software. More thinking, less waiting for others to point out mistakes, is much better in the long run.

    67. Re:I don't understand... by Anonymous Coward · · Score: 0

      Binary formats don't use variable-size data unless they have to, and they certainly don't make you skip whitespace and balanced comment markup searching for the next delimiter. XML did almost everything wrong--the only way it could possibly have been more stupidly expensive is if comments were allowed within tags or element names could use varying Unicode decompositions. All to cater to programmers' perverse desire to work with the data without any tools.

      And the need for compression just makes the problem worse. It's even more expensive than decompression. That's when all the decisions happen, and when the engine has to re-learn from scratch what patterns recur in your bloated source data. When you get beyond toy apps and try to do a billion messages per day, you can't just say "we can't be bothered to choose a reasonable encoding, so we're going to need to buy another $500K worth of extra hardware so we can call zlib a couple billion times".

    68. Re:I don't understand... by kwerle · · Score: 1

      DTD and/or smarter libraries (and/or languages).

      Someone said in the thread that DOM sucks. And they're right. If I were parsing that, it'd be something like
      friends = bob_element.XPath('friend')
      I'd get an array every time, because that's what I asked for.

    69. Re:I don't understand... by batkiwi · · Score: 1

      Without checking the contents of those bytes for sanity?

      Welcome to programming for professionals.

  4. Why is XML so popular by Hal_Porter · · Score: 2, Insightful

    It seems to me to be a slight improvement on ini files, csv and the like. But parsing it is hideously inefficient compared to a binary format. It's bloated too, so it takes more time to send it over the net or save it to disk. I've seen some XML schema that are aggressively hard to read too. And yet it's become something that every new technology, protocol or applications needs to namecheck.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    1. Re:Why is XML so popular by Alaria+Phrozen · · Score: 2, Informative

      XML is not necessarily for human eyes. With the strict rules on non-overlapping closing of tags, its parsing and expansion is very easily stored and visualized as a tree. So parsing in general is actually quite easy. Also when you consider people like this http://www.acmqueue.org/modules.php?name=Content&pa=showpage&pid=247&page=4 (ACM! So take it seriously!) who want to convert all Turing complete programming languages into XML abstractions, and call it the future, well... I'm honestly not sure why as you're right, we could have certainly done all this before. It's just sort of a generalization that everybody can agree on. Then again, maybe it's a response to, "Hey! _Anything_ is better than LISP!"

    2. Re:Why is XML so popular by InlawBiker · · Score: 2, Insightful

      Because everyone said "XML is the future." And because it has an "X" it was perceived as shiny and cool. So therefore all managers and inexperienced developers jumped all over it. Now I have to encapsulate a few bytes into a huge XML message and reverse it on incoming messages, when I could have just said "name=value" and been done with it. I can see a use for XML in some applications, but it's been dreadfully overused.

    3. Re:Why is XML so popular by Anonymous Coward · · Score: 0

      I refuse to take the linked article seriously. I doubt it is peer-reviewed for a start. Secondly, the article doesn't make sense (maybe it's written in "Inglish" XML).

    4. Re:Why is XML so popular by cp.tar · · Score: 3, Funny

      Then again, maybe it's a response to, "Hey! _Anything_ is better than LISP!"

      Funny, that. I've heard LISPers say "XML looks quite like LISP, only uglier."

      --
      Ignore this signature. By order.
    5. Re:Why is XML so popular by Hal_Porter · · Score: 3, Informative

      its parsing and expansion is very easily stored and visualized as a tree

      Why not store it as a tree in a format computers can parse efficiently? Invent binary format with parent and child offsets and binary tags for the names and values. It's smaller in memory and faster. Better basically. You don't need to parse them if machines are going to read them. And decent human programmers can read them with a debugger or from a hexdump in a file, or write a tool to dump them as a human friendly ASCII during development.

      So parsing in general is actually quite easy.

      You end up doing a bunch of string operations. Those aren't quick. Most likely you drag in some library written by a Computer Science damaged 'engineer' who doesn't understand assembler or how to read a hexdump and so it will be a lot less efficient than that.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    6. Re:Why is XML so popular by DaleGlass · · Score: 1

      Here you go: http://en.wikipedia.org/wiki/Efficient_XML_Interchange

      I like this way much more than coming up with something new because it means I'd be able to keep my XML generating shell scripts, and just filter the output through a text to binary converter.

    7. Re:Why is XML so popular by schweini · · Score: 1

      real LISPers seem to think ANYTHING looks like LISP, only uglier.....

    8. Re:Why is XML so popular by Anonymous Coward · · Score: 0

      Mod parent up!

    9. Re:Why is XML so popular by Bitsy+Boffin · · Score: 1

      1. Generate XML
      2. Parse XML
      3. Encode Binary from Parsed XML
      4. Transmit Binary
      5. Decode Binary
      6. Generate XML from Decoded Binary
      7. Parse XMl
      8. Actually do something useful.

      Yay for efficiency.

      --
      NZ Electronics Enthusiasts: Check out my Trade Me Listings
    10. Re:Why is XML so popular by Josef+Meixner · · Score: 1

      Invent binary format with parent and child offsets and binary tags for the names and values.

      Are the offsets going to be 32bit or 64bit? LSB or MSB? And how do you tell the value 16 from the tag 16? Do we pad datastructures? Will strings be zero terminated or have a prefixed length?

      And decent human programmers can read them with a debugger or from a hexdump in a file, or write a tool to dump them as a human friendly ASCII during development.

      I would like a demonstration of that with the example of Microsoft Word 2003 format, the binary variant, please.

    11. Re:Why is XML so popular by ashar · · Score: 0

      No. It's

      1. Generate Binary
      2. Transmit Binary
      3. Parse Binary

      EXI is not just an XML compressor (though you can use it like that), it's API-compatible with XML so you're supposed to replace your XML processor with an EXI processor, not add extra steps.

    12. Re:Why is XML so popular by Hal_Porter · · Score: 1

      Are the offsets going to be 32bit or 64bit? LSB or MSB? Do we pad data-structures? Will strings be zero terminated or have a prefixed length? And how do you tell the value 16 from the tag 16?

      Read this document.

      http://www.itu.int/ITU-T/studygroups/com17/languages/X.691-0207.pdf

      It's not the only solution to the problems you thought of in a few minutes. But actually if you'd spent a few more minutes you would know there are many possible solutions to them. The people who invented ASN.1 have actually spent rather more than a few minutes thinking about this stuff of course, and it might be a good idea to read what they have written before you claim those problems are insoluble.

      I would like a demonstration of that with the example of Microsoft Word 2003 format, the binary variant, please.

      Hmm, so if I can't read Finnish it proves that written languages are impossible? Email the Journal of Linguistics and them your important discovery!

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    13. Re:Why is XML so popular by Josef+Meixner · · Score: 1

      The people who invented ASN.1 have actually spent rather more than a few minutes thinking about this stuff of course, and it might be a good idea to read what they have written before you claim those problems are insoluble.

      Bleh, I have implemented big parts of an ASN.1 parser 10 years ago. If you suggest that instead of XML then I am sorry I bothered to reply. I actually have created binary file formats (that were written and read by a MSB and a LSB machine) before and I became very, very careful and think long about it before I do it again.

      Hmm, so if I can't read Finnish it proves that written languages are impossible? Email the Journal of Linguistics and them your important discovery!

      Sorry? I thought it was you who wrote the following:

      And decent human programmers can read them with a debugger or from a hexdump in a file, or write a tool to dump them as a human friendly ASCII during development.

      So you mean only the original implementor can do that? So what if a project gets passed on to the next developer or there are a lot of programmers each one responsible for a small part? I can easily search for an XML-tag in the code, how do you search for 0x16? Is it 0x16 in the code, is it 22, or perhaps 026? Or could it be that (1 << 4 | 6)? I know how code is usually documented and how "easy" it is to follow a program which has grown organically over some years. Binary file formats suck as long as they aren't thoroughly documented as it is nearly impossible to search for anything in the code as you never know how the value you see in the file (or where your application crashes when reading it) was created. Also debugging binary formats is time consuming as you need additional tools to decode the format to readable format. And that even assumes the conversion tools is up to date all the time and bug free.

    14. Re:Why is XML so popular by Hal_Porter · · Score: 1

      So you mean only the original implementor can do that

      Well I could do it if I had the source code. From your comments I can't see you probably couldn't. But then I did say a 'decent' programmer ;-) And non decent programmers will probably screw up ascii file formats too.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  5. I've never heard that before... by Junta · · Score: 0

    Nope... never ever have heard that one before....

    --
    XML is like violence. If it doesn't solve the problem, use more.
    1. Re:I've never heard that before... by Anonymous Coward · · Score: 0

      It needs to be repeated, you creationist Java-programming terror-apologist Nazi-sympathizer.

  6. I believe that this was what you were looking for. by khasim · · Score: 1

    Rule #6 - If violence wasn't your last resort, you failed to resort to enough of it.

    http://www.schlockmercenary.com/d/20050313.html

  7. Much Ado About Nothing... by milsoRgen · · Score: 3, Interesting
    FTA:

    Netscape's dream of replacing the operating system with a browser is also coming true this year.
    They've been saying that for years, and frankly it won't happen. A vast amount of users relish the control that having software stored and run locally provides. Of course there will always be exceptions as web based e-mail has shown us.

    As far as the future of XML... I can't seem to find anything in this article that states anything more than the obvious, it's on the same path it's been on for quite some time.

    FTA:

    Success or failure, XML was intended for publishing: books, manuals, and--most important--Web pages.
    Is that news to anyone? My understanding of XML is that it's intended use is to provide information, about the information.
    --
    I'm sick of following my dreams. I'm just going to ask where they're goin' and hook up with 'em later.
    1. Re:Much Ado About Nothing... by Anonymous Coward · · Score: 0

      A vast amount of users relish the control that having software stored and run locally provides. Web App's can be installed and ran locally. Google also have some deals where you can get a box that runs their software all ready to go.

      Neither are ideal solutions, however they address your single argument against all app's moving to browser delivery
    2. Re:Much Ado About Nothing... by Anonymous Coward · · Score: 0
      Keep the Web in the browser, please.
      http://pinderkent.blogsavy.com/archives/81

      I was reading today about Pyro Desktop. As the Pyro homepage states: Pyro is a new kind of desktop environment for Linux built on Mozilla Firefox. Its goal is to enable true integration between the Web and modern desktop computing. By merging the Web with the desktop, Pyro offers the first big step toward a new future for the Web and the applications built for it.

      This sort of desktop integration makes me feel uneasy. The first problem I see with it is that it's unnecessary. Current web browsers work just fine as they are, for the most part. Some of them could be slimmed down somewhat, but ones like Opera and Konqueror function quite well. Konqueror, for instance, integrates well into the entire KDE desktop environment without being obtrusive.

      The second problem I see is that it promotes bad habits. In fact, this second problem may be the most significant problems. Directly under the "Imagine..." line of the page, we see the following: Single programming environment for the whole desktop. Now that makes me feel very uneasy.

      Time and time again the browser has been shown to be an inadequate application development platform. That hasn't stopped various people, groups and companies from putting together rather complex Web-based software products. However, one common trend we find with such applications is that they pale in comparison to native desktop applications written in a language such as C++. Developing a reliable, quality Web-based application is often more time consuming than developing a similar application using C++, Visual Basic, or Java.

      I haven't been very impressed with most of the Web-based applications I've used so far. The native equivalents have essentially always been far more reliable, performant, and enjoyable to use. So the last thing I'd like to see is more Web-based apps, and fewer native apps. I'd much rather see it go the other way, with more apps written using languages like Python and Ruby, and making use of native GUI toolkits like GTK+ and Qt.

      I don't see myself using this sort of software. It seems more like a step backwards than a step forwards. The Web is best suited to a browser. The desktop should remain a place for native applications.

  8. The thing with XML by KevMar · · Score: 2, Interesting

    The think with XML is that it so easily supports whatever design the developer can think of. Even the realy bad ones. Now that it is such a buzz word, the problem gets worse.

    I had someone call me up to design them a simple web app. But he wanted it coded in XML because he thought that was the technology he wanted. His Access database was not web frendly enough.

    I did correct him a little to put him in check and atleast gave him the right buzz words to use to the next guy.

    I think XML is dead simple to use if used correctly. I do like it much better that ini files. That is about all I use it for now. Easy to use config files that others have to use.

    --
    Im a gamer, not a grammer major. This post is full of spelling and grammer mistakes.
    1. Re:The thing with XML by Anonymous Coward · · Score: 0

      I'm freelance software engineer and have been making money from xml, xml schema, xpath, xsl, xwhatever, wsdl, soap for years. But for some reason, I feel cynical, almost a swindler sometimes (but if this is what they want...)
      Is it just me ? Are there xml engineers that actually believes in those technologies with regard to their costs. Are there xml fans ?

  9. WARNING: GNAA by Anonymous Coward · · Score: 3, Informative

    Don't click the "NIMP project" link. GNAA. Bad news. You know the rest.

  10. Too many 'this stuff sucks' moments by Bryan+Ischo · · Score: 5, Interesting

    I have had far too many 'this stuff sucks' moments with XML to ever consider using it in any capacity where it is not forced upon me (which unfortunately, it is, with great frequency).

    I first heard about XML years ago when it was new, and just the concept sucked to me. A markup language based on the ugly and unwieldy syntax of SGML (from which HTML derives)? We don't need more SGML-alikes, we need fewer, was my thought. This stuff sucks.

    Then a while later I actually had to use XML. I read up on its design and features and thought, OK well at least the cool bit is that it has DTDs to describe the specifics of a domain of XML. But then I found out that DTDs are incomplete to the extreme, unable to properly specify large parts of what one should be able to specify with it. And on top of that, DTDs don't even use XML syntax - what the hell? This stuff sucks.

    I then found that there were several competing specifications for XML-based replacements for the DTD syntax, and none were well-accepted enough to be considered the standard. So I realized that there was going to be no way to avoid fragmentation and incompatibility in XML schemas. This stuff sucks.

    I spent some time reading through supposedly 'human readable' XML documents, and writing some. Both reading and writing XML is incredibly nonsuccinct, error-prone, and time consuming. This stuff sucks.

    Finally I had to write some code to read in XML documents and operate on them. I searched around for freely available software libraries that would take care of parsing the XML documents for me. I had to read up on the 'SAX' and 'DOM' models of XML parsing. Both are ridiculously primitive and difficult to work with. This stuff sucks.

    Of course I found the most widely distributed, and probably widely used, free XML parser (using the SAX style), expat. It is not re-entrant, because XML syntax is so ridiculously and overly complex that people don't even bother to write re-entrant parsers for it. So you have to dedicate a thread to keeping the stack state for the parser, or read the whole document in one big buffer and pass it to the parser. XML is so unwieldy and stupid that even the best freely available implementations of parsers are lame. This stuff sucks.

    Then I got bitten by numerous bugs that occurred because XML has such weak syntax; you can't easily limit the size of elements in a document, for example, either in the DTD (or XML schema replacement) or expat. You just gotta accept that the parser could blow up your program if someone feeds it bad data, because the parser writers couldn't be bothered to put any kind of controls in on this, probably because they were 'thinking XML style', which basically means, not thinking much at all. This stuff sucks.

    Finally, my application had poor performance because XML is so slow and bloated to read in as a wire protocol. This stuff sucks.

    XML sucks in so many different ways, it's amazing. In fact I cannot think of a single thing that XML does well, or a single aspect of it that couldn't have been better planned from the beginning. I blame the creators of XML, who obviously didn't really have much of a clue.

    In summary - XML sucks, and I refuse to use it, and actively fight against it every opportunity I get.

    1. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 0

      You, sir, are now my hero.

    2. Re:Too many 'this stuff sucks' moments by Belial6 · · Score: 2, Insightful

      I'm not saying that XML is the end all be all, but if your application blows up because someone fed it bad data in XML, your program is broken, and no data format is going to fix it. As the developer, it is your responsibility to vet the data before trying to use it.

    3. Re:Too many 'this stuff sucks' moments by QRDeNameland · · Score: 3, Insightful

      Too bad I used up all my mod points earlier...this post deserves a +1 Insightful.

      I was just a neophyte developer when XML first surfaced in buzzword bingo, but it was the beginning of my realization of how to recognize a "Kool-aid" technology: if the people who espouse a technology can not give you a simple explanation of what it is and why it's good, they are probably "drinking the "Kool-aid".

      Unfortunately, I also have since discovered the unsettling corollary: you will have it forced down your throat anyway.

      --
      Momentarily, the need for the construction of new light will no longer exist.
    4. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 1, Funny

      So, tell us, what do you really think about XML? Does it suck? :p

    5. Re:Too many 'this stuff sucks' moments by cpeterso · · Score: 1

      But what is the alternative?

    6. Re:Too many 'this stuff sucks' moments by pla · · Score: 1

      I searched around for freely available software libraries that would take care of parsing the XML documents for me.

      Not "free", but believe it or not, .NET actually has pretty decent XML support... Except as you point out:



      Then I got bitten by numerous bugs that occurred because XML has such weak syntax

      Based on the exhibited behavior, I suspect virtually all programs that parse XML use SelectSingleNode() (or comparable). And there we have a problem, in that XML itself doesn't require node uniqueness, but most programs will break otherwise.

    7. Re:Too many 'this stuff sucks' moments by tjstork · · Score: 1

      I'm not saying that XML is the end all be all, but if your application blows up because someone fed it bad data in XML, your program is broken, and no data format is going to fix it. As the developer, it is your responsibility to vet the data before trying to use it.

      As long as you guys want to fit the bill for supporting that shoddy format, go right ahead!

      interoperability is overrated.

      --
      This is my sig.
    8. Re:Too many 'this stuff sucks' moments by jma05 · · Score: 2, Interesting

      I just am adding finishing touches for a several year long project where I was bitten by XML (My problems were with schema namespace support in libraries at the time). I had to resort to non-standard hacks.

      While I share your disdain (and I agree with everyone of your points), the question is this - What other *standard* way do we have to describe a format that has *moderate to high* level of complexity. JSON is great when I don't need to apply any constraints on the data. I would gladly choose it (along with YAML and other choices) for all my simpler needs. But we need some format that is more general purpose.

      Binary formats are efficient on the wire. I will gladly take CORBA over SOAP. But if I was to define a binary protocol for my own purposes, do you think I can? The effort required to model, inspect, migrate, provide language support and describe for others to understand is huge without the kind of tools that we have with XML today. We need some/any standard means to do this and whether you and I like it are not, XML is the only choice now. Hopefully, we will see better ways of representing information. But till then, XML, warts and all, is here to stay.

    9. Re:Too many 'this stuff sucks' moments by cjonslashdot · · Score: 1

      How refreshing to see so many people arguing intelligently that "the Emperor has no clothes". Indeed, XML is a terrible solution to almost all of the uses it is put to. It does solve the parsing problem, in that the syntax is pre-defined, but it is too bad that we don't have a better "standard syntax" or easier to use parser toolkit standard. I used to write compilers many, many years ago and the tools were designed for gurus. XML came along because it made the job of parsing easy, and XML messaging caught on because it was ascii and could be use to trick firewalls by pushing messages through HTTP which was intended for browsers. But I agree: XML actually sucks. And it is a very, very poor choice for a messaging specification syntax, for the many reasons stated by others. Incredibly, Web services and SOA are built around XML: so I conclude that their days are numbered, since the very underpinning is so defective by design. But then again, people said that about Windows.... Someone here asked what the alternative is. There are many levels to the answer to this: at one level, someone should create something better, something that makes a clean break from XML. But for those who simply want an existing tool to use for an application, I would suggest that if you are creating a persistent file, use a persistence API - don't write XML; and if you are doing messaging or remote procedure calls, use a native protocol - don't define your message interface in WSDL (because it is the WORST interface approach there is); but if you must define a document syntax of some kind, consider XML, because it is actually effective (although cumbersome) for that, and there is nothing better currently. And above all, be willing to say that the Emperor has no clothes: expose the many fragmented and overlapping XML standards for what they are: a disorganized jumbled junk heap of overly, overly, overly complex make-work. What we really need is a small number of specs designed by a small number of smart individuals, and all designed to work together with the minimum of complexity instead of the maximum. And I for one am tired of the ever increasing complexity of HTML and consequent browsers that must have a 100Mb footprint. Indeed, this stuff sucks.

    10. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 2, Insightful
      Wow...that's a lot of FUD to fit into one single post.

      To pick just a few of your actual points...

      So you have to dedicate a thread to keeping the stack state for the parser, or read the whole document in one big buffer and pass it to the parser.
      Why on earth would you use a separate thread. SAX callbacks allow you ample opportunity to maintain whatever state you need and DOM parsers cache the entire thing into a hierarchy that you can navigate to avoid having to maintain any state of your own. Granted, the uses for DOM parsers are few and far between, but SAX parsers are quite simple to write, don't require an extra thread and can be done on-the-fly to avoid having to load the entire document at any time. I'm not sure how you get "primitive and difficult to work with" since it rarely takes me more than a few minutes to write a SAX parser, and XML binding technologies (e.g. JAXB, Castor, etc) make it even easier.

      ...you can't easily limit the size of elements in a document, for example...
      That's entirely incorrect. See the following snippet:

          <element name="myelement">
              <simpleType>
                  <restriction base="token">
                      <maxLength value="20"/>
                      <minLength value="1"/>
                  </restriction>
              </simpleType>
          </element>


      Somewhat verbose, yes. But it's not particularly difficult to learn the syntax. And then a value that's not within the expected bounds will now result in a validation error.

      You just gotta accept that the parser could blow up your program if someone feeds it bad data.
      If you apply an XSD validation, and your XSD is somewhat complete, you can be pretty sure that anything that makes it past the parser will be of acceptable length or even has an acceptable value (in the case of enumerations and unique constraints). This is all pretty simple stuff and it's not difficult to do. Compare this with writing your own parser where you have to do all validation of the format yourself. How is that easier again?

      Finally, my application had poor performance because XML is so slow and bloated to read in as a wire protocol.
      When was the last time you tried it, 1995? Nowadays, compression algorithms require so little processing power that XML adds only a minimal amount of overhead when transfered over the wire.

      In summary - XML sucks, and I refuse to use it, and actively fight against it every opportunity I get.
      Quite frankly, your position makes about as much sense to me as the people who advocate using XML for everything (XSL-T creators, I'm looking in your direction). XML is a tool, and a useful one at that. In some situations it's very helpful and in others it's not. It's not hard to tell the difference. If you need hierarchically-structured data that's easy to parse, XML is great. It's simple to write parsers and the available toolset handles a lot of what you'd otherwise have to do manually.

      I'm actually curious what an XML-luddite like yourself would advocate instead. Give me an example of another technology that allows me to represent hierarchical data, have a standardized validation format so I can allow others to create data in a format I specify and uses an existing parser that takes me almost no time to integrate with. What would you recommend I use when presented with this all-to-common scenario?
    11. Re:Too many 'this stuff sucks' moments by Bryan+Ischo · · Score: 1

      I agree with you 100%. And so the only way to parse XML in a nonbroken way is to write your own XML parser, adding "nonstandard" constraints that prevent your program from blowing up. So you don't get to re-use existing parsing technologies like expat, you have to write everything yourself. This is a direct consequence of the suckfulness of XML, which is so lame that nobody even bothers to write good free parsers for it.

      An example of nonstandard constraints you have to put on your parser - DTD doesn't allow you to specify the maximum length that the text of an element can have. So someone could pass you an XML document with a fragment like this:

      {100 megabytes of the letter 'a'}

      expat does have facilities that let you reject this document - you can put your own checks in place to say 'if I have read more than 100K bytes of data in the address field, stop parsing and issue an error'. But you have to wait for expat to give you 100K of data before you can finally detect that the field is too long and you have to reject the document. This is wasteful. It would be much better if you could tell expat ahead of time, 'the address field has a limit of 100K' and it would do this for you. It would better still if XML format allowed expat to detect that the field was too long before even reading it. But XML doesn't support this.

      What about the maximum length of element names? I think expat may have an inbuilt limit; if not, it will choke and kill your program when it encounters something like this:

      hello

      It will try to read 100 MB to get the element name. Bogus. Like I said, expat may have some inbuilt protection from this, but it's technically correct XML since XML doesn't limit element names at all, and expat is technically broken because it rejects valid XML. It's only because XML is so lame does a reasonable limitation to avoid your program blowing up result in a nonconforming parser.

    12. Re:Too many 'this stuff sucks' moments by ad0gg · · Score: 1
      I spent some time reading through supposedly 'human readable' XML documents, and writing some. Both reading and writing XML is incredibly nonsuccinct, error-prone, and time consuming. This stuff sucks.

      There's so many more readable formats like json. Or just using byte offsets. Hell we could being using pipe delimited data.

      --

      Have you ever been to a turkish prison?

    13. Re:Too many 'this stuff sucks' moments by Bryan+Ischo · · Score: 1

      Actually I have been working on this problem off and on for a couple of years. I wrote a description of a binary format which could encode any hierarchical data structure, and had all of the features of XML (that I know of) while being fast and safe for computers to parse and emit. I also had a re-entrant parser that could read a document byte by byte if necessary and properly managed its state (allowing the programmer to drive the parser using for example a select loop with sockets). It worked really well.

      But then I decided that I could break the problem up into a couple of subproblems that were more elegant to solve individually than together as part of a larger system. I'm still working on that, but maybe I'll have it done soon.

      I framed my initial implementation as a way to convert C++ objects to binary form and serialize/deserialize them, without any programmer intervention other than running a build-time tool to generate some extra C++ syntax to be compiled with one's program and thus enable the program to serialize and deserialize any C++ object that it defined, fast, safe, and easy. I have split that up now into two parts: one to generate full-featured reflection information for C++ data types, and the second to take that information and drive a serialization/deserialization engine using it. I completed the first part, but ran out of steam on the second part. I think I'll be getting back to that soon and maybe in a couple of months I'll have it done.

      The first part, if you are curious, is at:

      http://www.ischo.com/xrtti

    14. Re:Too many 'this stuff sucks' moments by Bryan+Ischo · · Score: 1

      It's been a couple of years (like, 2 or 3) since I wrote the code to which I am referring, or had the experiences to which I am alluding. So my memory of details is fuzzy, and I may have missed the mark on some of it because I may be misremembering. However, I do very clearly recall that, when I was in the thick of my XML efforts, and had a clear idea of what the problems were, that I had many 'this stuff sucks' moments like the ones I described. Maybe the details are a little off, but the point remains, that I ran into problem after problem that seemed to me to be inherent in XML, or to be so cumbersome as to cause me no surprise that there was no really good freely available parser for XML at that time (and maybe still isn't, I don't know).

      As far as the separate thread thing, I guess I am definitely misremembering. You are right, you just 'feed' data into the SAX parser (in my case, expat) and it makes some number of callbacks to you as it parses that bit. I just checked a little bit of code I wrote a while ago and this is just what it does when it uses the expat parser, reads chunks out of a file and passes it to expat, and handles the callbacks as expat makes them. So I am wrong in my previous assertion, for sure. I think I might be confusing this with some DOM implementation I had seen where you *did* have to feed the document all at once.

      Your example for how to limit the size of elements in a document is not using DTD, which at the time that I was working with XML, was the standard way to describe a specific XML syntax. I guess you're using XSD since you mention that later on? Is XSD a standard now, superceding DSD? If not, then what you are really saying is that *XSD-aware-parsers* let you limit the number of bytes in an element, not that the XML format itself does. Which may seem like a minor difference, but it is a difference that makes my point: XML is so lame that basic functionality like limiting field sizes had to be done in an update to the spec (XSD) or, if XSD isn't really part of the XML standard, in a non-standardized extension.

      Also, how does the XSD-compatible parser know that a field it is parsing exceeds the length restriction you defined? If the limit is N, doesn't it have to read in N bytes (and parse it), and detect that there are still more bytes coming, before it can reject that document? It's a minor point, but it is inefficient.

      Also your "somewhat verbose, yes" comment is just too funny. I don't think it's possible to write any XML at all without having that be true ...

      You asked when the last time I tried XML was, and saw poor performance? Like I said, a couple of years ago. It was not unacceptably slow performance, but it was clearly worse than necessary and also used more memory than necessary (this part being significantly more important on the memory limited platform I was working). Also, I have used the yum tool on Linux and as I understand it, part of the reason that it's insanely slow is that it stores too much in XML and the parsing thereof takes a long time when it starts up. That's just anecdotal evidence though and probably simplifies the reason for yum's slowness.

      In terms of what I would recommend ... I would recommend re-evaluating whether or not XML really gives you any of the things that you say that you want. I can tell you with fair certainty that it does not give you the 'takes almost no time to integrate with' part. Technologies that allow representation of hierarchical data are a dime a dozen. And standardized validation formats are only really necessary with overly complex beasts like XML.

    15. Re:Too many 'this stuff sucks' moments by Bryan+Ischo · · Score: 1

      Whoops, I forgot to properly escape my example text.  The first example was supposed to be:

      <foo>{100 megabytes of the letter 'a'}</foo>

      And the second was supposed to be:

      <{100 MB of 'a'}>hello</foo>

    16. Re:Too many 'this stuff sucks' moments by frank_adrian314159 · · Score: 1
      But what is the alternative?

      Use Lisp and s-expressions.

      --
      That is all.
    17. Re:Too many 'this stuff sucks' moments by j.+andrew+rogers · · Score: 2, Interesting

      Finally, my application had poor performance because XML is so slow and bloated to read in as a wire protocol.
      When was the last time you tried it, 1995? Nowadays, compression algorithms require so little processing power that XML adds only a minimal amount of overhead when transfered over the wire.

      Actually, you are demonstrating some cluelessness here. Size bloat is only a small part of why XML massively sucks as a wire protocol compared to functionally equivalent universal representations such as ASN.1 which were designed to be extremely fast wire protocol encodings; compression does not address much of the performance suckiness. The reality is that good wire protocol representations are about an order of magnitude faster than equivalent XML formats, which matters a lot of you are moving any kind of traffic. Since ASN.1 is an ITU standard, it is usually used for networking protocols (as opposed to application protocols). There is even an ASN.1 encoding standard called XER that losslessly encodes XML as ASN.1 and back so as to improve its characteristics as a wire protocol. There are other wire protocol encodings out there, though ASN.1 is probably the most prevalent.

      If you think compressing XML makes it a good wire protocol, you are simply too ignorant or too inexperienced to be designing or implementing wire protocols. Study the design of some of the binary wire encodings and maybe you will figure out the subtleties that make them so much faster. There is a hell of a lot more to wire protocol scaling and performance than the number of bits going over the wire. Methinks you stepped a wee bit outside your area of expertise.

    18. Re:Too many 'this stuff sucks' moments by tknd · · Score: 1

      XML was created to solve a set of problems. Unfortunately, like most of tech, it also created new problems of its own.

      For example, before XML, there was no good standard for communicating data between very very different pieces of software. So if you had a database here and a fancy tool over there that might find data in your database useful, you were hopeless in getting the two linked together. With everyone jumping on the XML bandwagon, the potential to link things together is much more possible as long as everyone talks XML. You could effectively just go straight to reading or writing the XML rather than attempting to understand how their crazy software tool worked or their undocumented proprietary formats and APIs.

      So XML had good intentions, but the inventors were short-sighted. They didn't think of the consequences later on and the later problems that would be present. For example a common application of XML is to go from a relational database, convert the data to XML, then transform the data to something fancy or readable like HTML. But wait! If we have both a database and XML are we not storing the data twice in two different formats!? Ok, easy, get rid of the database. But wait! There is no such thing as a fast XML database!

      At some point I hope to have something better than XML. But it has brought some good to software, that being that it is actually a strict standard that everyone is actually adopting. That alone is a really good reason to jump on the bandwagon.

    19. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 0

      Yes, that was an XML schema example. And if you had not explicitly mentioned XML schema, you might have been able to plead "things have changed since my last assessment." And yes, XML schema is standardized, it's just not part of the core XML specification so you don't have to use it. It uses XML namespaces, and when the document declares that tags it uses are in a given namespace and declares an entity reference to the schema, any parser with schema validation enabled will automatically validate the document. DTD was an incomplete thought, to put it kindly. XML schema (which you mentioned specifically while clearly having zero knowledge or experience using) is much more complete. But XML documents and parsers have to be backward compatible, so you have to enable it in both the document and the parser. But that doesn't mean that it's hard for a SAX handler to require that the document enables it or that it uses the correct namespace.

      If they're a dime a dozen, then why not name one? That should be easy, right? Your whole rant comes off as "I tried it once, never really learned much about it and dismissed it out of hand after running into a couple of problems." There are plenty of valid criticisms of XML, but most are annoyances...things like XML schema syntax being overly verbose (and by verbose, I mean it could be <restriction minLength="1" maxLength="20"> instead of requiring separate tags for those elements). But it seems like there's a cult of XML bigots out there who write rants like yours that aren't based on reality. Like the guy who suggested using ASN.1 instead of XML. ASN.1 has it's uses, no doubt, but you can't seriously suggest that ASN.1 is a suitable replacement for XML in all cases. Anyone who's looked at ASN.1 syntax knows that, while it has it's uses, XML is preferable in many cases. And bigoted responses (i.e. ones that aren't based on much actual experience) aren't really conducive to a constructive conversation on the topic. Why take the time to write out a long comment if your opinions were only tenuously grounded in fact 3-4 years ago and today are even less so?

    20. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 0

      This comment makes some good points, but is at least 3 years outdated. Neither DTD nor expat are good examples of what is more widely used today. And sorry, but probably your use cases are pretty important to you, but are not to me, or to the thousands happily using XML everywhere. Is not the most usual case having to receive documents as badly created.

    21. Re:Too many 'this stuff sucks' moments by jma05 · · Score: 1

      I am not sure I understand. How is this different from any of the ones listed here(http://en.wikipedia.org/wiki/Serialization). What makes your library any more of an XML alternative than them?

    22. Re:Too many 'this stuff sucks' moments by ttfkam · · Score: 1

      S-expressions:
        * No non-ASCII character set support
        * No Unicode support
        * Does not fail fast on malformed data
        * Only really works with LISP
        * No good tool support

      Sorry, that's not a viable alternative to XML.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    23. Re:Too many 'this stuff sucks' moments by ttfkam · · Score: 1

      You remind me of those old gopher enthusiasts who referred to images as unnecessary and bloated when faced with the web and HTTP.

      If you can create a browser that handles full graphics including variable opacity, correct font metrics, and is easy to develop content for but uses substantially less memory than any of the browsers on the market, I will give you the contents of my savings account now as a show of gratitude.

      The reality is that people like looking at pretty pictures. People like looking at non-jaggy shapes and curves. And while the original KHTML renderer was only a couple hundred kilobytes, it was also capable of rendering only what a couple hundred kilobytes could muster. Then again, its memory footprint was substantially larger than a couple hundred kilobytes, but I don't blame Konqueror for that; rendering fonts well and laying out graphical user interfaces requires large amounts of memory. Luckily for us, a large amount of memory is relatively cheap.

      As for there being too many specs, no one's pointing a gun to your head to use them all. Use XML, DOM, RelaxNG, with a sprinkling of XPath and be on your way. If those don't suit all of your use cases, try adding another. Anyone that suggests that a small number of specs can handle all eventualities in a complex world is either a liar or being foolish. Which are you?

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    24. Re:Too many 'this stuff sucks' moments by ttfkam · · Score: 1

      And conversion to ASN.1 dictionaries and data transport is far easier and more reliable when used in conjunction with xml schema languages so as to enumerate the element/attributes prior to dealing with instance documents.

      Of course the fact that convertors from XML to ASN.1 and back again exist aids the previous post far more than your own. The point to the previous post was that parsers and libraries already exist and in such variety that custom parsers and wire protocols are largely unnecessary except in corner cases.

      It may in fact be the case that you live in those corner cases, but that doesn't address the other 98% of developers who do not.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    25. Re:Too many 'this stuff sucks' moments by ttfkam · · Score: 1

      Unless some of your data requires a different character encoding. Then your JSON, byte offset, or pipe delimited solution falls down. Then of course there's the character escaping situation. With JSON, every quote character must be escaped. With byte offsets, you are wasting space and are limited to a maximum length for each entry (the amount of the byte offset). With pipe-delimited data, escaping embedded pipe characters is a pain in the ass -- sure you can just put those fields in quotes, but then you also have quote escaping to deal with.

      And then finally there's the issue of security. With XML, you're reading in data. Period. With JSON, you are eval()-ing code. In most cases, this is just a passed data structure or two. Who's to stop the XSS attack with malicious JSON payloads? Likely? No, but with the XML solution, it's less than likely.

      As for the difficulty in reading XML, do you have the same difficulty in reading HTML too? Or is that there is well-written XML and poorly-written XML just like HTML.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    26. Re:Too many 'this stuff sucks' moments by Anonymous Coward · · Score: 0

      Abstract Syntax Notation One is a schema language all by itself, with bindings to several well-engineered encodings. How could XML Schema be of any value here?

    27. Re:Too many 'this stuff sucks' moments by cjonslashdot · · Score: 1

      Your point is well taken with regard to the Gopher comparison. But politely, I think you are missing my point. Browsers are not bloated because of features. They are bloated because of the over-complexity of multitude of standards that they must support. I agree that easy-to-create business functionality is important, but browsers provide anything but that. Today, in order to create reliable front ends in a browser, it is way, way too complicated and tricky. The tools that support this must support so many different, competing technologies and standards. That is why the tools are bloated, and the browsers are bloated. Further, getting back to XML, I think that the XML standards communities have done a disservice to us all by re-inventing so many wheels. There is nothing new there: all of it has been done before. XML and browsers have simply re-invented so many things in the new context of the Internet. And in doing so, they have created a mess. That was the point of the prior poster, who I was responding to and agreeing with. I agree with you that the functionality is important and valuable. My point is that the implementation of the functionality is a mess. So no, I do not long for "gopher". I embrace new things, but in browsers I see little that is actually new - just different, and in most cases inferior. It is the Internet that enables these things to have more value than their predecessors. By themselves, they are poor excuses for client technologies, again because of the implementation and its fragmentation and over-complexity. If asked to demonstrate the over-complexity of these technology implementations, I can: I am well-versed in the XML standards (or at least was at one time, and am somewhat rusty now). One of my favorite examples is WSDL, which has a boat-load of functionality that is completely unnecessary; not to mention that the most important interface definition between applications is NOT at the message level, but is at the API level, and so WSDL's entire reason for existence is questionable. Another example is the war over many competing standards to simply render line graphics! How many of these must a browser support? And more are on the way. Another example is HTML 5 versus XHTML: what the heck is going on? Where is the W3C's leadership? Another example is the need for embedding content in the first place: why cannot the core HTML mode handled the kinds of things that the plugins do? Flash? There are HTML-based standards to do that kind of things. Having a plugin introduces all kinds of security issues and reliability issues. I am not saying don't have plugins, but we take it for granted that everyone must have them. It should be a rare exception for handling unique functionality that the browser cannot provide. Why have multiple rendering engines running? - just to waste memory? And then we have the "security model" of the browser: oh-my-god. Just look at the state of affairs that that has created: cross-site scripting and so on. To repeat the prior poster's repeated conclusion: this stuff sucks. Just to re-iterate my point one more time: it is not the need for functionality that I question, but the implementation, based largely on the very poor, overly complex, and fragmented yet still inadequate XML "standards". This stuff suck.

  11. A Buzzword's Life by kbob88 · · Score: 4, Funny

    The future of XML?

    Probably a long, healthy life in a big house on the top of buzzword hill, funded by many glowing articles in magazines like InformationWeek and CIO, and 'research papers' by Gartner. Sitting on the porch yelling, "Get off my lawn!" to upstarts like SOA, AJAX, and VOIP. Hanging out watching tube with cousin HTML and poor cousin SGML. Trying to keep JSON and YAML from breaking in and swiping his stuff. Then fading into that same retirement community that housed such oldsters as EDI, VMS, SNA, CICS, RISC, etc.

  12. We're stuck with XML for a loooong time by MasterC · · Score: 2, Interesting

    XML is easy to understand because of the prevalence of HTML knowledge. XML is easy because it's text. XML is easy because, like perl, you can store the same thing in 15 ways. XML is easy because there is only one data type: text. XML is flexible because you can nest to your heart's content.

    All these things are why people use it.

    All these things are why people abuse it.

    All these things are why we won't be able to get rid of it soon.

    TFA has nothing to say about the future of XML but the tools to use XML. XQuery and XML databases. Whoopity do. The threshold for getting posted on /. steps down yet another notch. IMHO: if you loathe/hate XML then you should think about a change in career because it's not going away any time soon...

    --
    :wq
  13. YAML by CopaceticOpus · · Score: 2, Informative

    JSON is lightweight, and yet it remains human readable and editable. XML lets you forget some of the security concerns of JSON, and has the advantage of not being tied to a specific programming language.

    If only there was a standardized format that combined these advantages, without all that XML bloat. There is! Try YAML.

    XML's big win is supposed to be its semantics: it tells you not only what data you have, but what sort of data it is. This allows you to create all sorts of dreamy scenarios about computers being able to understand each other and act super intelligently. In reality, it leads to massively bloated XML specifications and protracted fights over what's the best way to describe one's data, but not to any of the magic.

    As my all time favorite Slashdot sig said: "XML is like violence: if it doesn't solve your problem, you aren't using enough of it."

    1. Re:YAML by Anonymous Coward · · Score: 0

      YAML is just XML without the closing tags. Seriously, it sucks just as bad as XML. Reading the YAML specification sucks donkey balls just like the XML specification (maybe worse).

      XML is what people use, it's here to stay. All the other choices suck too, pick the one most people use.

    2. Re:YAML by master_p · · Score: 1

      XML's big win is supposed to be its semantics: it tells you not only what data you have, but what sort of data it is.

      Actually, it does not tell you what sort of data it is, it only tags the data with a name. If it happens that the receiver has the same concept of the transmitted data as the sender, then all is well. Otherwise, there is a big problem.

  14. Emporor's New Clothes by Anonymous Coward · · Score: 0

    XML is something that programs can use to do stuff for themselves, like writing and reading their config files, or a game or an MP3 player or, god forbid, a spreadsheet encoding its UI layout in XML so that any end user can come along and play with it.

    What XML is not, and never will be, is a standard way for different programs written by different people to pass data around for an extended amount of time. It's a nice theory, but the key ingredient that would make it work in the long run will always be missing: People would have to settle on something and then stop screwing with it. That's never going to happen. Programmers and companies are constantly reinventing data structures and programs because they either a) get bored, or b) want more money. When either a) or b) happen, you get a new programming language or a new version of an operating system or a new whatever, and it's not compatible with the stuff that came before, now matter how much imcompatibility tolerance you attempt to design into something.

    Before XML fanboys start squeaking that XML will solve all of that, I'll just say no, XML won't solve any of that, no more than Object Oriented Programming guaranteed that we'd never have to write another string class again. I've heard it all before. What each new generation will keep doing is throwing away investments and frittering away their lives relearning and reinventing ways to execute instructions on processors.

    1. Re:Emporor's New Clothes by ttfkam · · Score: 1

      What XML is not, and never will be, is a standard way for different programs written by different people to pass data around for an extended amount of time.

      Like XHTML? Like the metadata for many file formats like OGG? Or did you mean when XML is used without a validating schema?
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    2. Re:Emporor's New Clothes by Ant+P. · · Score: 1

      All the Ogg metadata I've ever seen uses name=value pairs separated by newlines. Like an INI file.

    3. Re:Emporor's New Clothes by ttfkam · · Score: 1

      That's one way of doing it. Another is with XML as specified by Xiph.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
  15. Based on the fact that it's text... by Aphrika · · Score: 1

    Doesn't that mean I can use it until um... er... text runs out?

    It's not rocket science - MS were using it in MediaPlayer long before EkksEmmEll came along... it was called "sticking your crap in angle brackets and parsing it" - HTML is a subset of SGML and I'm pretty sure that it (in its XHTML form) will be around for a while yet.

    How does that die out? Just because you give it a name and rant about standards in some poxy white paper/media blag doesn't mean it's going to die and go away...

  16. XML doesn't suck! by Anonymous Coward · · Score: 0
    The problem with XML is it was promoted as the answer to everything when the reality is that it fills a niche for marking up textual documents and data.

    Management hear this web2.0 thing is really cool and want to convert our database to one big nested JSON structure. The SQL dump is 30GB, can you have the new system in production by next week?


    Would you blame JSON for that or is it simply a case of selecting the right format for the job?
    1. Re:XML doesn't suck! by Bryan+Ischo · · Score: 1

      I agree with part of what you are saying; definitely there is no single technology that is applicable in all situations, as your JSON example shows.

      However, I believe that XML isn't even good for marking up textual documents and data. It would be faster, smaller, and less error prone for computers if it were an intelligently defined binary format. It would be easier for humans to read and write as a non-SGML-based format. I think the correct thing that XML should have been is a format which has both a binary and human-readable form, where each form is tailored specifically to the domain in which it is defined (binary form being fast, easy, and safe for computers to parse and emit, and human-readable form being easy for humans to read and write), and each form can be converted to the other simply and easily.

  17. XML tables by mugnyte · · Score: 1

    ok true story.

      We once had to port live data from Texas to Oregon from giant tables repeatedly, not too well built. So we looked to send XML, enforcing a DTD/schema on the sender teams. We ended up writing the encoders because we used an early and crude compression scheme:

      We took the source table and counted the number of duplicate sets per column, then returned sorted data in order of highest duplicates to lowest.
      Then, we encoded in XML using a column, then row order. Scanning downward, if rows duplicated > 2x, we merely attributed the R tag with repeats="xx"
      Additionally, if the sender detected non-duplicate columnar data, but could find repeating sets, there were more attributes for that.
      This could be expanded into sequences, dictionary schemes, etc. This was 1998 and all the world was XML. I'm glad this concept died with web services, bandwidth, etc.

      Essentially, the transfer of all this data as XML was interesting and fast(er) but didn't sacrifice the universality of being able to generate ascii-based text files from multiple (and divergent) sources. I came to see how XML could in fact be an OK choice for some communication formats.

      Overall, it was a pleasant experience - but I've had too many others where folks wanted to shove XML into serialized objects for some strange reason (with no need for communication or human-readability).

  18. XML needs to be easier to read by revealingheart · · Score: 1

    While helping maintain work on an old game's source code, the thorny problem of which data storage format to use propped up, to replace the inflexible one in use with fixed references. There's two main developers, one who wants XML for flexibility, the other a binary format for speed and size.

    XML was the main choice, but maintaining the files is trickier than it appears. It's one of the least "human readable" formats I've seen, much more so than HTML, where you know what each tag intrinsically means. This irks the second developer, who would otherwise have accepted a compromise, and there's a stalemate on the issue.

    We have skipped around the issue and instead started work on adding other features and bugfixes. The only implementation which I did notice could work was SweetXML, though the time required to set this up wouldn't be as quick.

    XML, and it's derivatives such as XAML, need to be easier to read and edit before they can become fully fledged on the web.

    1. Re:XML needs to be easier to read by Dutch+Gun · · Score: 4, Interesting

      I'll save the discussion for XML on the web for others - I'm a game programmer, so I deal with XML as file-based data sources.

      At the game studio where I work, all our newest tools are written in C#, and use XML as a data source (typically indirectly though serialized objects). Heavyweight objects (textures, models, audio) are naturally stored in a binary format, which is optimized for the task at hand. The XML-based formats are essentially our game data's source files, and tends to function in a metadata-type capacity. As a simple example, our audio scripts store a lot of parameters about how to play a sound (pitch and volume variations, choosing among multiple variants, category and volume data, etc), and this metadata simply references external binary audio files, typically stored in a standard format like Ogg Vorbis or ADPCM compressed wave files. This metadata is compiled into a binary run-time version using a proprietary format designed to allow us to easily filter versions. These binary formats are then packed into larger containers for simpler management. Since I work on an MMO, we have to think about versioning our binary data, which tends to be challenging.

      XML is a great format for us, being so widely supported, since we use both native parsing libraries as well as a lightweight custom parser for our C++ tools (or if we need to support in-game loading for the in-house version of the game). It's easy to look into a file format to see what might be going wrong using just a text editor, and with .NET's reflection capabilities, it's absolutely brainless to easily serialize any data structure. We've decided to use XAML (an XML-based object declaration format) / WPF as well. The artists love the flexibility in the tools, and can even participate in helping to design the interfaces by creating styles.

      I don't know what the argument about not knowing what every tag means, like in HTML. The entire point of XML is to be extensible, meaning that it's the client application that determines what the tags ultimately mean. And using SweetXML, btw, misses one of the great benefits of using XML, which is that's it's a standard for which you're likely never going to have to write parsing libraries. It's fine if you want to go that route, but just be aware that you may not have the choice of libraries that you would have by using standard XML.

      XML does tend to suffer from the "golden hammer" syndrome. Honestly, I'm not a huge fan of it's verbosity or general readability either, but if you take it for what it is, and use it sensibly, it's just another nifty tool you as a programmer can make good use of. After all, wouldn't you rather be working on more important parts of your project than fiddling with a text parser?

      --
      Irony: Agile development has too much intertia to be abandoned now.
    2. Re:XML needs to be easier to read by virtue3 · · Score: 1

      Amen. Although I'm only a student/intern in game development, the sincere joy of using C#/XML has far outpaced ever going back to a text file and created "Yet Another Scripting Language". Never having to write my own parser that may be buggy and ridiculously out of scope? No problem, C# has them built in, even with low weight forward only readers! C++? No problem, TinyXML (or whatever other parser you want to use). Saving myself from writing a text parser? PRICELESS. XML Serialization is entirely and completely useful instead of having to change data inside my code, which is a ridiculous practice. I'd rather just change an xml file instead of having to recompile. I use XML for most of my projects, and my artists on my team have thanked me for not using some assinine formate for getting data into the game. If they want to change ANYTHING, they just start plugging in new values in the XML docs. Simple. Easy. And requires 0 input/effort on my end. Never having to worry about EOF? Thank you!

  19. Graveyard by CaroKann · · Score: 1

    In the long run, we are all dead. XML's future is in the graveyard. Alas, that is probably too much to ask. :(

  20. The only reason why XML caught on is because it... by v(*_*)vvvv · · Score: 1

    The only reason why XML caught on is because it looks like HTML. And since all the phony IT execs who have "HTML" on their resume were able to say they understood it.

  21. Why not S-expressions? by corsec67 · · Score: 3, Interesting

    S-expressions (think the lisp format) are much nicer, more compact, and easier to use than XML, while sharing almost all of the same properties otherwise.

    For example:
    <tag1>
        <tag2>
          <tag3/>
        </tag2>
    <tag1>

    becomes:
    (tag1
        (tag2
            (tag3)
        )
    )

    --
    If I have nothing to hide, don't search me
    1. Re:Why not S-expressions? by deadzaphod · · Score: 1

      Good question. I would love to see everyone standardize on S-expressions instead. The only real advantage that I know of that XML has is namespaces, and that could be fixed with a single short RFC describing a standard structure on top of S-expressions instead.

      Now that I think about it, I think maybe I'll set up a website after work tonight to promote this idea...

    2. Re:Why not S-expressions? by jefu · · Score: 2, Informative

      Sure, you can build a different text representation for XML as sexps. But if it represents the same thing, it doesn't much matter.

      Imagine that you do so, and you can write a function P that takes xml into sexps and a function Q that takes it back. If Q(P(xml-stuff)) == xml-stuff and P(Q(sexps)) == sexps, then they both do the same thing and you can effectively use either syntax. So you use the syntax you want and convert when you need to. Of course, if either equality doesn't work, then one syntax makes it possible to express something that the other does not - and then the semantics differ. So now it becomes, not a question of using XML, but using a representation that is closer to the semantics your application needs.

      And that is one of the abiding lessons of computing - trying to mash semantics into a language/representation that doesn't fit well is a pain and generally a good way to waste time and effort.

    3. Re:Why not S-expressions? by Anonymous Coward · · Score: 0

      print 'Good %s, no!' % diety

      # Do you know how hard it would be for a human to interpret the closing tags of a 10-deep nested element?
      # No thanks, it ain't any better. I shudder to think....

    4. Re:Why not S-expressions? by grumbel · · Score: 1

      The problem with S-expressions is that there really isn't one standard for them, but many, everybody does his own thing and so you end up having tiny little differences in what data types they support. Lisp does other stuff then Scheme, Scheme does other stuff then Ron Rivest Internet-Draft and so on. I still prefer it over XML, because its simply enough that you can rather quickly create your own parser and when you limit yourself to a common subset you end up something that you can easily map into native data structures in most scripting languages, since you don't have the XML-mess with Elements vs Attributes. It also is nice to have a real types in the markup language instead of everything just being strings.

    5. Re:Why not S-expressions? by Anonymous Coward · · Score: 0
      That is nice in theory. But say you have something like this:

      <tag1><tag2>
        <tag3/>
      </tag2><tag1>
      which could become:

      (tag1(tag2
        (tag3)
      ))
      Suddenly, it's less clear what is going on. Is the XML better when formatting isn't quite so pretty? It's debatable. But probably.

      Additionally, larger documents also have problems. Sometimes in the real world you jump into a document and you grep for some string. You find it, but now you are reading the document from the bottom up. With S-expressions you could maybe use parenthesis matching if you have a good text editor to see where you are in the document and what tags your data is associated with. But in a large enough document this can be pretty slow and painful. Not to mention a good text editor is not always available.

      In short there are a lot of times when it is easier to see the end tags.

  22. Don't get blindsided by big stuff you can't see by leighklotz · · Score: 3, Informative

    XML has tremendous, huge, giant levels of adoption that dwarf its use as XHTML and in XMLHTTPRequest (AJAX) stuff.
    WHATWG's HTML 5 and JSON will have no effect on these other uses. It's just that nobody in hangouts like this sees it.

    For example, the entire international banking industry runs on XML Schemas. Here's one such standard: IFX. Look at a few links: http://www.csc.com/industries/banking/news/11490.shtml , http://www.ifxforum.org/home , http://www.ifxforum.org/home
    But there are other XML standards in use in banking.

    The petroleum industry is a heavy user of XML. Example: Well Information Transfer Standard Markup Language WITSML (http://www.knowsys.com/ and others).

    The list goes on and on, literally, in major, world-wide industry after industry. XML has become like SQL -- it was new, it still has plenty of stuff going on and smart people are working on it, but a new generation of programmers has graduated from high school, and reacts against it. But it's pure folly to think it's going to go away in favor of JSON or tag soup markup.

    So yes, suceess in Facebook applications can make a few grad students drop out of school to market their "stuff," and Google can throw spitballs at Microsoft with a free spreadsheet written in Javascript, but when you right down to it, do you really think the banking industry, the petroleum industry, and countless others are going to roll over tomorrow and start hacking JSON?

    1. Re:Don't get blindsided by big stuff you can't see by dwye · · Score: 1

      but when you right down to it, do you really think the banking industry, the petroleum industry, and countless others are going to roll over tomorrow and start hacking JSON?

      No, but we can hope.

      So far as I have seen it and used it, XML has all the problems of ASN.1 (which the telecommunication industry, especially wireless, is wedded to), and lacks its conciseness. They seem especially alike because it appears that in both, everyone insists on misusing it and reinventing the wheel (and not by putting in spokes, bearings, or a suspension, either).

      Oh, correction: I like when my MMORPG uses it, because I can figure out where each monster will spawn without having to write my own parser (yet again).

    2. Re:Don't get blindsided by big stuff you can't see by DragonWriter · · Score: 1

      but when you right down to it, do you really think the banking industry, the petroleum industry, and countless others are going to roll over tomorrow and start hacking JSON?


      No, clearly, few technologies grow to maturity in industries like that. They are fire-tested and develop in industries that can take the risk of experimentation, and then they are adopted by those industries once they are proven. So, yeah, XML is going to be around for a while, even if JSON, YAML, or something like it may displace it for many uses (including highly-sensitive ones) in the long run.

      That said, I don't see a lot of intrinsic advantages XML has over YAML (JSON's slightly bigger brother); most of its current advantages are in the domain of tool support (including auxiliary technologies that are also implemented in XML). But JSON/YAML, the longer and more widely they are used, are going to grow a lot of that support, too, and narrow the gap.
  23. Errrm, folks, what's the big fat hairy deal? by Qbertino · · Score: 5, Informative

    Ok. I've once again seen the full range of XML comments here. From 'cool super technology modern java' to 'OMFG it sucks' right over to 'XML has bad security' - I mean ... WTF? XML is a Data Format Standard. It has about as much to do with IT security as the color of your keyboard.

    And for those of you out there who haven't yet noticed: XML sucks because data structure serialisation sucks. It allways will. You can't cut open, unravel and string out an n-dimensional net of relations into a 1-dimensional string of bits and bytes without it sucking in one way or the other. It's a, if not THE classic hard problem in IT. Get over it. It's with XML that we've finally agreed upon in which way it's supposed to suck. Halle-flippin'-luja! XML is the unified successor to the late sixties way of badly delimited literals, indifference between variables and values and flatfile constructs of obscure standards nobody wants. And which are so arcane by todays standards that they are beyond useless (Check out AICC if you don't know what I mean). Crappy PLs and config schemas from the dawn of computing.

    That's all there is to XML: a universal n-to-1 serialisation standard. Nothing more and nothing less. Calm down.

    And as for the headline: Of-f*cking-course it's here to stay. What do you want to change about it (much less 'enhance'). Do you want to start color-coding your data? Talking about the future of XML is allmost like talking about the future of the wheel ("Scientist ask: Will it ever get any rounder?"). Give me a break. I'm glad we got it and I'm actually - for once - gratefull to the academic IT community doing something usefull and pushing it. It's universal, can be handled by any class and style of data processing and when things get rough it's even human readable. What more do you want?

    Now if only someone could come up with a replacement for SQL and enforce universal utf-8 everywhere we could finally leave the 1960s behind us and shed the last pieces of vintage computing we have to deal with on a daily basis. Thats what discussions like these should actually be about.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Errrm, folks, what's the big fat hairy deal? by Anonymous Coward · · Score: 0

      Sweet jesus, this comment nails this subject so completely. If anyone has mod points, here would be a good place to use them.

    2. Re:Errrm, folks, what's the big fat hairy deal? by Shados · · Score: 1

      Completly agree with you, to the security comment, all the way to the "UTF-8 everywhere and be gone with SQL" thing.

      Just out of curiosity, have you ever had to work with EDI? Because you sound like someone who probably got burnt by something like that in the past :)

    3. Re:Errrm, folks, what's the big fat hairy deal? by radimvice · · Score: 1

      Talking about the future of XML is allmost like talking about the future of the wheel ("Scientist ask: Will it ever get any rounder?").

      So XML is the pi of data, then?

    4. Re:Errrm, folks, what's the big fat hairy deal? by jadavis · · Score: 1

      [XML is] universal, can be handled by any class and style of data processing

      It handles relational algebraic manipulations then? Can you provide a reference?

      Now if only someone could come up with a replacement for SQL and enforce universal utf-8 everywhere we could finally leave the 1960s behind us and shed the last pieces of vintage computing we have to deal with on a daily basis. Thats what discussions like these should actually be about.

      My understanding is that UTF-8 does not allow representation of all available characters. In particular, there are a few Japanese characters that can't be represented. Additionally, another problem is that the localizations aren't standardized very well, particularly for data management. For instance, en_US has a different sort order on GNU versus Mac. Why these things are not fixed I do not know. Also, the sorting rules for many localizations are expensive, which makes a big difference when it comes to a sort in a database with a lot of tuples.

      I'm all for getting rid of SQL, but it needs to be replaced by a better relational language. Anything else will be a regression.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
  24. It's all about the DOM by Anonymous Coward · · Score: 1, Interesting

    The thing that puzzles me, is why it's used so much on the web. XML is bulky, and when designed badly it can be far too complex; this all adds to bandwidth and processing on the client (think AJAX), so I'm not seeing why anyone would want to use it. Formats like JSON are just as usable, and not to mention more lightweight. Where's the gain?

    If I use XML, I can embed documents in other documents of different types, and they share a DOM. I can serve an XHTML document with MathML and SVG inside it, and use one CSS file to style everything, and my Javascript file can play with all of the above.

    JSON is neat, and it's great for some things, but I haven't seen anything from the JSON people that even approaches what I can do with XML in a browser.
  25. Near-death experience with Vista -- ZDNet by Daengbo · · Score: 0, Offtopic

    http://talkback.zdnet.com/5206-10533-0.html?forumID=1&threadID=44087
    He killed his laptop and couldn't use his desktop for a couple of hours.

    1. Re:Near-death experience with Vista -- ZDNet by Daengbo · · Score: 0, Offtopic

      Oops! Wrong story.

  26. MOD PARENT UP! Re:Errrm, folks, what's the big by DIGITAiLor · · Score: 2, Insightful


    Cheers, Qbertino. This is the best explanation of XML's raison d'etre I have ever heard.

    I think what people might hate most is DTDs. That makes sense. Even their creator says they suck. There are many ways around them... Lisp can be one big full-service XML processor. Easily. With happy ending and no need for the DOM or SAX.

    The bottom line is, XML is nothing (literally) until you spec YourML. And most people don't have a need for that! So it seems useless to them. If you are writing markup languages for application spaces that don't have them it's a godsend. And it is leading to improvements and much-needed standardization.

    I've never understood why seemingly rational people whine about XML. It's like whining about mathematics. They're like that for a reason; their intrinsic structure provides their utility. It's not some arbitrary syntax decision that you can whine about. Don't like how modulo works or the concept of recursion? It's AXIOMATIC, baby. Don't like close tags? They're there for a reason.

    As for a SQL replacement... have you checked out Berkeley DB XML? Have you found anything promising that you like?

    1. Re:MOD PARENT UP! Re:Errrm, folks, what's the big by Shados · · Score: 1

      I'm not the person you replied to, but... One thing i've noticed from my personal experience: XML sucks hard without schema. XSD sucks hard to make schemas. XSD is the norm. Put everything together, and you get "XML SUCKS!"

      There are XSD alternatives, and also nice tools and editors to handle XSDs: then you're fine.

      Also, having taken a look at the mainstream C++ APIs for XML, that would make most anyone hate it. It isn't bad in Java or .NET really (I didn't do any XML in Java in a long time, but a few years back JDOM was pretty sweet...and for .NET, well, LINQ to XML is XQuery with .NET goodness, its great stuff).

      For the SQL replacement, I personally saw a few... There are object databases of course. Won't do everything an SQL database will, but if it meets your need, it will make your life a lot easier... I've also seen prototypes for (insert non-SQL specialised datawarehousing system that I can't talk about here), which went with an XQuery based engine to query object graphs like if they were XML (even though they aren't). That looks promising.

  27. As always by roman_mir · · Score: 1

    Use it if mandated, try to avoid using it for application configuration if possible, try to avoid transformations as much as possible, accept that web services / ajax do make sense in certain situations.

    Basically like any tool use where it makes most sense, avoid using it in other cases.

    1. Re:As always by prichards · · Score: 1

      Always good advice, but there may also be many situations where it can be beneficial to use XML, as there are also many cases where you may be mandated to use XML. In either case, at the core of this argument is "the future of XML". The future of XML is still secure and growing, whether or not developers love or hate the technology. As several posts point out, there are numerous XML standards for data exchange where you may be mandated to use XML (I've needed to use it often in the Insurance and Financial sectors), and web services are certainly growing as more organizations adopt SOA.

      As XML has become more popular (whether by conscious adoption or mandated use), and has become a defacto standard in many industries, plenty of tools have been developed to support its use. Of course this includes programming libraries such SAX and DOM parsers, but there are also numerous Open Source and commercial tools that help implement and manage XML implementations quickly and easily. Using some of these tools, you may start to find it easier to use XML in situations where you might not have otherwise. (Previously, I has not often used XML for configuration files, but using an XML-based data integration tool I found it natural, easier and quicker to use an XML config file than a text-based format.) Similarly, I am able to build and deploy web services in a fraction of the time it would take me to code the same service.

  28. XML is a fad, STEP is the future by chip2004 · · Score: 5, Interesting

    XML tries to make everything fit into a single hierarchy. Most real-world information is comprised of graphs of data. ISO STEP provides better readability compared to XML, a more strongly typed schema mechanism, and a more compact size. Best of all, programs can process and present results of STEP incrementally instead of requiring closing tags so you can hold gigabytes of information in the same file and seek randomly.

    Example:
    #10=ORGANIZATION('O0001','LKSoft','company');
    #11=PRODUCT_DEFINITION_CONTEXT('part definition',#12,'manufacturing');
    #12=APPLICATION_CONTEXT('mechanical design');
    #13=APPLICATION_PROTOCOL_DEFINITION('','automotive_design',2003,#12);
    #14=PRODUCT_DEFINITION('0',$,#15,#11);
    #15=PRODUCT_DEFINITION_FORMATION('1',$,#16);
    #16=PRODUCT('A0001','Test Part 1','',(#18));
    #17=PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#16));
    #18=PRODUCT_CONTEXT('',#12,'');
    #19=APPLIED_ORGANIZATION_ASSIGNMENT(#10,#20,(#16));
    #20=ORGANIZATION_ROLE('id owner');

    1. Re:XML is a fad, STEP is the future by filbranden · · Score: 1

      Strange. I don't know why, but this STEP reminds me of BASIC. :-)
      Is this supposed to be a step forward?

      Wikipedia page for ISO STEP mentions that many consider replacing it with XML, or rather creating XML schemas to represent the information STEP does (I didn't find Wikipedia's external reference for this though).

      ...programs can process and present results of STEP incrementally instead of requiring closing tags...

      It's not true that XML cannot be rendered incrementally. This Mozilla FAQ points out that versions before Firefox 3/Gecko 1.9 don't support it, which makes me believe that Firefox 3 does support it (I didn't check it myself).

      The fact that XML allows you to check it for validity when you have the whole document doesn't prevent you from processing the parts you read already. SAX based parsers work that way, by passing events whenever one element is complete, you don't have to wait for all the document to finish to process the snippet at hand. If the document isn't valid, the processing will stop at the point where the error was found.

    2. Re:XML is a fad, STEP is the future by The_reformant · · Score: 1

      Which isnt really very human editable is it? It wont take long before you get:
      #23413=SOMETHING(#23, 'somestuff' #2345, 'somemorestuff', #9987976)
      At least in XML you have a kind of proximity effect, so yes if your searching for a particular element you could at worst case have to scan the hwole file. But when you instantiate an element you dont have to jump around as much.
      Also your lines arent fixed width so seeking to #9987976 means scanning through for 9987975 newline characters.

      --
      I have discovered a truly remarkable sig which this post is too small to contain.
    3. Re:XML is a fad, STEP is the future by Just+Some+Guy · · Score: 1

      For some reason that seems familiar.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:XML is a fad, STEP is the future by g8oz · · Score: 1

      If you can't search for tutorials on Google, nobody is going to use it. STEP is too generic to be searched for.

      It seems like a simple thing but its true.

    5. Re:XML is a fad, STEP is the future by Anonymous Coward · · Score: 0

      I've used both XML and STEP on a lot of engineering projects and I see uses for both. Neither XML nor STEP influences whether your data has proximity; the schema determines that.
      For data that has proximity by nature, the hierarchy of XML is more readable. For data that is more relational in nature, the efficient cross-referencing of STEP is more readable. You have to scan the whole file in either XML or STEP, however for STEP the IDs are typically sequential and easily read on the left of each line in the file, whereas in XML IDs are buried into attributes of tags which are harder to find.
      While STEP isn't fixed width, it's easy to build an ID-to-offset map while parsing and keep such index files around so that random seeking works. Then when you add to the same file, there's no reordering; you can just append at the tail and never have to shift data around or re-index -- it works both as an exchange format and as a data storage and archiving format.

    6. Re:XML is a fad, STEP is the future by Anonymous Coward · · Score: 0

      The more user-friendly search term would be "ISO 10303-21" :)

    7. Re:XML is a fad, STEP is the future by Ant+P. · · Score: 1

      Also your lines arent fixed width so seeking to #9987976 means scanning through for 9987975 newline characters. Nope. Seeking to 9987976 is just doing a binary search and reading to the nearest newline/line number.
  29. technology will accomodate XML by recharged95 · · Score: 1
    Clients will get faster, pre-caching will be the norm, etc... Servers and the network will be faster too.

    JSON and such is a bandaid since it's all about streaming today, why? because NVP nomenclature is easier than XML and the technology is slow. Why is the technology slow?, cause we're send the same stuff all over the place--inefficient web pages rule!

    XML is to the semantic web where as JSON/YAML/etc.. is to Google. Guess what? The semantic web is finally catching on with real accurate results where as Google results are now more confusing...

  30. OFFTOPIC this guy... by Anonymous Coward · · Score: 0

    Twice.

  31. But it isn't and doesn't... by Junta · · Score: 1

    Dump the entire memory contents, and you probably store data you don't care about, being even more wasteful of resources than XML. If it was so painless, why would every modern framework explicitly deal with special calls to serialize objects? What if you dump the memory space of some object on an x86 and try to restore it on a ppc, which differs in endianness? What if you try to load it on a system with different data type sizes and the alignments mess up? What if you update your program to add a member to a struct, and suddenly you've corrupted the meaning of your binary save data from previous iterations?

    I'm not saying XML is the best answer or by simply saying 'XML' problems go away, you always have to do something and many different frameworks/facilities in various languages exist to help. You have to do something more than open a file handle and start dumping from memory addresses to that file handle. You have to either think carefully or choose a tool that let's you be fairly straightforward and preserve your options going forward.

    --
    XML is like violence. If it doesn't solve the problem, use more.
    1. Re:But it isn't and doesn't... by Hal_Porter · · Score: 1

      What if you dump the memory space of some object on an x86 and try to restore it on a ppc, which differs in endianness?

      Then you define the format to use one endianness and write a bunch of functions to read and write the data in a CPU independent way. On the most common platform they will actually use the native format.

      What's annoying about this sort of thing is that filesystem, file format and protocol designers have solved all the problems with binary interchange formats across very different systems in very efficient ways 20 years ago. And still people who have never written any low level code seem to think it's some sort of voodoo.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    2. Re:But it isn't and doesn't... by kwerle · · Score: 1

      Then you define the format to use one endianness and write a bunch of functions to read and write the data in a CPU independent way. On the most common platform they will actually use the native format.

      Sounds like XML would work. ... solved all the problems with binary interchange formats across very different systems in very efficient ways 20 years ago.

      But you want to re-invent a data storage format?

    3. Re:But it isn't and doesn't... by Hal_Porter · · Score: 1

      Sounds like XML would work

      Yeah it will. And if you have loads of spare CPU and memory capacity like on a desktop you won't notice the inefficiency. But sooner or later you're going to want to run your code on a mobile phone or a server where the overhead of parsing XML starts to become a limiting factor.

      Anal sex works on both genders too. Maybe you should use that all the time instead of having to worry about special cases.

      But you want to re-invent a data storage format?

      No I think people should use one of the binary alternatives to XML. Or just roll their own binary format.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  32. Make working with XML suck less... by scottsevertson · · Score: 4, Interesting

    "XML is really just data dressed up as a hooker."

    --Dave Thomas

    XML does suck if you stick with some of the W3C standards and common tools. Suggestions to make it less painful:

    • Ditch W3C's XML Schema

      W3C Schema is painful; it forces object-oriented design concepts onto a hierarchical data model. Consider RELAX NG (an Oasis-approved standard) instead; it's delightful in comparison. Use the verbose XML syntax when communicating with the less technical - if you've seen XML before, it's pretty easy to comprehend:

      <r:optional>
      <r:element name="w3cSchemaDescription">
      <r:choice>
      <r:value>painful</r:value>
      <r:value>ugly</r:value>
      <r:value>inflexible</r:value>
      </r:choice>
      </r:element>
      </r:optional>

      Switch to the compact syntax when you're among geeks:

      element w3cSchemaDescription { "painful" | "ugly" | "inflexible" }?

      There's validation support on major platforms, and even a tool (Trang) to convert between verbose/compact formats, and output to DTD and W3C Schemas. And, if you need to specify data types, it borrows the one technology W3C Schema got right: the Datatypes library.

    • Don't use the W3C DOM

      The W3C DOM attempts to be a universal API, which means it must conform to the lowest common denominator in the programming languages it targets. Consider the NodeList interface:

      interface NodeList {
      Node item(in unsigned long index);
      readonly attribute unsigned long length;
      };

      While similar to the native list/collection/array interfaces most languages provide, it's not an exact match. So, DOM implementers create an object that doesn't work quite like any other collection on the platform. In Java, this means writing:

      for(int i = 0; i < nodeList.length(); i++)
      {
      Node node = nodeList.item(i);
      // Do something with node here...
      }

      Instead of:

      for(Node node : nodeList)
      {
      // Do something with node here...
      }

      Dynamic languages allow an even more concise syntax. Consider this Ruby builder code to build a trivial XML document:

      x.date {
      x.year "2006"
      x.month "01"
      x.day "01"
      }

      I thought about writing the W3C DOM equivalent of the above, but I'm not feeling masochistic tonight. Sorry.

      The alternatives depend on your programming language, but plenty of choices exist for DOM-style traversal/manipulation.

    • Forget document models entirely (maybe)

      In-memory object models of large XML document can consume a lot of resources, but often, you only need part of the data. Consider using an XMLPull or StAX parser instead. Pull means you control the document traversal, only descending into (and fully parsing) sections of the XML that are of interest. SAX based parsers have equivalent capabilities, but the programming model is uncomfortable for many developers.

      Even better, some Pull processors are wicked fast, even when using them to construct a DOM. In Winter 2006, I benchmarked an XML-heavy application, and found WoodStox to be an order of magnitude faster at constructing thousands of small DOM4J documents

    --


    Scott Severtson
    Senior Architect, Digital Measures
    1. Re:Make working with XML suck less... by dkf · · Score: 1

      SOAP web services have become anything but simple; the proliferation of extensions are often abbreviated "WS-*" (AKA the WS-Death Star). Granted, many extensions do nifty things - for example, WS-Transaction adds transaction support across multiple web service calls. The base layers of WS-* (I like your name for it!) are not great, but the higher-level parts (e.g. the specs related to WS-Security and WS-Trust) are a big step forward on ReST. Or rather, if you were doing all those things in ReST, you'd have to reinvent the complexity that is in WS-* and then you'd be back where you are now. But without a hope of interoperability with anyone or anything, and probably with a whole bunch of subtle bugs. OTOH, you'll avoid WS-MetadataExchange and so won't be all that disadvantaged...

      Complex stuff is complex because it is. Formatting sleight of hand can't really do much to hide that.
      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    2. Re:Make working with XML suck less... by scottsevertson · · Score: 1

      I agree that some of the WS-* extensions are extremely useful, but only if you actually need the functionality/complexity.

      The services I write are consumed by developers at educational institutions around the world, many using nothing more than a quick-and-dirty PHP script. They appreciate the simplicity and ease of use - our read-only resources can be explored directly inside a web browser, and I point folks to the RestTest Firefox plugin if they need to experiment with our writable services.

      However, I would hardly define our web services as simple... We've just done a lot of design work to make them appear simple. Through careful definition of resources, well thought out URL schemes that are human readable/constructible, and liberal use of XLink to point out related resources, we've avoided much of need for the complexity of the WS-* world.

      With regard to WS-Security and WS-Trust - I've read and appreciated their specs before. Both appear well intentioned and well designed. However, the rest of the WS-* stack is so distasteful that it taints the gems that can be found. I'd rather take the concepts behind the specs, and implement the minimal subset my application needs. For example, see Amazon's REST authentication mechanism - simple yet effective.

      As for WS-* interop, the base specifications are so complex that a complete web service toolkit is required to even contemplate interoperability. Even worse are the slight incompatibilities between major vendors - Microsoft's generated WSDLs for .NET services don't always map well to IBM's stack, for example (at least as of 2005).

      I may have worded my initial post too strongly. Here's when I would consider WS-*

      • Internal web services consumed by other resources at a single organization
      • Homogeneous development platform across servers and clients, or enough time to work around minor interop issues
      • A demonstrated need for more than a few WS-* extensions
      --


      Scott Severtson
      Senior Architect, Digital Measures
  33. Re:Yes, but.... by Anonymous Coward · · Score: 0
    Dongs, you are such an asshole ...

  34. Why XML is so popular by TheMCP · · Score: 2, Interesting

    XML is so popular because business people don't understand it and think it can magically do a lot of things it can't, so they choose software that uses XML when it really doesn't matter.

    I have a lot of experience consulting with various organizations - some Fortune 500, some nonprofit, some educational - about their software selection process. I've watched many times as a vendor gives a presentation to my employer or client talking about how wonderous it is that their software saves all its data in XML so you'll be able to openly interchange it with everything. The business people's eyes glaze over and a happy glow suffuses their face, as they imagine that that means that any software's data that's saved in XML can be magically opened and understood by any other software that uses XML. They don't get the idea that there's a specific schema involved and that your word processor won't be able to automatically make sense of data generated by your database just because there's XML involved.

    When I talk to my client after the vendor presentation I invariably learn that they think that XML is a sort of universal translator. I've had to explain why it isn't to so many clients I finally just wrote a white paper on the subject so when it comes up again I can just print it out and hand it to them. If I don't, I find my clients will reliably choose to buy the software that uses XML instead of the software that best meets their needs.

    Believe me, the vendors knew that their prospective customers would act this way, and did everything they could to play up the idea that XML is magically interchangeable with all software, sometimes to the point of telling outright lies about it.

    1. Re:Why XML is so popular by Man+Eating+Duck · · Score: 1

      I've had to explain why it isn't to so many clients I finally just wrote a white paper on the subject so when it comes up again I can just print it out and hand it to them.
      This sounds handy, would you have any objections to publishing it on the web somewhere?
      I see this issue surprisingly often as well, even from people who should've known better. Such is the power of buzzwords.
      I sometimes make an analogy with an "XML Jerrycan"for fluids. This jerrycan is sometimes handy for transporting and storing fluids, but if you fill it with gasoline it won't convert it to diesel, drinking water, engine oil or alcohol for you no matter what. It's still gasoline, only in a can.
      --
      Are you a grammar Nazi? I'm trying to improve my English; please correct my errors! :)
    2. Re:Why XML is so popular by fatphil · · Score: 1

      When PHBs or marketeers fling around "uses XML", I parry that with "uses ASCII". Everything that they can say about something that "uses XML" is also true about data that "uses ASCII", except of course that ASCII has been used for a lot longer.

      --
      Also FatPhil on SoylentNews, id 863
    3. Re:Why XML is so popular by cerberusss · · Score: 1

      I've had to explain why it isn't to so many clients I finally just wrote a white paper on the subject so when it comes up again I can just print it out and hand it to them
      Be careful not to become a naysayer. Just say: "Indeed, a good software developer can create a translation utility in oh, only a week or two".
      --
      8 of 13 people found this answer helpful. Did you?
  35. the creators of XML made it for document markup by TheMCP · · Score: 1

    XML sucks in so many different ways, it's amazing. In fact I cannot think of a single thing that XML does well, or a single aspect of it that couldn't have been better planned from the beginning. I blame the creators of XML, who obviously didn't really have much of a clue.
    XML was never intended as a data storage format. It was intended as a document markup format. The fact that people started immediately using it for arbitrary data came as a surprise to the people who created it.
  36. Concise XML by TheMCP · · Score: 1
    In Concise XML, that's:

    <tag1
      <tag2
        <tag3/>
    />
    />
  37. JSON is S-expressions done wrong by Animats · · Score: 1

    JSON is almost exactly equivalent to LISP S-expressions. Unfortunately, JSON has major security problems due to a Javascript design error. In LISP, there's the "reader", which takes in a string, parses it, and generates a tree structure (or graph; there's a way to express cross-links), and just returns the data structure. Then lISP has "eval", which takes a data structure created by the reader and runs it.

    Javascript combines both functions into one, called "eval", which takes a string, parses it, and runs it. Giant security hole. There are attempts to patch around this, but it's ugly.

    1. Re:JSON is S-expressions done wrong by DragonWriter · · Score: 1

      JSON is almost exactly equivalent to LISP S-expressions.


      Not really, even in the relation between JSON and JavaScript and the relation between S-Expressions and Lisp. JSON is a subset of JavaScript, and S-Expressions are a superset of Lisp.

      Unfortunately, JSON has major security problems due to a Javascript design error.


      JSON doesn't rely on having JavaScript on either end. Particular applications or libraries that use JSON, either in JavaScript or otherwise, may have security errors due to design of those libraries or applications, but JSON itself does not have a security problem, and if it did, it could not be due to a JavaScript design error since JSON can be used without JavaScript ever touching it.

      In LISP, there's the "reader", which takes in a string, parses it, and generates a tree structure (or graph; there's a way to express cross-links), and just returns the data structure. Then lISP has "eval", which takes a data structure created by the reader and runs it.

      Javascript combines both functions into one, called "eval", which takes a string, parses it, and runs it. Giant security hole. There are attempts to patch around this, but it's ugly.


      And it may be true that JavaScript doesn't have an accessible (to user code) "reader" for arbitrary JavaScript as part of the core language. However, there are JSON parsers (including one on the JSON website) for JavaScript that don't rely on eval (as well as the ugly hacks that try to detect "evil" in the JSON and then call eval if they think the JSON is "safe"). Using a JSON parser rather than eval addresses the security concerns; any security problems are not the fault of either the design of JSON or the design of the JavaScript language, tehy are the fault of the design of the application.

  38. XML Creates Cost by Ironpoint · · Score: 1


    XML, its related technologies, and its rivals were designed to add cost to the business of managing data and information. In order to profit, developers interpose themselves between the product (data processing) and the customer (businesses). They do this by creating ridiculous technologies, dumb languages, over-complex components, and on and on. A perfect data language, while not existing, would not provide a profit opportunity to developers. The fact that a common function of XML editors is to display the structure without angle brackets is good evidence that they aren't needed. Many XML editor developers have obviously found a market in presenting XML without the ridiculous braces and open/close tag pairs (twice the work, twice the profit). GIS for XML editor and what do you see in every image? The proof is obvious.

  39. It'll be around forever by Anonymous Coward · · Score: 0

    XML will be around forever because it leverages more synergy than other less impactfull data aggregation schemes.

  40. It Works by Anonymous Coward · · Score: 0

    XML gives a good way to both mark up documents and to store hierarchical data in a format that's at least not openly hostile to being read by human beings like most binary encodings. Marking the closing tags seemed somewhat redundant at first, but it lets you know if a document is well-formed sooner rather than later so that you don't get to the end and find out that there's exactly one too few closing parenthesis with absolutely no idea where the missing one should go. XML documents can be compressed reasonably well and there are plenty of tools to work with them in one form or another.

    The hierarchical format of XML has proven quite versatile in describing everything from vector graphics to mathematical formulas to musical notation to financial statements and invoices. All it takes to adapt XML to a new application is a definition of the syntax using a standard format and a description of the semantics and then people can start using it.

    XForms is one interesting application of XML that shows how it doesn't need to be entirely passive. It doesn't describe what the forms it creates look like but rather how they behave. So you can say that you want the user to pick one of three options in a list and send back an event to the server when they choose. This description could then be put in a web page to get a web form, displayed using OS widgets in a regular program, stuck in an email, displayed on a smartphone, made into part of a curses application or used to place some checkboxes on a printed form. The best part is that the server doesn't even need to know or care exactly how these forms are being displayed.

  41. XML Rocks by Toreo+asesino · · Score: 1

    You can have extremely simple, toddler-complexity structures or hugely massive structures with multiple namespaces, etc, etc,

    But what really rocks is the standards and tools FOR xml; XSD, XSLT, XPath, XQuery and so on.

    Xml on it's own is nothing to write home about, it's the other XML standards that make it great.

    --
    throw new NoSignatureException();
  42. Largely because by Colin+Smith · · Score: 1

    We've got powerful computers with tons of RAM and hard drive space, and high-speed internet connections that can transmit vast amounts of data in mere seconds; why waste (valuable programmer) time and energy over-optimizing everything? We tax human work but not machine work. It's a huge tax avoidance system.

    --
    Deleted
    1. Re:Largely because by dp_wiz · · Score: 0

      We tax human work but not machine work. It's a huge tax avoidance system.
      Ever heard of "Microsoft Tax" ?
  43. XML in the frontend ... WTF???? by Aceticon · · Score: 2, Interesting
    The future of XML is where it's past is: in the back-end, connecting systems designed by different teams and even different companies.

    I've been working with XML ever since it first came out and the whole XML on the front-end is a fad that comes and goes periodically.

    The pros of XML
    • There are a gazillion libraries out there to parse and process XML. Any idiot can pick an XML library and in 5 minutes enable his/her program to read and write XML. This means less development work is needed to get the data into and out of the messages and more time can be used for actually dealing with the data itself (as in, figuring out what should it be and what to do with it).
    • Build-in validation. This is great when different teams are doing 2 sides of an interface between 2 system using XML as the transport format: basically the XML Schema acts as the de facto Interface Requirements Specification - it lists all fields, their type, their mandatory status, their location in the data structure and, if well done, even their allowed values or minimum and maximum values. If both the sender and the receiver actually enable validation of the XML messages against the schema, then in practice it's close to impossible for a sender to create a message which breaks the receiver. However, when both the sender and the receiver are being developed by the same team, this is a lot less useful.
    • People can actually open an XML message and check it with standard text editor. This is only good for relatively small messages though - if whatever is generating the messages doesn't put end of lines anywhere, for big messages interpreting it's contents is still a head ache


    Cons of XML
    • XML is the best file expansion scheme known to man. Encoding something in XML can easily turn 10KB worth of data into an 1MB monstrosity - just try encoding an n-by-m matrix of integers into XML without using fancy tricks like (non-XML) separators to see what i mean
    • High memory usage for parsers. This is both related to the first con listed and to the fact that the most common standard used to represent an XML document in memory in an Object Oriented language (DOM), actually uses one object per XML entity (elements, attributes, etc) - which means that an XML document is further expanded when loaded into memory (unless your element and attribute names are really large, the memory footprint of a DOM entity is usually bigger than the XML representation of that entity)
    • Parsing XML can be a lot slower than parsing most binary formats. This is again related to the cons listed above
    • High cross dependency between different parts of the file. More specifically, in order to reach any element inside an XML stream, the whole stream up to that point has to be parse.


    The pros and cons mean that the best place to use XML is for interoperability between systems/applications developed by different teams/vendors where not much data is sent around and processing is not time sensitive. This does cover some front-end applications where the data can be generated by a program done by one vendor and read by a program done by a different vendor. It does, however, not cover files which are meant to be written and read by the same application.

    The second best place is to quickly add support for a tree structured storage format for data to an application (for example, for a config file), since you can just pick-up one of the XML libraries out there and half your file format problems will be solved (you still have to figure out and develop the "what to put in there" and "where to put it" part, but need not worry about most of the mechanics of generating, parsing and validating the file)
  44. Which is quicker by Anonymous Coward · · Score: 0

    using resolv.conf in it's current format
    converting to XML
    ?

    Some people really like the idea of using XML instead of the variable formats of the configuration files. But they've never said WHY they want to do it.

    Sometimes a file that says

    a=3

    is a lot simpler to work with than XMLing it and if you wanted to get the stated benefits (one tool will allow you to edit any config file) there's a shitload of work to

    make a consistent schema for ALL your /etc files
    make the help XMLised
    make the validation sections
    modify the programs that use the /etc file

    and why? So we humans don't have to read the man page?

  45. Non-fatal error handling by gsnedders · · Score: 1

    One thing that XML needs to have defined is non-fatal error handling: a larger and larger amount of content is dependant on non-fatal error handling (especially of Atom/RSS feeds), and also often on RFC3023 not being supported.

    If non-fatal error handling is not specified soon, I fear that XML will fall into the same hell that HTML got into in the early 90s: everyone having to reverse engineer one-another to support content. Define it now, and chaos in the future can be avoided. Ignore the reality, and XML will fall into the same trap that HTML fell into. Idealism does not work. The world is not perfect.

  46. The Future of XML? by Anonymous Coward · · Score: 0

    YML... Or maybe even ZML.

  47. Where's the gain? Job security! by ardle · · Score: 1
    Thanks to XML you can:
    • Tell the PHB's that the code you write will be human-comprehensible (suggesting maintanability), then create code with tags like <obfus:rangeScopingUpperOrLowerBoundDefiningIntermediateParameterIndex> so that only you (or someone with a few weeks to train in) can maintain your code
    • Tell the PHB's that your code is interoperable while omitting the fact that it may take more logic to transform your XML so that it can "interoperate" than to generate it in the first place. More work for everyone!
    • Perform the same type of magic as DBAs: "the information you want is in there, you just need to know how to get it out"
    • More libraries = more bugs to work-around or fix
    In spite of the above, I don't have an objection to XML as a data exchange format! It's particularly useful for wrapping data from a relational database.
    I also do not object to the use of XML in config files. Done right, it's a good idea. Spring's pretty good. The handy thing about XML config files is that by validating the XML document, you are also validating the data in it, to a certain extent.
    I can think of cool things to do with things like Apache Digester and XSLT (things that might reduce volumes of code created. The "Spring" influence again ;-)
    XML within a stand-alone application is useful for debug purposes (I'm thinking of the CAD example you gave): leaving it there smacks of laziness or time constraints ;-)

    XML over the Internet is obscene. How many servers have to copy vast Strings around in order to transfer a few bytes from point a to point b?
    Seriously, someone should attempt to calculate how much energy is required to transport all those pointless extra characters around. I don't have the knowledge (and have time constraints ;-) but recall a "scare" news report recently about how "non-green" the Internet is. I don't know if the study included calculations for AJAX or Web Services.

    I started to read TFA. The logo wasn't a good omen but there was a chance that the article would be useful because there are some brilliant people working there.
    I scanned the introduction and no point leapt out at me. Once I found that the first section, "Oneiromancy" began with a cheap swipe at Sun, I quit. Not out of any loyalty to Sun but because I then knew that the document was likely to be merely propoganda and marketing-speak. In other words, more bloat...
  48. S-expressions? by ttfkam · · Score: 1

    Oh! You mean that thing that lacks unicode character support, that lacks any easy way to define the character set, and has plenty of other problems, like for example its inability to fail fast?

    No, not fail-safe, I mean fail fast. As soon as an XML parser comes across a closing tag that fails to match the tag that opened it, the parser throws an parsing error. No so with S-expressions. With your LISP structural model, the parser/interpreter must find the closing parenthesis that fails to match. This means that it may parse to the end of a multi-kilobyte or multi-megabyte data file before it can ever know that anything is wrong? How is that more efficient?

    (Answer: it's not.)

    Then of course you would need to validate the input in the S-expressions. You *do* validate your input, right? Do you do it manually with LISP? How would you do it with any other language? After all, this solution of yours has to work with more than one programming language, right? For some reason, validating the input from an S-expression in C doesn't sound fun.

    XML has DTDs (although I don't particularly like them), XML Schema, RelaxNG, RelaxNG compact syntax, etc. All of them work, and all of them have a strong following, so there's not much danger in choosing the "wrong one." Just use what you prefer. Well, of course, that is if you're using XML and not S-expressions. With S-expressions, you're just SOL.

    So have fun in your own little S-expression world.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:S-expressions? by DragonWriter · · Score: 1

      Oh! You mean that thing that lacks unicode character support, that lacks any easy way to define the character set, and has plenty of other problems, like for example its inability to fail fast?


      S-expressions don't "lack unicode character support"; generic S-expressions are encoding neutral. What generic S-expressions lack is a specified mechanism for specifying encoding.

    2. Re:S-expressions? by ttfkam · · Score: 1

      Point taken, still an important feature lacking in S-expressions, but point taken.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    3. Re:S-expressions? by warrax_666 · · Score: 1
      Regarding fail fast: If a document is large enough that fail-fast matters it's likely to be generated by a computer program. Two questions:

      1. Which of these is the common case:
           
        1. The computer program generates valid XML/S-expressions, or
                     
        2. The computer program generates invalid XML/S-expressions
             

      2. Which of these should you optimize programs (parsers in this case) for?
           
        1. the common case
                     
        2. the rare case



      This is all just a long-winded way of saying that your point about fail-fast is completely moot.
      --
      HAND.
    4. Re:S-expressions? by ttfkam · · Score: 1

      Do a quick search for all of the times that people have wanted to load a page with XmlHttpRequest only to find the target is not valid XHTML (XML). It works some of the time and the framework may be XHTML, but the framework (usually PHP) happily embeds snippets that aren't well-formed.

      Happens all of the time.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
  49. Hmmm by Billy+the+Mountain · · Score: 1

    <Sentence>
       <Words>
          <Word>I</Word>
          <Word>don't</Word>
          <Word>see</Word>
          <Word>what</Word>
          <Word>all</Word>
          <Word>the</Word>
          <Word>fuss</Word>
          <Word>is</Word>
          <Word>about</Word>
       </Words>
    </Sentence>

    --
    That was the turning point of my life--I went from negative zero to positive zero.
  50. indeed by Stu+Charlton · · Score: 1

    Because there is no such thing as a "superior" format. They all have their quirks. Engineering is about tradeoffs, not about religious contests...

    --
    -Stu
  51. Great XML Library for Java: XStream by cyranoVR · · Score: 1

    I've found that XML is great for Object persistence in Java. The library to use is XStream.

    The closing of Harold's article proposes a basic data format for XML. In fact, that's exactly what XStream provides out-of-the-box.

  52. I love XML by tristian_was_here · · Score: 0

    I love XML because it makes things work easier. I wish that XML could be implemented in SQL or some other sort of database system or even mange XML as some sort of database. The thing is XML will always be a backend.

  53. Serialization is the future, but it needn't be XML by aaronmcdaid · · Score: 1

    Networked computing means more communication of data among heterogenous systems. But XML is just one way to serialize data. Also, we should remember that data is often stored permanently somewhere, not merely transferred and forgetten in a chain of computers handling one transaction. There will continue to be multiple formats at the low level (XML, JSON and language/application specific forms and so on) for some time. If there is to be consolidation to fewer formats, there is no reason to doubt that XML could be squeezed out quite soon.

    If we see JSON being used more in the browser, and hence in the webserver, then why should developers waste effort to convert it to and from XML? We could have entire applications using JSON for everything from the database storage to the browser.

  54. This is why you validate against a schema by ttfkam · · Score: 1

    Just because DTDs suck doesn't mean you can't use RelaxNG or XML Schema, both of which allow you to constrain the values allowed for text or an attribute. As for blowing up when an element name consists of 100MBs of 'a' *AND* you are validating that XML document against a schema, that's a bug in the parser you're using, and you should file a bug report.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  55. Your example doesn't have to be verbose by ttfkam · · Score: 1

    The following in RelaxNG compact syntax might be more palatable to some:

        element myelement { xsd:token { minLength="1" maxLength="20" } }

    Great post. I heartily enjoyed it. Cheers!

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  56. when all you have is a hammer... by greywire · · Score: 1

    everything looks like a nail.

    That's the problem with XML. We have all these wonderful XML tools, so the solution to everything looks like XML.

    I am sure XML has its uses.

    Recently I interviewed for a job where they proposed a problem to me, asking how I might solve it. It was an issue of needing to track a lot user permissions for potentially thousands of users across hundreds groups of users; how do we add/remove a permission for a range of users? How do we set a default set of permissions and then override certain perms? etc. My answer was: store it in relational database tables. user, group, perm, group-perm-xref, user-perm-xref. I almost couldn't give an answer to their problem because I didn't understand why it was a problem. Yes, it would have ended up with millions of records. Big deal. MySql is fast.

    You know what their solution was going to be? Just have a text field in the user record and put all the permissions in there as.. wait for it.. XML! Oh joy!

    Needless to say I did not get the job. Which is fine since I got a job a week later where I work from home and when I suggest a method of doing something my co-workers actually listen. The topic of using XML for essentially a config file has been brought up and thanks to this thread I have some alternatives to consider (YAML).

    --

    Aric Caley,
    Fonality, inc.

    --
    -- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
    1. Re:when all you have is a hammer... by ClosedSource · · Score: 1

      "That's the problem with XML. We have all these wonderful XML tools, so the solution to everything looks like XML."

      That sounds like the problem with ASCII as well. Yet, the availability of tools is a legitimate factor to consider when chosing a technology.