Slashdot Mirror


Effective XML

James Edward Gray II writes "I'm not an XML junkie and I thought this was a very good book, so I'm betting that XML aficionados will love it. Effective XML covers 50 best practices that all developers should know and use. This amounts to a book of distilled wisdom that will push you a good distance up the chart of XML mastery." Read on for the rest of Gray's review. Effective XML author Elliotte Rusty Harold pages 304 publisher Addison-Wesley rating 8 reviewer James Edward Gray II ISBN 0321150406 summary A guide to the correct use of XML.

Before I tell you what's inside though, let me tell you what you won't find in these pages. Primarily you need to know that this book does not teach XML. I know a lot of books say that, yet still include an introduction or appendix that covers the basics, but this isn't one of them. You're expected to know XML from page one. Even syntax is only covered from a proper usage angle. Personally, I appreciated this. It always bothers me when an obvious non-beginner's book starts off by wasting a chapter on things I should already know. You just need to be aware when you buy that you won't learn XML here. Knowledge of namespaces, DTDs, the W3C's Schema Language, XSLT, and more aren't strictly required to get something out of this book, but they certainly would help you get a lot more out of it.

What you will get here is coverage of fifty miscellaneous topics spread across four sections on "Syntax", "Structure", "Semantics", and "Implementation". In "Syntax", ten topics delve into the details of things like DTDs, entity references and the XML declaration itself. It may sound silly to dig deep into a single line of XML that simply declares the format, but I doubt you will think so after reading that topic. There's a lot going on in that line and you want to be in control of those decisions instead of just copying and pasting. Entity references are an even smaller chunk of XML output, but they too get illuminated by a rare insight on how and when they should be used, and for what. Did you know that it is possible to write a namespace savvy DTD? I do now and I learned that in this section as well.

The second section of the book covers "Structure", and to me it was the best part. This collection of seventeen topics is loaded with good advice about how to build an XML document that will be ideal for anyone who needs to work with it. Here you see how metadata should be stored in XML, get tips on embedding binary content, learn which schema language is better for which tasks, and finally understand rare XML constructs like processing instructions and exactly what they are for. Additionally, there's a lot of general advice on the right way to mark up content that's really worth its weight in gold. Just one example of what I learned here is that I under appreciate mixed content for great constructs like <name><given>John</given> <family>Doe</family>, <title>Ph.D.</title></name>. If you like that, you'll enjoy this whole section.

Section three, "Semantics", deals primarily with parsers and their APIs. Again, you won't learn any APIs here. What's covered is their strengths and weaknesses and why you should choose a given API for a given task. SAX and DOM are the main focus of these ten topics, but there are other details sprinkled in, like XPath.

The fourth and final section is all about "Implementation". The thirteen topics here address client-side XML styling, server-side transformations, signatures, encryption, compression, and more. My favorite topic here was a terrific coverage of Unicode and how it affects XML. All developers should know at least as much about Unicode as what's printed here and this is a fine source to learn it from.

One thing that really stands out in the whole text is that the author isn't afraid to cover the dark side of XML. He will tell you where the design process was less than perfect, which tools have little practical value, and some of the problems with where XML technologies are headed. This isn't complaining though. All of this is targeted at how it affects XML developers today. You learn what you can safely skip and what should be outright avoided. The author even tells you what XML is bad at and gives you advice about when you shouldn't use it. That's the mark of a man who knows his subject, if you ask me.

All told, I think the author failed to completely convince me his way is perfect on only 2 topics. That means I learned 48 expert XML tricks. Surely that's worth the cost of the book in time and money. This isn't the first XML book you need, but I think it is the second XML book everyone should read.

You can purchase Effective XML from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

19 of 269 comments (clear)

  1. Binding by 2.7182 · · Score: 3, Funny

    I love the book, but once it encountered a humid day the binding fell apart. Anyone else have this experiance ?

    1. Re:Binding by Anonymous Coward · · Score: 1, Funny

      Good book. I found that when I spilled milk all over the book the pages stuck togethor. But still, the content is good.

    2. Re:Binding by Monkelectric · · Score: 2, Funny

      I once tried to "dry" a book that was rain soaked in the oven at very low temp ... my father turned the oven up to preheat some food ... physics book al larange

      --

      Religion is a gateway psychosis. -- Dave Foley

    3. Re:Binding by xaqar · · Score: 5, Funny
      physics book al larange

      Surely you mean physics book a lagrange ...
    4. Re:Binding by Dasch · · Score: 1, Funny

      In France only old people read books...

  2. Bah by Anonymous Coward · · Score: 0, Funny

    xml is just html with a waffle iron attached to it.

    1. Re:Bah by Anonymous Coward · · Score: 4, Funny

      The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well. - Phil Wadler

      XML is not the end of our problems, it is the beginning of our problems. - ditto

      Shortly after the release of XML, some folks, including some very important folks in W3C and its members, who had been big supporters of XML, actually got around to reading the spec, and discovered to their horror that they had an XML which included entities, DTDs, PIs, and assorted other baggage. - Tim Bray

      When XMI came out, I had just been studying up on UML, and I thought "Cool! I'll print out the DTD so that I can look it over on the subway ride home!" When I saw how big the XMI DTD was, I decided not to print it out--I prefer not to spend that much time in the subway. - Robert DuCharme

      XML was monocase until quite late in its design, when we ran across this ugliness. I had a Java-language processor called Lark - the world's first - and when XML went case-sensitive, I got a factor of three performance improvement, it was all being spent in toLowerCase().- Tim Bray

      XML-based technologies seem particularly susceptible to the "if we standardize it, everyone will use it" fallacy. - Simon St. Laurent

  3. Join the Dark Side by TripMaster+Monkey · · Score: 2, Funny

    One thing that really stands out in the whole text is that the author isn't afraid to cover the dark side of XML.

    [Obligatory Star Wars joke]

    --
    ____

    ~ |rip/\/\aster /\/\onkey

    1. Re:Join the Dark Side by TripMaster+Monkey · · Score: 5, Funny

      XML: You killled my father!

      HTML: No, XML....I am your father!

      XML: That's impossible!

      HTML: Grep your code...you know it to be true.

      XML: NOOOOOOOOOOOOOOOOOO!

      --
      ____

      ~ |rip/\/\aster /\/\onkey

  4. damn by pyrrho · · Score: 5, Funny

    I want to say something funny about XML, but there is nothing.

    --

    -pyrrho

    1. Re:damn by Ivan+Todoroski · · Score: 5, Funny

      I completely agree with you .

  5. Hey, come on... by Anonymous Coward · · Score: 5, Funny

    XML is all about loosely bound interfaces.

    Get with the program.

  6. Dear XML-Junkies, by Letter · · Score: 5, Funny

    <letter>
    <salutation>Dear XML-Junkies</salutation>
    <body>
    I type all my business letters in <link href="http://www.google.com/?q=XML>XML</link>. Sometimes it can be a bit <link href="http://dictionary.reference.com/search?q=ver bose">verbose</link>.
    </body>
    <signature>
    <name ><nickname>Letter</nickname></name>
    </signature>
    </letter>

    1. Re:Dear XML-Junkies, by refactored · · Score: 2, Funny

      nsgmls:letter.xml:1:0:E: no document type declaration; will parse without validation
      nsgmls:letter.xml:4:78:W: character "" is the first character of a delimiter but occurred as data
      nsgmls:letter.xml:4:78: open elements: letter body
      nsgmls:letter.xml:4:114:W: character "" is the first character of a delimiter but occurred as data
      nsgmls:letter.xml:4:114: open elements: letter body
      nsgmls:letter.xml:4:132:E: net-enabling start-tag not immediately followed by null end-tag
      nsgmls:letter.xml:4:132: open elements: letter body
      nsgmls:letter.xml:4:46:E: literal is missing closing delimiter
      nsgmls:letter.xml:4:46: open elements: letter body

  7. Re:The Problem With XML by Procyon101 · · Score: 4, Funny

    I think that I shall never smell
    A standard worse than XML.
    A standard I am loath to use
    Though offered parsers to abuse;
    The designers couldn't pass a class,
    CS201 can kiss their ass;
    A structure no one can traverse
    pre and post order routes are cursed;
    What are it's types you cannot tell;
    Though it promised self referential.
    Standards are assigned by committee,
    But any fool can make a tree.

  8. A perfect eXaMpLe of a good use for XML by swrider · · Score: 5, Funny

    There are valid uses for XML. Just look at http://www.x-cp.org/

  9. Delicious irony by dubbayu_d_40 · · Score: 3, Funny

    ridiculing the verbosity of xml, on a web page.

    1. Re:Delicious irony by owlstead · · Score: 3, Funny

      Yeah, but this is slashdot HTML, as far away from XML as it can be.

  10. Re:n00b - help! by Doctor+Faustus · · Score: 2, Funny

    XSLT lets you take an XML file and perform transformations on it into another (possibly XML) file format. Need to convert XML into SQL INSERTS? Piece of cake. I use it to extract particular parts of an XML file and convert them into a significantly differently-ordered Lisp structure.

    I really like XSLT for code generators, with the meta-data in XML. I do, however, miss the sheer perversity of using Access VBA to generate Java.