[ Cafe con Leche | Corrections | Order ]

Effective XML

Elliotte Rusty Harold

Effective XML is a collection of guidelines and best practices for using XML. It focuses on using and developing XML applications, with a particular emphasis on aspects of XML that are often misunderstood or misapplied. It can be purchased from fine computer bookstores everywhere including Amazon and Barnes & Noble. The book is published by Addison-Wesley. The list price is $44.99. The ISBN number is 0321150406. In the meantime, while you're waiting for your paper copy to arrive, you can read many of the chapters here:

  1. Include an XML declaration
  2. Markup with ASCII if possible
  3. Stay with XML 1.0
  4. Use standard entity references
  5. Comment DTDs liberally
  6. Name elements with camel case
  7. Parameterize DTDs
  8. Modularize DTDs
  9. Distinguish text from markup
  10. White space matters
  11. Make structure explicit through markup
  12. Store metadata in attributes
  13. Remember mixed content
  14. Allow all XML syntax
  15. Build on top of structures, not syntax
  16. Prefer URLs to unparsed entities and notations
  17. Use processing instructions for process-specific content
  18. Include all information in instance documents
  19. Encode binary data using quoted printable and/or Base64
  20. Use namespaces for modularity and extensibility
  21. Rely on namespace URIs, not prefixes
  22. Don't use namespace prefixes in element content and attribute values
  23. Reuse XHTML for generic narrative content
  24. Choose the right schema language for the job
  25. Pretend there's no such thing as the PSVI
  26. Version documents, schemas, and stylesheets
  27. Markup according to meaning
  28. Use only what you need
  29. Always use a parser
  30. Layer Functionality
  31. Program to standard APIs
  32. Choose SAX for computer efficiency
  33. Choose DOM for standards support
  34. Read the complete DTD
  35. Navigate with XPath
  36. Serialize XML with XML
  37. Validate inside your program with schemas
  38. Write documents in Unicode
  39. Parameterize XSLT style sheets
  40. Avoid Vendor Lockin
  41. Hang on to your relational database
  42. Document Namespaces with RDDL
  43. Preprocess XSLT on the server side
  44. Serve XML+CSS to the client
  45. Pick the correct MIME media type
  46. Tidy Up Your HTML
  47. Catalog common resources
  48. Verify documents with XML digital signatures
  49. Hide confidential data with XML encryption
  50. Compress if space is a problem

What other's Say

Todd Ditchendorf

I’m almost done with the book, and I have not had a ton of time to spend with it… it’s just so good that I’m tearing through it at a really fast pace. What can I say, it’s a real page-turner.

Uche Ogbuji, developerWorks

a terrific book, and I highly recommend it. I don't agree with everything in it, but I'd be mad to expect to agree with every point in such a book. Harold does lay out clear principles which, if at least carefully considered, will make any reader a better user of XML.

Norman Richards

All I can say is that I use XML day in and day out and have learned everything I know by trial an error. I've made many mistakes along the way. I've tried my best to learn from them, but Effective XML was the book that made everything click for me. The best part is that the book went well beyond just helping me see my errors. I've already applied some of the ideas to new work I've done recently and have been able to head off some of the problems I would have encountered.

Effective XML is by far the best XML book I've ever read, and quite possibly the best tech book I've read all year. I might even have to add it to my favorite tech books list. If you work with XML to any significant degree, I can't recommend this book highly enough.

James Edward Gray II, Slashdot

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.

Jim Yingst, Java Ranch 9 Horseshoes

Little time is spent here explaining the details of how to do things; instead the focus more is on when and why to do them. Or why not. The interest is mostly in core concepts like syntax and structure, DTDs, schemas, parsing, etc, emphasizing important but subtle details you may well have missed when you first studied them. The writing style is very clear, concise, and practical. I'd recommend this to just about anyone working with XML in some form.

Thomas Paul

Harold is that rare writer who is both an expert on a subject and able to clearly explain that subject. Some of that no doubt comes from his being an adjunct profesor at a college in Brooklyn. Harold doesn't leave you wondering how he got to point C. He also doesn't use jargon or buzzwords just for the sake of using them. Right at the beginning of the book he clearly explains the difference between many of the common terms used in XML so that everyone is starting with the same lexicon. He also writes as someone who is eager to share his knowledge. I wish every book on technology was as enjoyable to read as this one.

Michael Smith

one of my favorite XML books

Tom Duff

This is a book that, when taken to heart and used, will cause your coworkers to thank you.

Mike Gunderloy, Application Development Trends

As the author points out, the heap of XML standards we now have threatens to surpass SGML in complexity. It's pretty easy to find your way into this forest, since basic XML is so simple. But if you're stuck there, looking for a way out, this book is a must-have.

S.B. Chatterjee

A few weeks ago I had posted about 'complexity' and the XML banyan tree. It was from an experience with a tech team lead, who demanded on using an XML tree as a database. Sure enough, that little project was an exercise in futility (read the footnote on the prior posting for a possible solution). I received 'Effective XML' a few days ago and here is an interesting excerpt (pg 230) -

“XML is not a database. It was never meant to be a database. It is never going to be a database. Relational databases are proven technology with more than 20 years of implementation experience. They are solid, stable, useful products. They are not going away. XML is a very useful technology for moving data between different databases or between databases and other programs. However, it is not itself a database. Don't use it like one.“

A great little book with some great insightful gems - I wish I had this book a few months ago.. :-)

Tech Book Report

it is not just the quality of the technical content that shines through. The writing is clear and the examples wisely chosen. There is a lot to be learned here, and Harold clearly wants to pass on those practices and techniques which work best.

Contacting the Author

Your commentary and feedback is much desired, both on major issues (e.g. "Why don't you cover JAXB?") and minor ones ("Cat is misspelled in the first sentence of page 42.") Please send all feedback directly to me at elharo@metalab.unc.edu.


This is an intermediate level book. It assumes that you're familiar with XML syntax and practices. It is not a tutorial. Rather it focuses on where and when to use what rather than how to use everything. It assumes you already know how to use XML. Instead, this book shows you how to use XML well.

Copying these Files

I'd like to ask that you not mirror these files on your own servers. It's difficult to keep multiple, unoffical mirrors in sync, and I don't want to deal with questions based on out of date copies. This site is hosted on the very fast, very well-connected IBiblio servers near the Internet backbone and should have enough bandwidth for everyone. If you want to save a copy on your local hard drive for your own use, feel free, However, please don't pass out copies of your own copies to anyone else. Instead refer your friends and colleagues to this web site.


This book was written in OpenOffice Writer 1.0 on Linux. All files were saved in OpenOffice's native XML format. Some drawings were produced in OpenOffice Draw 1.0 on Linux. Others were done in StencilIt 1.0 on Mac OS 9.

[ Cafe con Leche | Corrections | Order ]

Copyright 2003, 2006 Elliotte Rusty Harold
Last Modified November 12, 2006