Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming IT Technology

An Overview of Modern XML Processing Techniques and APIs 40

Dare Obasanjo writes with a link to his article "A Survey of APIs and Techniques for Processing XML" on xml.net. It starts off "In recent times the landscape of APIs and techniques for processing XML has been in the process of reinventing itself as developers and API designers learn from their experiences and some past mistakes. APIs such as DOM and SAX which used to be the bread and butter of XML APIs are giving way to new models of examining and processing XML. However although some of these techniques have become widespread amongst developers who primarily work with XML they are still unknown to the general body of developers. Nothing highlights this better than a recent article by Tim Bray one of the co-inventors of XML entitled XML is too Hard for Programmers and the subsequent responses on Slashdot." Read the entire article to learn more about the state of the XML art. Added in the missing link.
This discussion has been archived. No new comments can be posted.

An Overview of Modern XML Processing Techniques and APIs

Comments Filter:
  • You know... (Score:1, Offtopic)

    by avalys ( 221114 )
    With the new technology known as a hyperlink, we can simply click a location on the screen and be taken to the article, instead of having to go to xml.net and find it ourself.

    Argh...
  • Actually on xml.com (Score:5, Informative)

    by DeathBunny ( 24311 ) on Thursday July 10, 2003 @03:10PM (#6409334)
    The article is actually on xml.com, not xml.net. Here is the url: http://www.xml.com/pub/a/2003/07/09/xmlapis.html [xml.com]
  • No Link? (Score:4, Insightful)

    by Snerdley ( 98439 ) on Thursday July 10, 2003 @03:14PM (#6409361)

    This is a horrible post!

    There is no link to the article, and the one link that comes close (to xml.net [xml.net] ) points to a site that says:

    xml.net will be online soon. Sign up now and we'll keep you posted on our progress.

    Timothy, how did you read this as the editor?

    I am interested in the topic: please fix the post so that we can read the article.
    • Re:No Link? (Score:4, Funny)

      by Anonymous Coward on Thursday July 10, 2003 @03:21PM (#6409416)

      I am interested in the topic: please fix the post so that we can read the article.

      The fix will be uploaded in a few days but subscribers can click now and beat the rush!

  • by cpeterso ( 19082 ) on Thursday July 10, 2003 @03:16PM (#6409378) Homepage

    XML sucks because it's being used wrongly. It is being used by people who view it as being an encapsulation of semantics and data, and it's not. XML is purely a way of structuring files, and as such, really doesn't add much to the overall picture. XML came from a document preparation tradition. First there was GML, a document preparation system, then SGML, a document preparation system, then HTML, a document preparation system, and now XML. All were designed as ways humans could structure documents. Now we've gotten to the point where XML has become so obscure and so complex to write, that it can no longer be written by people. If you talk to people in Sun about their libraries that generate XML, they say humans cannot read this. It's not designed for human consumption. Yet we're carrying around all the baggage that's in there, because it's designed for humans to read. So XML is a remarkably inefficient encoding system. It's a remarkably difficult to use encoding system, considering what it does. And yet it's become the lingua franca for talking between applications, and that strikes me as crazy.

    People think, "Once I've got my data in XML that's all I've got to do. I've now got self-describing data," but the reality is they don't. They're just assuming that the tags that are in there somehow give people all the information they need to be able to deal with the data. Now, for some things there are standards. For example, there are some standards like RSS and RDF, which give you very simple ways of describing web page content. But a random XML file, especially machine generated XML files, can be as obscure as binary data.

    Ant is a really good example, because in that case you're using XML as a user-specified input language, which is really inappropriate in that context. I'd much rather have a genuine grammar. I want to be able to type something simple and easy for me. I don't care if it's easy for the tool to parse, that's the tool's problem. I want it to be easy for me to write. And in cases like that, it's really the case of the programmer saying, "Oh look, here's an XML parser. I can just take XML files. That's easier." So one programmer in one context puts a burden on the other 100,000 programmers trying to use it.
    • by battjt ( 9342 ) on Thursday July 10, 2003 @03:36PM (#6409528) Homepage
      Once data is in XML I can manipulate it without having to write a parser. This is pretty handy in an enterprise setting where data is coming from all over and headed somewhere else. Efficiency of the overall business process is important, not the efficiency of my program. Joe
      • Once data is in XML I can manipulate it without having to write a parser.

        Um, no. Or yes, but only in not too interesting ways.

        An XML processor (Note that the W3C XML Rec carefully avoids the term "parser". That is for a reason.) is more like a lexer than a parser in traditional terms. It tells you about the syntactic elements of an XML document, but nothing about their meaning or relation. In other words, XML is not a language, XML applications are. Yet languages is what people need.

        It turns out tha

      • And those manipulations you do are just another form of parsing. There's really no difference in writing a grammar that parses data and manipulates it and using SAX or DOM to manipulate some XML data. In either case, you still have to know the semantics to do anything useful. Using SAX is a big pain in the neck to interpret/manipulate the data hierarchy. Using DOM wastes alot of memory making a tree out of your whole dataset.

        However, it's ten million times easier for the end user of your data to create
    • So if you're unhappy with working directly wit XML -- lord knows I am: it obscures the content far too much -- use a formal structured human readable markup system like DocUtils [sourceforge.net] or ASCIIDoc [methods.co.nz].

      They're both quite robust, well-suited to documenting APIs, writing technical manuals, etcetera. They can both pump out DocBook-XML from the plaintext, lightly-formatted input.

      The beauty of these formats is that they are simple and often intuitive.

      You emphasize text by wrapping it in *asterisks*, just like you used t
    • you make good points.

      I understand the idea that if you need an XML editor (or compiler!) to make it easy to write XML what's the point of having a human readable format. Would you suggest standard binary formats?

      I think, in fact, there are good binary encodings that also can encapsulate DOM shaped structures. It seems to me that the accessibility is still a good thing, I like XML as a universal interchange format that supports arbitrary nesting properties for the embedded blocks. All that could be done
    • Ah... Someone that groks that "XML" is just a text-based file format, and YAT (Yet Another Three-Letter-Acryonm), and not some magick thingy that makes the world a better place...
  • It's also "too hard" in a variety of circumstances where the reason it's too hard is that it's the wrong thing to use.

    Good programmers can cope with XML just fine when it's just what they need to get the job done, and are smart enough to avoid it when it isn't.

    • What then is the proper use for XML?

      I am working on a project where I have to link a TCL based program with a PHP program.

      I have been having a rediculously horrible time figuring out how to link the two using XML-RPC. I briefly tried SOAP but that wasnt much better.

      Is XML and XML-RPC any easier in python or C?
      • There are dozens of ways to link one program with another. If you can send and receive XML, you can send and receive text formatted in any other format you like - or "raw" binary data, if that's your bag. The only reason to use XML is if both sender and receiver have some nifty tools (like the MS SOAP toolkit, xmlrpclib, SOAPPy, SOAP::LITE or whatever) for sending and receiving messages that happen to use some XML vocabulary to encode things on the wire.

        If you have such tools, you should use them (unless

        • Neither end starts out as XML. The troubles arose when trying to pass arrays from within TCL over the XML-RPC layer. I found that the available XML-RPC layers for TCL were very picky.

          I am going to give python a shot. TCL is a really cool language, but I think I need to hit this problem from a different perspective.

          I also recently added a book about XML-RPC from Oreilly Press to my Safari Bookshelf, so I'm going to RTFM, as the online guides on the matter have proved a bit too difficult to use (esp
  • My team (myself and another guy) implemented a mapping framework in Java that I think is more useful than the other frameworks I've seen.

    1. Order of fields in mapping file specifies order of elements in generated XML.
    2. Formatting of String, Date, etc. classes determined by formatter string in the mapping file.
    3. Can use an XPath like path to specify the location in the XML, not just a key name. This lets you decouple the structure of the object and the structure of the XML.
    4. Likewise, object fields are spe
  • I know some of you don't care and/or are tired of hearing this, but XML data tends to violate relational rules. I would like to see a souped-up comma-delimited standard for data sharing. XML is perhaps suited okay for documents, but NOT structured data (except in relatively rare circumstances). Dr. Codd knew what he was doing. Relational has a more ordered, consistent structure than XML.
    • More often than not the data I work on don't fit naturally in a relational structure. A lot of data is more naturally structured in tree structures or graph structures than in a matrix. One of the reasons I like XML is because it fits my data much better than a matrix.
      • More often than not the data I work on don't fit naturally in a relational structure. A lot of data is more naturally structured in tree structures or graph structures than in a matrix. One of the reasons I like XML is because it fits my data much better than a matrix.

        I am a bit skeptical of this. What are some real-world examples? Trees are often the improper design IMO. Besides, trees can also be represented relational if need be.
        • Besides, trees can also be represented relational if need be.

          And XML can represent the structured content when necessary. Because XML allows some flexibility, we may see programmers *use* it incorrectly, but it can certainly be used in a relational fashion for structured data. The "relatively rare circumstances" you mention in the parent post are likely a result of programmer quality rather than a reflection of XML.
          • And XML can represent the structured content when necessary. Because XML allows some flexibility, we may see programmers *use* it incorrectly, but it can certainly be used in a relational fashion for structured data. The "relatively rare circumstances" you mention in the parent post are likely a result of programmer quality rather than a reflection of XML.

            That is why we need a standard relational alternative IMO. It would make it harder to violate relational rules and still be called a "relational forma
  • I have an application that does not have any access to a database or any database libraries on the server in which it will be run.

    It needs to store a small amount of data in a text file. Initially I thought I would use XML, but figuring out how to parse the data after it was created proved very difficult. I had some small luck with DOM inside tcldom, but it seemed like a lot more effort than it was worth.

    This file is a basic tree with branches of depth 2. All branches have the exact same structure.
  • Just because XML is a human-readable format and anyone can make one is I think the biggest problem of all in this ongoing xml-is-the-biggest-thing-since-sliced-bread saga.

    I've been working with XML for 2 years now, and I am constantly reminded that, just as it happens with html, vb, or any other "simple to use" technology out there, anyone can use it, but few know how to use it well. I've seen xml structures that would have you rolling on the floor laughing, so inneficient and dumb were they.

    It's just lik
  • XPath is awesome for getting at what you really want. SAX and DOM are too low level for implementing anything other than an XPath or XSLT engine :) Even easier is putting System.Xml.Serialization attributes on your properties in C#. Blammo, instant configuration file for your classes. And I hear XQuery [w3.org] shall revolutionize the world as we know it. There are some early implementations already. r4lv3k
  • Attributes (Score:2, Funny)

    by Skeme ( 687563 )
    XML sucks because of attributes. I can have a <something stuff="thing"> and a <something> <stuff>thing</stuff> and they are treated differently. How pointless that is.

    Plus any drooling idiot can come up with a way to represent a tree in a file. They did that 100 years ago with Lisp.

The world will end in 5 minutes. Please log out.

Working...