Click here to start
Table of contents
Effective XML
Part 0: Should We Use XML?
The XML Backlash
Choose XML
Don’t Choose XML for
Why Use XML
Avoid
Why do simpler formats fail in practice?
Limited Use Cases
Choose the right tools:
Part I: Syntax
Stay with XML 1.0
Part II: Structure
The XML Stack
Allow All XML syntax
Distinguish text from markup
The reverse problem
White space matters
Make structure explicit through markup
Store metadata in attributes
Remember mixed content
What you really want is this:
What people do is this:
Prefer URLs to unparsed entities and notations
Part III: Semantics
Use processing instructions for process-specific content
Processing instructions are not appropriate when:
Include all information in instance documents
Encode binary data using quoted printable and/or Base64
Use namespaces for modularity and extensibility
Reuse XHTML for generic narrative content
Choose the right schema language for the job
Use only what you need
Always use a parser
Layer Functionality
Program to standard APIs
Program to non-standard APIs for ease of development
Read the complete DTD
Navigate with XPath
Validate inside your program with schemas
Part IV: Implementation
Write documents in Unicode
Avoid Vendor Lockin; Beware
Hang on to your relational database
Document Namespaces with RDDL
Pick the correct MIME type
TagSoup Your HTML
Catalog common resources
Compress if space is a problem
To Learn More
Author:
Elliotte Rusty Harold
Homepage:
http://www.cafeaulait.org/