Skip to main content


Beginning XML, 5th Edition

Joe Fawcett, Danny Ayers, Liam R. E. Quin

ISBN: 978-1-118-16213-2 July 2012 864 Pages


A complete update covering the many advances to the XML language

The XML language has become the standard for writing documents on the Internet and is constantly improving and evolving. This new edition covers all the many new XML-based technologies that have appeared since the previous edition four years ago, providing you with an up-to-date introductory guide and reference. Packed with real-world code examples, best practices, and in-depth coverage of the most important and relevant topics, this authoritative resource explores both the advantages and disadvantages of XML and addresses the most current standards and uses of XML.

  • Features the most updated content built on audience feedback from the previous edition as well as the vast knowledge from XML developer teams
  • Boasts new chapters on RELAX NG and Schematron, XML functionality in databases, LINQ to XML, Jabber and XMLPP, XHTML, HTML5, and more
  • Offers in-depth coverage on extracting data from XML and updated material on Web Services

Beginning XML, Fifth Edition delivers the most important aspects of XML in regard to what it is, how it works, what technologies surround it, and how it can best be used in a variety of situations.

Related Resources

Introduction xxvii

Part I: Introducing XML

Chapter 1: What is XML? 3

Steps Leading up to XML: Data Representation and Markups 4

The Birth of XML 6

More Advantages of XML 10

XML in Practice 13

Summary 23

Chapter 2: Well-Formed XML 25

What Does Well-Formed Mean? 26

Creating XML in a Text Editor 26

Advanced XML Parsing 40

The XML Infoset 47

Summary 50

Chapter 3: XML Namespaces 53

Defining Namespaces 54

Why Do You Need Namespaces? 54

How Do You Choose a Namespace? 56

How to Declare a Namespace 58

Namespace Usage in the Real World 68

When to Use and Not Use Namespaces 72

Common Namespaces 75

Summary 78

Part II: Validation

Chapter 4: Document Type Definitions 83

What Are Document Type Definitions? 83

Anatomy of a DTD 93

DTD Limitations 114

Summary 114

Chapter 5: XML Schemas 117

Benefits of XML Schemas 118

XML Schemas in Practice 120

Defining XML Schemas 124

Creating a Schema from Multiple Documents 161

Documenting XML Schemas 167

XML Schema 1.1 170

Summary 171

Chapter 6: RELAX NG and Schematron 175

Why Do You Need More Ways of Validating XML? 176

Setting Up Your Environment 176

Using RELAX NG 177

Using Schematron 193

Summary 207

Part III: Processing

Chapter 7: Extracting Data from XML 211

Document Models: Representing XML in Memory 211

The XPath Language 216

Summary 236

Chapter 8: XSLT 239

How Is XSLT a Functional Language? 242

Setting Up Your XSLT Development Environment 242

Foundational XSLT Elements 245

Reusing Code in XSLT 276

Understanding Built-In Templates and Built-In Rules 282

Using XSLT 2.0 284

XSLT and XPath 3.0: What’s Coming Next? 302

Summary 303

Part IV: Databases

Chapter 9: XQuery 307

XQuery, XPath, and XSLT 308

XQuery in Practice 309

Building Blocks of XQuery 313

The Anatomy of a Query Expression 318

Some Optional XQuery Features 332

Coming in XQuery 3.0 333

Summary 338

Chapter 10: XML and Databases 341

Understanding Why Databases Need to Handle XML 341

Analyzing which XML Features are Needed in a Database 343

Using MySQL with XML 345

Using SQL Server with XML 355

Using eXist with XML 386

Summary 399

Part V: Programming

Chapter 11: Event-Driven Programming 403

Understanding Sequential Processing 404

Using SAX in Sequential Processing 404

Using XmlReader 434

Summary 448

Chapter 12: LINQ to XML 451

What Is LINQ? 451

Creating Documents 457

Extracting Data from an XML Document 461

Modifying Documents 468

Transforming Documents 472

Using VB.NET XML Features 474

Summary 480

Part VI: Communication

Chapter 13: RSS, Atom, and Content Syndication 485

Syndication 485

Working with News Feeds 501

A Simple Aggregator 502

Transforming RSS with XSLT 524

Useful Resources 534

Summary 535

Chapter 14: Web Services 539

What Is an RPC? 539

RPC Protocols 541

The New RPC Protocol: Web Services 543

The Web Services Stack 564

Summary 569

Chapter 15: SOAP and WSDL 573

Laying the Groundwork 574

The New RPC Protocol: SOAP 574

Defining Web Services: WSDL 600

Summary 612

Chapter 16: AJAX 615

AJAX Overview 615

Introduction to JavaScript 617

The XMLHttp Request Function 623

Using HTTP Methods with AJAX 628

Accessibility Considerations 629

The jQuery Library 630

JSON and AJAX 635

The Web Sever Back End 637

A Larger Example 639

Summary 644

Part VII: Display

Chapter 17: XHTML and HTML 5 649

Background of SGML 650

The Open Web Platform 651

Introduction to XHTML 652

XHTML and HTML: Problems and Workarounds 669

Cascading Style Sheets (CSS) 670

Unobtrusive JavaScript 682

HTML 5 683

Summary 686

Chapter 18: Scalable Vector Graphics (SVG) 689

Scalable Vector Graphics and Bitmaps 689

The SVG Graphics Model 694

SVG and CSS 696

SVG Tools 698

SVG Basic Built-in Shapes 700

SVG Transforms and Groups 708

SVG Definitions and Metadata 709

Viewports and Coordinates 712

SVG Colors and Gradients 713

Including Bitmap Images in SVG 715

SVG Text and Fonts 716

SVG Animation Four Ways 717

SVG and HTML 5 720

SVG and Web Apps 721

Making SVG with XQuery or XSLT 722

Resources 722

Summary 723

Part VIII: Case Study

Chapter 19: Case Study: XML in Publishing 727

Background 727

Project Introduction: Current Workflow 728

Introducing a New XML-Based Workflow 728

Creating a New Process 730

Some Technical Aspects 733

The Hoy Books Website 741

Summary 746

Appendix A: Answers to Exercises 749

Appendix B: XPATH Functions 773

Appendix C: XML Schema Data Types 797

Index 811

ReadMe File
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
contacts6.xml file was updated on 8/21/13.
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
ChapterPageDetailsDatePrint Run
5152-153Error in Code
Currently reads:
<?xml version=?1.0??>
 xsi:schemaLocation=? contacts6.xsd?>
<contacts source=?Beginning XML 5E? version=?1.0?>
<contact person=?Joe_Fawcett? tags=?author xml poetry?>

Should read:
<?xml version="1.0"?>
<contacts source="Beginning XML 5E" version="1.0"
  xsi:schemaLocation=" contacts6.xsd">
  <contact person="Joe_Fawcett" tags="author xml poetry">

35Text Correction
Page: 35
Line 11 after the table reads &937#; in decimal.
Yet, line 8 explains "They begin with &#."
And line 20 has another example in decimal written