XML by Example

Book description

XML by Example teaches Web developers to make the most of XML with short, self-contained examples every step of the way. The book presumes knowledge of HTML, the Web, Web scripting, and covers such topics as: Document Type Definitions, Namespaces, Parser Debugging, XSL (Extensible Stylesheet Language), and DOM and SAX APIs. At the end, developers will review the concepts taught in the book by building a full, real-world e-commerce application.

Table of contents

  1. Table of Contents (1/3)
  2. Table of Contents (2/3)
  3. Table of Contents (3/3)
  4. Introduction
    1. The by Example Series
    2. Who Should Use This Book
    3. This Book’s Organization
    4. Conventions Used in This Book
  5. 1 The XML Galaxy
    1. Introduction
    2. A First Look at XML
      1. No Predefined Tags
      2. Stricter
    3. A First Look at Document Structure
    4. Markup Language History
      1. Mark-Up
      2. Procedural Markup
      3. Generic Coding
      4. Standard Generalized Markup Language
      5. Hypertext Markup Language (1/2)
      6. Hypertext Markup Language (2/2)
      7. eXtensible Markup Language
    5. Application of XML
      1. Document Applications
      2. Data Applications
    6. Companion Standards
      1. XML Namespace
      2. Style Sheets
      3. DOM and SAX
      4. XLink and XPointer
    7. XML Software
      1. XML Browser
      2. XML Editors
      3. XML Parsers
      4. XSL Processor
  6. 2 The XML Syntax
    1. A First Look at the XML Syntax
      1. Getting Started with XML Markup
      2. Element’s Start and End Tags
      3. Names in XML
      4. Attributes
      5. Empty Element
      6. Nesting of Elements
      7. Root
      8. XML Declaration
    2. Advanced Topics
      1. Comments
      2. Unicode
      3. Entities
      4. Special Attributes
      5. Processing Instructions
      6. CDATA Sections
    3. Frequently Asked Questions on XML
      1. Code Indenting
      2. Why the End Tag?
      3. XML and Semantic
    4. Four Common Errors
      1. Forget End Tags
      2. Forget That XML Is Case Sensitive
      3. Introduce Spaces in the Name of Element
      4. Forget the Quotes for Attribute Value
    5. XML Editors
    6. Three Applications of XML
      1. Publishing
      2. Business Document Exchange
      3. Channel
  7. 3 XML Schemas
    1. The DTD Syntax
      1. Element Declaration
      2. Element Name
      3. Special Keywords
      4. The Secret of Plus, Star, and Question Mark
      5. The Secret of Comma and Vertical Bar
      6. Element Content and Indenting
      7. Nonambiguous Model
      8. Attributes
      9. Document Type Declaration
      10. Internal and External Subsets
      11. Public Identifiers Format
      12. Standalone Documents
    2. Why Schemas?
      1. Well-Formed and Valid Documents
    3. Relationship Between the DTD and the Document
      1. Benefits of the DTD
      2. Validating the Document
    4. Entities and Notations
      1. General and Parameter Entities
      2. Internal and External Entities
    5. Notation
      1. Managing Documents with Entities
    6. Conditional Sections
    7. Designing DTDs
      1. Main Advantages of Using Existing DTDs
    8. Designing DTDs from an Object Model
      1. On Elements Versus Attributes
    9. Creating the DTD from Scratch
      1. On Flexibility
      2. Modeling an XML Document
      3. Naming of Elements
    10. A Tool to Help
    11. New XML Schemas
  8. 4 Namespaces
    1. The Problem Namespaces Solves
    2. Namespaces
      1. The Namespace Name
    3. URIs
      1. What’s in a Name?
      2. Registering a Domain Name
      3. Creating a Sensible URL
      4. URNs
    4. Scoping
    5. Namespaces and DTD
    6. Applications of Namespaces
      1. XML Style Sheet
      2. Links
  9. 5 XSL Transformation
    1. Why Styling?
      1. CSS
      2. XSL
    2. XSL
      1. LotusXSL
      2. Concepts of XSLT
    3. Basic XSLT
      1. Viewing XML in Browser
      2. A Simple Style Sheet
      3. Stylesheet Element
      4. Template Elements
      5. Paths
      6. Matching on Attributes
      7. Matching Text and Functions
      8. Deeper in the Tree
      9. Following the Processor
      10. Creating Nodes in the Resulting Tree
    4. Supporting a Different Medium
      1. Text Conversion
      2. Customized Views
    5. Where to Apply the Style Sheet
      1. Internet Explorer 5.0
      2. Changes to the Style Sheet
    6. Advanced XSLT
      1. Declaring HTML Entities in a Style Sheet
      2. Reorganizing the Source Tree
      3. Calling a Template
      4. Repetitions
    7. Using XSLT to Extract Information (1/2)
    8. Using XSLT to Extract Information (2/2)
  10. 6 XSL Formatting Objects and Cascading Style Sheet
    1. Rendering XML Without HTML
    2. The Basics of CSS
      1. Simple CSS
      2. Comments
      3. Selector
      4. Priority
      5. Properties
    3. Flow Objects and Boxes
      1. Flow Objects
      2. Properties Inheritance
      3. Boxes
    4. CSS Property Values
      1. Length
      2. Percentage
      3. Color
      4. URL
    5. Box Properties
      1. Display Property
      2. Margin Properties
      3. Padding Properties
      4. Border-Style Properties
      5. Border-Width Properties
      6. Border Shorthand
    6. Text and Font Properties
      1. Font Name
      2. Font Size
      3. Font Style and Weight
      4. Text Alignment
      5. Text Indent and Line Height
      6. Font Shorthand
    7. Color and Background Properties
      1. Foreground Color
      2. Background Color
      3. Border Color
      4. Background Image
    8. Some Advanced Features
      1. Child Selector
      2. Sibling Selector
      3. Attribute Selector
      4. Creating Content
      5. Importing Style Sheets
    9. CSS and XML Editors
      1. Text Editor
      2. Tree-Based Editor
      3. WYSIWYG Editors
    10. XSLFO
      1. XSLT and CSS
      2. XSLFO
  11. 7 The Parser and DOM
    1. What Is Parser?
      1. Parsers
      2. Validating and Nonvalidating Parsers
    2. The Parser and the Application
      1. The Architecture of an XML Program
      2. Object-Based Interface
      3. Event-Based Interface
      4. The Need for Standards
    3. Document Object Model
    4. Getting Started with DOM
      1. A DOM Application
      2. DOM Node
      3. Document Object
      4. Walking the Element Tree
      5. Element Object
      6. Text Object
    5. Managing the State
      1. A DOM Application That Maintains the State
    6. Attributes (1/2)
    7. Attributes (2/2)
      1. NamedNodeMap
      2. Attr
      3. A Note on Structure
    8. Common Errors and How to Solve Them
      1. XML Parsers Are Strict
      2. Error Messages
      3. XSLT Common Errors
    9. DOM and Java
      1. DOM and IDL
      2. A Java Version of the DOM Application
      3. Two Major Differences
      4. The Parser
    10. DOM in Applications
      1. Browsers
      2. Editors
      3. Databases
  12. 8 Alternative API: SAX
    1. Why Another API?
      1. Object-Based and Event-Based Interfaces
      2. Event-Based Interfaces
      3. Why Use Event-Based Interfaces?
    2. SAX: The Alternative API
      1. Getting Started with SAX
      2. Compiling the Example
    3. SAX Interfaces and Objects
      1. Main SAX Events
      2. Parser
      3. ParserFactory
      4. InputSource
      5. DocumentHandler
      6. AttributeList
      7. Locator
      8. DTDHandler
      9. EntityResolver
      10. ErrorHandler
      11. SAXException
    4. Maintaining the State (1/3)
    5. Maintaining the State (2/3)
    6. Maintaining the State (3/3)
      1. A Layered Architecture
      2. States
      3. Transitions
      4. Lessons Learned
    7. Flexibility
      1. Build for Flexibility
      2. Enforce a Structure
  13. 9 Writing XML
    1. The Parser Mirror
    2. Modifying a Document with DOM
      1. Inserting Nodes
      2. Saving As XML
    3. DOM Methods to Create and Modify Documents
      1. Document
      2. Node
      3. CharacterData
      4. Element
      5. Text
    4. Creating a New Document with DOM
      1. Creating Nodes
      2. Creating the Top-Level Element
    5. Using DOM to Create Documents
    6. Creating Documents Without DOM
      1. A Non-DOM Data Structure
      2. Writing XML
      3. Hiding the Syntax
    7. Creating Documents from Non-XML Data Structures
    8. Doing Something with the XML Documents
      1. Sending the Document to the Server
      2. Saving the Document
    9. Writing with Flexibility in Mind
      1. Supporting Several DTDs with XSLT
      2. Calling XSLT
      3. Which Structure for the Document?
      4. XSLT Versus Custom Functions
  14. 10 Modeling for Flexibility
    1. Structured and Extensible
      1. Limiting XML Extensibility
      2. Building on XML Extensibility (1/2)
      3. Building on XML Extensibility (2/2)
      4. Lessons Learned
    2. XLink
      1. Simple Links
      2. Extended Links
      3. XLink and Browsers
    3. Signature
    4. The Right Level of Abstraction
      1. Destructive and Nondestructive Transformations
      2. Mark It Up!
      3. Avoiding Too Many Options
    5. Attributes Versus Elements
      1. Using Attributes
      2. Using Elements
      3. Lessons Learned
  15. 11 N-Tiered Architecture and XML
    1. What Is an N-Tiered Application?
      1. Client/Server Applications
      2. 3-Tiered Applications
      3. N-Tiers
    2. The XCommerce Application
      1. Simplifications
      2. Shop
      3. XML Server
    3. How XML Helps
      1. Middleware
      2. Common Format
    4. XML for the Data Tiers
      1. Extensibility
      2. Scalability
      3. Versatility
    5. XML on the Middle Tier (1/2)
    6. XML on the Middle Tier (2/2)
      1. Client
    7. Server-Side Programming Language
      1. Perl
      2. JavaScript
      3. Python
      4. Omnimark
      5. Java
  16. 12 Putting It All Together: An e-Commerce Example
    1. Building XCommerce
      1. Classpath
      2. Configuration File
      3. Directories
      4. Compiling and Running
      5. URLs
      6. Database
    2. The Middle Tier (1/2)
    3. The Middle Tier (2/2)
      1. MerchantCollection
      2. Merchant (1/2)
      3. Merchant (2/2)
      4. Product
      5. Checkout (1/2)
      6. Checkout (2/2)
    4. Encapsulating XML Tools (1/3)
    5. Encapsulating XML Tools (2/3)
    6. Encapsulating XML Tools (3/3)
    7. The Data Tier (1/3)
    8. The Data Tier (2/3)
    9. The Data Tier (3/3)
    10. Viewer and Editor (1/3)
    11. Viewer and Editor (2/3)
    12. Viewer and Editor (3/3)
  17. Appendix A: Crash Course on Java
    1. Java in Perspective
      1. Server-Side Applications
      2. Components of the Server-Side Applications
    2. Downloading Java Tools
      1. Java Environment
      2. XML Components
      3. Servlet Engine
    3. Your First Java Application
      1. Flow of Control
      2. Variables
      3. Class
      4. Creating Objects
      5. Accessing Fields and Methods
      6. Static
      7. Method and Parameters
      8. Constructors
      9. Package
      10. Imports
      11. Access Control
      12. Comments and Javadoc
      13. Exception
    4. Servlets
    5. Your First Servlet
      1. Inheritance
      2. doGet()
    6. More Java Language Concepts
      1. This and Super
      2. Interfaces and Multiple Inheritance
      3. Understanding the Classpath
      4. JAR Files
      5. Java Core API
  18. Glossary
    1. A
    2. C
    3. D
    4. E
    5. H
    6. M
    7. N
    8. P
    9. R
    10. S
    11. T
    12. U
    13. W
    14. X
  19. Index
    1. A
    2. B
    3. C
    4. D
    5. E
    6. F
    7. G
    8. H
    9. I
    10. J
    11. K-L
    12. M
    13. N
    14. O
    15. P
    16. Q-R
    17. S
    18. T
    19. U
    20. V
    21. W
    22. X-Z

Product information

  • Title: XML by Example
  • Author(s): Benoît Marchal
  • Release date: December 1999
  • Publisher(s): Que
  • ISBN: 9780789722423