| Acknowledgements | xvii |
| Introduction | xix |
| PART I XML ESSENTIALS | |
| 1 Introducing XML | 3 |
| XML Basics | 3 |
| Using XML | 5 |
| Extensions to XML | 6 |
| XLink and XPointer | 6 |
| XSL | 6 |
| XML Namespaces | 7 |
| XML Schema | 7 |
| XPath | 7 |
| Creating XML-Based Solutions | 7 |
| Authoring Tools | 8 |
| Application Development Environments | 8 |
| Database and Data Integration Solutions | 8 |
| 2 XML Document Structure | 9 |
| XML Naming Rules | 9 |
| Working with Root, Parent, and Child Elements | 10 |
| Understanding Root Elements | 10 |
| Understanding Parent and Child Elements | 11 |
| Nesting Parent and Child Elements | 11 |
| Adding Root Elements to Documents | 11 |
| Defining XML Elements and Tags | 12 |
| Using Elements with Beginning and Ending Tags | 12 |
| Using Empty Elements | 13 |
| Using XML Attributes | 15 |
| Defining Attributes | 15 |
| When to Use Attributes | 16 |
| Adding Attributes to Elements | 17 |
| Working with Entity References, Character Data, Comments, and Processing Instructions | 17 |
| Using Predefined Entity References | 17 |
| Using Character Data Sections | 19 |
| Using Comments | 20 |
| Using Processing Instructions | 21 |
| Specifying XML Declarations | 21 |
| Using the Version Attribute | 22 |
| Using the Encoding Attribute | 22 |
| Using the Standalone Attribute | 23 |
| Creating Well-Formed Documents | 23 |
| PART II DTDS AND NAMESPACES | |
| 3 Creating DTDs | 27 |
| Understanding DTDs | 27 |
| Working with Internal DTDs | 29 |
| Declaring Internal DTDs | 29 |
| Adding Internal DTDs to Documents | 32 |
| Working with External DTDs | 32 |
| Declaring Public External DTDs | 32 |
| Adding Public External DTDs to Documents | 34 |
| Declaring Nonpublic External DTDs | 35 |
| Adding Nonpublic DTDs to Documents | 35 |
| Resolving Errors with Externally Referenced DTDs | 36 |
| Combining Internal and External DTDs | 36 |
| Adding Internal and External DTDs to Documents | 37 |
| Writing External DTD Files | 38 |
| 4 XML Elements in DTDs | 41 |
| Defining Elements in DTDs | 41 |
| Declaring Elements with Standard Content | 42 |
| Declaring Elements with Character Data Only | 43 |
| Declaring Elements with Mixed Content | 44 |
| Declaring Elements with Any Content Allowed | 45 |
| Declaring Elements with No Content Allowed | 46 |
| Structuring Elements | 47 |
| Understanding Element Order Indicators and Qualifiers | 47 |
| Specifying Sequences | 49 |
| Specifying Choices | 51 |
| Specifying Groups | 51 |
| Specifying the Number of Child Elements | 53 |
| 5 XML Attributes in DTDs | 57 |
| Defining Attributes in DTDs | 57 |
| Making Attribute Assignments | 57 |
| Specifying Attribute Names, Types, and Default Usages | 58 |
| Assigning Values to Attributes in DTDs | 62 |
| Declaring Standard Attribute Types in DTDs | 63 |
| Defining CDATA Attribute Types | 64 |
| Restricting Attribute Values Using Name Tokens | 64 |
| Defining Enumerated Attribute Types | 66 |
| Defining Attributes with Unique Values | 67 |
| Referencing Attributes with Unique Values | 68 |
| 6 XML Entities and Notations in DTDs | 73 |
| Getting Started with Entities and Notations | 73 |
| Working with General Entities in DTDs | 76 |
| Using Internal General Entities | 76 |
| Using External Parsed General Entities | 79 |
| Using External Unparsed General Entities | 81 |
| Working with Parameter Entities in DTDs | 86 |
| Using Internal Parameter Entities | 86 |
| Using External Parameter Entities | 88 |
| Using Encoded Characters | 89 |
| Setting Language Encoding with xml:lang | 89 |
| Declaring the xml:lang Attribute for Validated Documents | 89 |
| Specifying Character References | 90 |
| Creating Entities to Reference Characters | 91 |
| 7 XML Namespaces | 93 |
| Understanding Namespaces | 93 |
| Creating Namespaces | 96 |
| Declaring Namespaces | 96 |
| Associating URIs with Namespaces | 99 |
| Setting Default Namespaces | 102 |
| Using Namespaces with DTDs | 104 |
| Using Namespaces with Elements in DTDs | 104 |
| Using Namespaces with Attributes in DTDs | 105 |
| Declaring xmlns Attributes | 105 |
| PART III XML SCHEMAS | |
| 8 XML Schemas | 109 |
| Getting Started with Schemas | 109 |
| Understanding Simple and Complex Types | 110 |
| Understanding Local and Global Declarations | 111 |
| Working with Basic Schemas | 112 |
| Creating a Basic Schema Document | 112 |
| Associating the Schema with an XML Document | 116 |
| Adding Documentation to Schemas | 120 |
| Adding Comments to Schemas | 121 |
| Using Targeted Namespaces with Schemas | 122 |
| Targeting Namespaces: The Essentials | 122 |
| Adding Elements to Target Namespaces | 127 |
| Adding Attributes to Target Namespaces | 128 |
| Referencing Components with Namespaces | 128 |
| Including and Importing Schemas | 129 |
| Including Multiple Schema Files | 129 |
| Importing Multiple Schema Files | 131 |
| 9 Defining Simple Types in Schema | 133 |
| Making Simple Element and Attribute Declarations | 134 |
| Declaring Simple Elements with Character Content | 134 |
| Declaring Default and Fixed Values for Simple Elements | 136 |
| Declaring Simple Empty Elements | 137 |
| Declaring Simple Attributes | 138 |
| Declaring Default and Fixed Values for Simple Attributes | 140 |
| Creating Optional, Required, and Prohibited Simple Attributes | 141 |
| Creating Simple Types | 142 |
| Using Values Derived by Restriction | 142 |
| Using Values Derived by List | 148 |
| Using Values Derived by Union | 151 |
| 10 Specifying Datatypes and Restrictions in Schema | 155 |
| Using String and Name Datatypes | 155 |
| Defining a string Datatype | 156 |
| Defining a normalizedString Datatype | 156 |
| Defining a token Datatype | 156 |
| Defining Other string Datatypes | 157 |
| Using Date and Time Datatypes | 159 |
| Using the duration Datatype | 159 |
| Using the dateTime Datatype | 161 |
| Using the time Datatype | 163 |
| Using the date Datatype | 163 |
| Using the gYear, gYearMonth, gMonthDay, gMonth, and gDay Datatypes | 164 |
| Using Numeric Datatypes | 165 |
| Working with the Decimal Datatype and Its Derivatives | 165 |
| Working with Floating-Point Datatypes | 168 |
| Using Other Datatypes | 171 |
| Using boolean Datatypes | 171 |
| Using Binary Datatypes | 172 |
| Using URI Datatypes | 172 |
| Controlling Acceptable Values | 173 |
| Specifying a Set of Acceptable Values | 173 |
| Specifying Expressions for Acceptable Values | 175 |
| Specifying Acceptable Whitespace Characters | 179 |
| Specifying a Range of Acceptable Values | 180 |
| Limiting the Length of Values | 182 |
| Limiting the Number of Digits | 184 |
| 11 Defining Complex Types in Schema | 187 |
| Working with Complex Types | 187 |
| Declaring Elements with Named Complex Types | 188 |
| Declaring Elements with Anonymous Complex Types | 189 |
| Basing Complex Types on Complex Types | 190 |
| Defining Content for Complex Elements | 193 |
| Defining Complex Elements with Standard Content | 193 |
| Defining Complex Elements with Mixed Content | 196 |
| Defining Complex Elements with Text-Only Content | 197 |
| Defining Complex Elements with No Content | 200 |
| Structuring Complex Elements in Schemas | 201 |
| Specifying Sequences | 202 |
| Specifying Choices | 205 |
| Allowing Elements to Appear in Any Order | 208 |
| Controlling Element Occurrence | 210 |
| Using Groups and References | 213 |
| Defining and Referencing Element Groups | 213 |
| Defining and Referencing Attribute Groups | 215 |
| Referencing Globally Declared Elements | 218 |
| 12 Content Models for Schema Declarations | 219 |
| all Definitions | 220 |
| annotation Definitions | 220 |
| any Definitions | 221 |
| anyAttribute Definitions | 221 |
| attribute Definitions | 221 |
| attributeGroup Definitions and References | 222 |
| choice Definitions | 222 |
| complexType Definitions | 223 |
| Complex Type with Simple Content | 223 |
| Complex Type with Complex Content | 224 |
| element Definitions | 225 |
| Element group Definitions and References | 226 |
| import Definitions | 226 |
| include Definitions | 226 |
| notation Definitions | 227 |
| schema Definitions | 228 |
| selector and field Definitions | 228 |
| sequence Definitions | 229 |
| simpleType Definitions | 229 |
| unique Constraint Definitions | 230 |
| PART IV XSLT AND XPATH | |
| 13 XSL Transformations and Formatting | 235 |
| Introducing XSLT | 235 |
| Matching Document Structures to Template Rules | 239 |
| Understanding the Built-In Template for Element and Root Nodes | 241 |
| Understanding the Built-In Template for Modes | 241 |
| Understanding the Built-In Template for Text and Attribute Nodes | 242 |
| Understanding Other Built-In Templates | 242 |
| Structuring XSLT Stylesheets | 243 |
| Starting the XSLT Stylesheet | 243 |
| Defining the Output Format | 244 |
| Defining Template Rules and Declarations | 258 |
| 14 XPath Operators and Expressions | 263 |
| Understanding Location Paths | 264 |
| Understanding XPath Operators and Datatypes | 268 |
| Using Relative XPath Expressions with Elements | 272 |
| Referencing the Current Context Node | 272 |
| Referencing a Parent Node | 273 |
| Referencing Siblings Relative to the Current Context | 274 |
| Referencing Child Nodes | 274 |
| Using Absolute XPath Expressions with Elements | 276 |
| Locating Attribute, Text, Comment, and Processing Instruction Nodes | 277 |
| Working with Attribute Nodes | 277 |
| Working with Text Nodes | 280 |
| Working with Comment Nodes | 280 |
| Working with Processing Instruction Nodes | 281 |
| Using Namespaces with Element and Attribute Nodes | 282 |
| Using Wildcards and Predicates in XPath Expressions | 283 |
| Selecting Any Node | 284 |
| Skipping Levels in the Hierarchy | 285 |
| Filtering to Match Nodes with Specific Values | 287 |
| 15 Branching and Control Functions | 291 |
| Processing Nodes Conditionally with if Statements | 291 |
| Processing Nodes Conditionally with choose-when and choose-when-otherwise Statements | 294 |
| Processing Multiple Nodes with for-each Statements | 296 |
| Invoking, Including, and Importing Templates | 300 |
| Including and Importing Templates | 300 |
| Calling Templates by Name | 303 |
| Invoking Templates by Mode | 304 |
| 16 Variables and Parameters in XSLT | 307 |
| Working with Parameters | 307 |
| Defining and Referencing Parameters | 307 |
| Setting Default Values for Parameters | 309 |
| Passing Parameter Values to Templates | 311 |
| Using Global Parameters | 312 |
| Working with Variables | 318 |
| Defining Variables | 318 |
| Referencing Variables | 320 |
| Using Global Variables | 321 |
| 17 Working with Strings, Booleans and Numbers | 323 |
| Manipulating Strings | 323 |
| Converting Values to Strings | 323 |
| Managing Spaces Within Strings | 325 |
| Normalizing Space in Strings | 327 |
| Merging Values into a Single String | 328 |
| Examining and Manipulating String Contents | 329 |
| Translating Characters in Strings | 336 |
| Converting and Manipulating Boolean Values | 337 |
| Using the true() Function | 339 |
| Using the false() Function | 339 |
| Using the not() Function | 339 |
| Working with Numeric Values | 340 |
| Converting Values to Numbers | 340 |
| Formatting Values as Numbers | 341 |
| Rounding Numbers | 345 |
| Summing Values | 346 |
| 18 Restructuring Input Documents and Manipulating Document Subsets | 351 |
| Combining and Merging Documents | 351 |
| Document Merging Essentials | 351 |
| Using Base Paths with the document() Function | 354 |
| Using the document() Function To Process the Stylesheet Itself | 356 |
| Declaring the document() Function in a Stylesheet | 357 |
| Manipulating Document Structures | 358 |
| Creating Copies of Node Sets | 358 |
| Generating Elements and Attributes in the Output | 361 |
| Sorting Document Structures | 366 |
| Sorting Essentials | 366 |
| Defining Sort Keys, Order, and Type | 367 |
| Sorting Nodes in a Document | 371 |
| Counting Nodes | 371 |
| INDEX | 375 |