BN.com Gift Guide

Effective XML: 50 Specific Ways to Improve Your XML (Effective Software Development Series)

Overview

Praise for Effective XML

“This is an excellent collection of XML best practices: essential reading for any developer using XML. This book will help you avoid common pitfalls and ensure your XML applications remain practical and interoperable for as long as possible.”

     —Edd Dumbill, Managing Editor, XML.com and Program Chair, XML Europe

“A collection of useful advice about XML and related technologies. Well worth ...

See more details below
Other sellers (Paperback)
  • All (8) from $5.39   
  • New (3) from $31.94   
  • Used (5) from $5.39   
Sending request ...

Overview

Praise for Effective XML

“This is an excellent collection of XML best practices: essential reading for any developer using XML. This book will help you avoid common pitfalls and ensure your XML applications remain practical and interoperable for as long as possible.”

     —Edd Dumbill, Managing Editor, XML.com and Program Chair, XML Europe

“A collection of useful advice about XML and related technologies. Well worth reading both before, during, and after XML application development.”

     —Sean McGrath, CTO, Propylon

“A book on many best practices for XML that we have been eagerly waiting for.”

     —Akmal B. Chaudhri, Editor, IBM developerWorks

“The fifty easy-to-read items cover many aspects of XML, ranging from how to use markup effectively to what schema language is best for what task. Sometimes controversial, but always relevant, Elliotte Rusty Harold’s book provides best practices for working with XML that every user and implementer of XML should be aware of.”

     —Michael Rys, Ph.D., Program Manager, SQL Server XML Technologies, Microsoft Corporation

Effective XML is an excellent book with perfect timing. Finally, an XML book everyone needs to read! Effective XML is a fount of XML best practices and solid advice. Whether you read Effective XML cover to cover or randomly one section at a time, its clear writing and insightful recommendations enlighten, entertain, educate, and ultimately improve the effectiveness of even the most expert XML developer. I’ll tell you what I tell all my coworkers and customers: You need this book.”

     —Michael Brundage, Technical Lead, XML Query Processing, Microsoft WebData XML Team

“This book provides great insight for all developers who write XML software, regardless of whether the software is a trivial application-specific XML processor or a fullblown W3C XML Schema Language validator. Mr. Harold covers everything from a very important high-level terminology discussion to details about parsed XML nodes. The well-researched comparisons of currently available XML-related software products, as well as the key criteria for selecting between XML technologies, exemplify the thoroughness of this book.”

     —Cliff Binstock, Author, The XML Schema Complete Reference

If you want to become a more effective XML developer, you need this book. You will learn which tools to use when in order to write legible, extensible, maintainable and robust XML code.

Page 36: How do you write DTDs that are independent of namespace prefixes? Page 82: What do parsers reliably report and what don't they? Page 130: Which schema language is the right one for your job? Page 178: Which API should you choose for maximum speed and minimum size? Page 257: What can you do to ensure fast, reliable access to DTDs and schemas without making your document less portable? Page 283: Is XML too verbose for your application?

Elliotte Rusty Harold provides you with 50 practical rules of thumb based on real-world examples and best practices. His engaging writing style is easy to understand and illustrates how you can save development time while improving your XML code. Learn to write XML that is easy to edit, simple to process, and is fully interoperable with other applications and code. Understand how to design and document XML vocabularies so they are both descriptive and extensible. After reading this book, you'll be ready to choose the best tools and APIs for both large-scale and small-scale processing jobs. Elliotte provides you with essential information on building services such as verification, compression, authentication, caching, and content management.

If you want to design, deploy, or build better systems that utilize XML—then buy this book and get going!

Read More Show Less

Product Details

Meet the Author

Elliotte Rusty Harold is an internationally respected writer, programmer, and educator. He is an Adjunct Professor of Computer Science at Polytechnic University in Brooklyn, where he lectures on Java and object-oriented programming. His Cafe con Leche Web site has become one of the most popular sites for information on XML. In addition, he is the author and coauthor of numerous books, the most recent of which are The XML Bible (John Wiley & Sons, 2001) and XML in a Nutshell (O'Reilly, 2002).

0321150406AB06062003

Read More Show Less

Read an Excerpt

Learning the fundamentals of

Since

Five years after the initial release of

This book is divided into four parts beginning with the lowest layer of

  • Part I covers
  • Part II looks at
  • Part III discusses the various techniques and APIs that are available for processing
  • Part IV explores effective techniques for systems built around

Although, this is how I've organized the book, you should be able to begin reading at essentially any chapter. This book makes an excellent bathroom reader. :-) You may wish to read the introduction first, which defines a number of key terms that are used throughout the book, and which are frequently misused or confused. However, after that feel free to pick and choose from the topics as your interest and needs dictate. I've made liberal use of cross-references to throughout to direct you along other paths through the book that may be of interest.

I hope that this book is a beginning, not an end. It's still early in the life of

—Elliotte Rusty Harold
elharo@metalab.unc.edu
Brooklyn NY April 22, 2003

0321150406P06062003

Read More Show Less

Table of Contents

Preface.

Acknowledgments.

Introduction.

Element versus Tag.

Attribute versus Attribute Value.

Entity versus Entity Reference.

Entity Reference versus Character Reference.

Children versus Child Elements versus Content.

Text versus Character Data versus Markup.

Namespace versus Namespace Name versus Namespace URI.

XML Document versus XML File.

XML Application versus XML Software.

Well-Formed versus Valid.

DTD versus DOCTYPE.

XML Declaration versus Processing Instruction.

Character Set versus Character Encoding.

URI versus URI Reference versus IRI.

Schemas versus the W3C XML Schema Language.

I. SYNTAX.

Item 1. Include an XML Declaration.

The version Info.

The encoding Declaration.

The standalone Declaration.

Item 2. Mark Up with ASCII if Possible.

Item 3. Stay with XML 1.0.

New Characters in XML Names.

C0 Control Characters.

C1 Control Characters.

NEL Used as a Line Break.

Unicode Normalization.

Undeclaring Namespace Prefixes.

Item 4. Use Standard Entity References.

Item 5. Comment DTDs Liberally.

The Header Comment.

Declarations.

Item 6. Name Elements with Camel Case.

Item 7. Parameterize DTDs.

Parameterizing Attributes.

Parameterizing Namespaces.

Full Parameterization.

Conditional Sections.

Item 8. Modularize DTDs.

Item 9. Distinguish Text from Markup.

Item 10. White Space Matters.

The xml:space Attribute.

Ignorable White Space.

Tags and White Space.

White Space in Attributes.

Schemas.

II. STRUCTURE.

Item 11. Make Structure Explicit through Markup.

Tag Each Unit of Information.

Avoid Implicit Structure.

Where to Stop?

Item 12. Store Metadata in Attributes.

Item 13. Remember Mixed Content.

Item 14. Allow All XML Syntax.

Item 15. Build on Top of Structures, Not Syntax.

Empty-Element Tags.

CDATA Sections.

Character and Entity References.

Item 16. Prefer URLs to Unparsed Entities and Notations.

Item 17. Use Processing Instructions for Process-Specific Content.

Style Location.

Overlapping Markup.

Page Formatting.

Out-of-Line Markup.

Misuse of Processing Instructions.

Item 18. Include All Information in the Instance Document.

Item 19. Encode Binary Data Using Quoted Printable and/or Base64.

Quoted Printable.

Base64.

Item 20. Use Namespaces for Modularity and Extensibility.

Choosing a Namespace URI.

Validation and Namespaces.

Item 21. Rely on Namespace URIs, Not Prefixes.

Item 22. Don't Use Namespace Prefixes in Element Content and Attribute Values.

Item 23. Reuse XHTML for Generic Narrative Content.

Item 24. Choose the Right Schema Language for the Job.

The W3C XML Schema Language.

Document Type Definitions.

RELAX NG.

Schematron.

Java, C#, Python, and Perl.

Layering Schemas.

Item 25. Pretend There's No Such Thing as the PSVI.

Item 26. Version Documents, Schemas, and Stylesheets.

Item 27. Mark Up According to Meaning.

III. SEMANTICS.

Item 28. Use Only What You Need.

Item 29. Always Use a Parser.

Item 30. Layer Functionality.

Item 31. Program to Standard APIs.

SAX.

DOM.

JDOM.

Item 32. Choose SAX for Computer Efficiency.

Item 33. Choose DOM for Standards Support.

Item 34. Read the Complete DTD.

Item 35. Navigate with XPath.

Item 36. Serialize XML with XML.

Item 37. Validate Inside Your Program with Schemas.

Xerces-J.

DOM Level 3 Validation.

IV. IMPLEMENTATION.

Item 38. Write in Unicode.

Choosing an Encoding.

A char Is Not a Character.

Normalization Forms.

Sorting.

Item 39. Parameterize XSLT Stylesheets.

Item 40. Avoid Vendor Lock-In.

Item 41. Hang On to Your Relational Database.

Item 42. Document Namespaces with RDDL.

Natures.

Purposes.

Item 43. Preprocess XSLT on the Server Side.

Servlet-Based Solutions.

Apache.

IIS.

Item 44. Serve XML+CSS to the Client.

Item 45. Pick the Correct MIME Media Type.

Item 46. Tidy Up Your HTML.

MIME Type.

HTML Tidy.

Older Browsers.

Item 47. Catalog Common Resources.

Catalog Syntax.

Using Catalog Files.

Item 48. Verify Documents with XML Digital Signatures.

Digital Signature Syntax.

Digital Signature Tools.

Item 49. Hide Confidential Data with XML Encryption.

Encryption Syntax.

Encryption Tools.

Item 50. Compress if Space Is a Problem.

Recommended Reading.

Index. 0321150406T08272003

Read More Show Less

Preface

Learning the fundamentals of XML might take a programmer a week. Learning how to use XML effectively might take a lifetime. While many books have been written that teach developers how to use the basic syntax of XML, this is the first one that really focuses on how to use XML well. This book is not a tutorial. It is not going to teach you what a tag is or how to write a DTD. I assume you know these things. Instead it's going to tell you when, why, where, and how to use such tools effectively (and perhaps equally importantly when not to use them). This book derives directly from my own experiences teaching and writing about XML. Over the last five years. I've written several books and taught numerous introductory courses about XML syntax, APIs, and tools. Increasingly I'm finding that audiences are already familiar with the basics of XML. They know what a tag is, how to validate a document against a DTD, and how to transform a document with an XSLT style sheet. The question of what XML is and why to use it has been sufficiently well evangelized. The essential syntax and rules are reasonably well understood. However, although most developers know what a CDATA section is, they are not sure what to use one for. Although programmers know how to add attribute and child nodes to elements, they are not certain which one to use when.

Since XML has become a fundamental underpinning of new software systems, it becomes important to begin asking new questions, not just what XML is, but how does one use it effectively? Which techniques work and which don't? Perhaps most importantly, which techniques appear to work at first but fail to scale as systems are further developed? When I teach programming at my university, one of the first things I tell my students is that it is not enough to write programs that compile and produce the expected results. It is as important (perhaps more important) to write code that is extensible, legible, and maintainable. XML can be used to produce robust, extensible, maintainable, comprehensible systems or it can be used to create masses of unmaintainable, illegible, fragile, closed code. In the immortal words of Eric Clapton, "It's in the way that you use it." XML is not a programming language. It is a markup language; but it is being successfully used by many programmers. There have been markup languages before, but in the developer community XML is far and away the most successful. However, the newness and unfamiliarity of markup languages have meant that many developers are using it less effectively than they could. Many programmers are hacking together systems that work, but are not as robust, extensible, or portable as XML promises. This is to be expected. Programmers working with XML are pioneers exploring new territory, opening up new vistas in software, and accomplishing things that could not easily be accomplished just a few years ago. However one definition of a pioneer is someone with an arrow in their back, and more than a few XML pioneers have returned from the frontier with arrows in their backs.

Five years after the initial release of XML into the world, certain patterns and antipatterns for the proper design of XML applications are becoming apparent. All of us in the XML community have made mistakes while exploring this new territory, the author of this book prominently among them. However, we've learned from those mistakes, and we're beginning to develop some principles that may help those who follow in our footsteps to avoid making the same mistakes we did. It is time to put up some caution signs in the road. We may not exactly say "Here there be dragons", but we can at least say, "That road is a lot rockier than it looks at first glance, and you might really want to take this slightly less obvious but much smoother path off to the left."

This book is divided into four parts beginning with the lowest layer of XML and gradually working up to the highest:

  • Part I covers XML syntax, those aspects of XML that don't really affect the information content of an XML document, but may have large impacts on how easy or hard those documents are to edit and process.
  • Part II looks at XML structures, the general organization and annotation of information in an XML document.
  • Part III discusses the various techniques and APIs that are available for processing XML with languages such as C++, C#, Java, Python, and Perl and thus local semantics to the labeled structures of XML.
  • Part IV explores effective techniques for systems built around XML documents, rather than looking at individual documents in isolation.

Although, this is how I've organized the book, you should be able to begin reading at essentially any chapter. This book makes an excellent bathroom reader. :-) You may wish to read the introduction first, which defines a number of key terms that are used throughout the book, and which are frequently misused or confused. However, after that feel free to pick and choose from the topics as your interest and needs dictate. I've made liberal use of cross-references to throughout to direct you along other paths through the book that may be of interest.

I hope that this book is a beginning, not an end. It's still early in the life of XML, and much remains to be discovered and invented. You may well develop best practices of your own that are not mentioned here. If you do I'd love to hear about them. You may also take issue with some of the principles stated here. I'd like to hear about that too. Discussion of many of the guidelines identified here has taken place on the xml-dev mailing list, and seems likely to continue in the future. If you're interested in further discussion of the issues raised in this book, I recommend you subscribe and participate there. Complete details can be found at http://lists.xml.org/. On the other hand, if you find out and out mistakes in this book (The ID attribute value on p. 87 is missing a closing quote. The word "Cat" is misspelled on p. 46.) you can write me directly at elharo@metalab.unc.edu. I maintain a web page listing known errata for this book, as well as any updates at http://www.cafeconleche.org/books/effectivexml/. I hope this book makes your use of XML both more effective and more enjoyable.

—Elliotte Rusty Harold
elharo@metalab.unc.edu
Brooklyn NY
April 22, 2003

0321150406P06062003

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted September 3, 2003

    A maturing and more sophisticated XML

    It is a sign of the maturing and vitality of XML applications and the expertise of its users that books are starting to appear about advanced extensions to XML, or about applications built atop it. So, for example, some have written about XLink and XQuery. But those are very specialised extensions. By contrast, Harold has put together an advanced overview of ALL XML. A significant part of the value of this book is in Harold's assessment of the various proposed extensions to XML, like the XML Schema language, or the abovementioned XLink and XQuery. XML is still growing rapidly, and there is a real need for various extensions. But there is also a consequent need for independent comparative assessments of those extensions. For example, if you have a book devoted to XML Schema, it might not even tell you that there are other competing schema languages. En passant, he gives an unusually clear explanation of the difference between a character set and a character encoding. The former is a mapping of some characters to numbers. The latter is an instantiation of those numbers as an actual numerical storage. Often in other books, you can see the two phrases used interchangeably and imprecisely. By contrast, throughout this book Harold emphasises a precision of terminology. A priori, if you are into XML, then you need to be precise. I have one minor quibble. He says that multiple XML documents 'can be stored in a single file, though this is unusual in practice.' He might have added that one of these instances is instructive. If you have a continuously running program that periodically writes to a log file in XML, then during the writing, for efficiency, you would append XML documents to the file. So notice that at all times, the entire file is not an XML document, because there are no enclosing tags.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)