Effective XML: 50 Specific Ways to Improve Your XML

Elliotte Rusty Harold

  • 出版商: Addison Wesley
  • 出版日期: 2003-10-02
  • 定價: $1,480
  • 售價: 5.0$740
  • 語言: 英文
  • 頁數: 336
  • 裝訂: Paperback
  • ISBN: 0321150406
  • ISBN-13: 9780321150400
  • 相關分類: XML

立即出貨(限量) (庫存=2)





"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 before, during, and after XML application development."—Sean McGrath, CTO, Propylon

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!

Table of Contents




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.


XML Declaration versus Processing Instruction.

Character Set versus Character Encoding.

URI versus URI Reference versus IRI.

Schemas versus the W3C XML Schema Language.


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.


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.



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.


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.



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.


Item 28. Use Only What You Need.

Item 29. Always Use a Parser.

Item 30. Layer Functionality.

Item 31. Program to Standard APIs.




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.


DOM Level 3 Validation.


Item 38. Write in Unicode.

Choosing an Encoding.

A char Is Not a Character.

Normalization Forms.


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.



Item 43. Preprocess XSLT on the Server Side.

Servlet-Based Solutions.



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.