XSLT and XPATH : A Guide to XML Transformations

Overview

Gain total control over your information with XSLT and XPath!

  • Master XSLT and XPath—the "keys to the XML kingdom"
  • Build custom XML output solutions that won't become obsolete
  • Learn everything from basic XML-to-HTML conversions to leading edge techniques
  • CD-ROM includes all examples from the book

Mastering XSLT and XPath gives you ...

See more details below
Multimedia Set (BK&CD-ROM)
$40.49
BN.com price
(Save 10%)$44.99 List Price
Other sellers (Multimedia Set)
  • All (15) from $1.99   
  • New (4) from $28.84   
  • Used (11) from $1.99   
Sending request ...

Overview

Gain total control over your information with XSLT and XPath!

  • Master XSLT and XPath—the "keys to the XML kingdom"
  • Build custom XML output solutions that won't become obsolete
  • Learn everything from basic XML-to-HTML conversions to leading edge techniques
  • CD-ROM includes all examples from the book

Mastering XSLT and XPath gives you unprecedented control over your information—and helps you leverage virtually every new XML technology, from XLink to schemas. Discover XSLT's powerful vocabulary of easy, programming-like features, and learn how to build custom solutions that resist obsolescence. By the end of the first chapter, you'll be performing XML-to-HTML conversions for display in any Web browser. Then build on your knowledge through a series of hands-on examples that transform you into an XSLT/XPath expert!

  • XSLT as an XML document instance: leveraging your existing XML skills
  • XSLT stylesheet concepts and constructs: fundamental through advanced level
  • XPath patterns and functions
  • XSLT subroutine functions and variables
  • XSLT processing of multiple nodes: iterative and conditional XSLT elements
  • Controlling output options
  • XSLT extensions, and more

Whether you're an experienced programmer or a novice markup specialist, here's your chance to master XML's most potent tools for organizing, updating, and delivering digital information—any data, anywhere, any time!

Read More Show Less

Product Details

  • ISBN-13: 9780130404466
  • Publisher: Prentice Hall
  • Publication date: 8/28/2001
  • Series: Definitive Xml Series from Charles F. Go
  • Edition description: BK&CD-ROM
  • Pages: 588
  • Product dimensions: 7.00 (w) x 8.90 (h) x 1.20 (d)

Meet the Author

JOHN ROBERT GARDNER, Ph.D., is an Architect with Sun Microsystems, Inc., a leading provider of industrial-strength hardware, software, and services that power the Internet and B2B.

ZARELLA L. RENDON is Senior Applications Engineer and co-founder of ISOGEN International, a leading provider of XML and SGML solutions. She is a member of the W3C XSL Working Group.

Read More Show Less

Read an Excerpt

Preface

You've heard of

You've used HTML, and you know what a tag is; you know that it is somehow related to

There are many things you can use to process content once it is marked up using

XSLT is the power behind the throne of

XSLT is easy to use. In fact, XSLT itself is

XSLT attempts to be a bridge to nonprogrammers, bringing the easily understood syntax of

It is our belief-and our approach in writing this book-that both the experienced programmer and the newly trained markup technologist can become more comfortable with the potent set of tools for preserving, augmenting, updating, and delivering

If you are constantly wishing you had just a little more control over your information, this book will deliver that-and much more. In fact, by the end of the first chapter, you will be able to perform basic conversions from

When you read this book, have your computer handy. Take the time to load up one of the XSLT processors and work along as you read. Learning by doing is always best, especially with XSLT and XPath. Chapter 13 will show you how to install the software included on the CD. Each example in the book is found on the CD in the examples directory, organized by chapter.

XSLT is rewarding and creative to use. Be prepared to enjoy this learning experience. You will be surprised by how quickly productive use of this technology increases.

Why Should You Use XSLT?

Browsers display HTML, not general

XSLT lets you convert

XSLT provides quick, easy solutions to all

"This book, along with the proper tools, is what is required for

—Sharon Adler, Co-Chair W3C XSL Working Group

The latest version of XSLT (for which this book is written) is 1.0. There are many additional features that are being considered by the W3C XSL committee, and version 2.0 promises to add some of these new features, as well as provide support for

Who Is This Book For?

This book is for anyone who works with electronic data and wants to enable

Some people may find XSLT difficult because it is not a procedural programming language. Most programming languages have a very structured, concise syntax. The syntax of XSLT is

Some people may find XSLT difficult to use because it does not provide solutions to every transformation situation. For example, you cannot use XSLT to convert text to

Organization

The book is organized to build a base of knowledge that will be added to chapter by chapter. Basic XSLT concepts and a brief overview of

Chapter 1 provides everything you need to know about

Chapter 2 covers stylesheet concepts that are crucial to understanding XSLT, as well as general stylesheet terminology.

Chapter 3 adds more concepts, a little more explanation and usage, and an in-depth study of templates to the basics covered in Chapters 1 and 2.

Chapter 4 defines and explains XPath expressions and patterns.

Chapter 5 covers XPath functions, which are crucial to using most of the elements in XSLT.

Chapter 6 walks through the creation of new

Chapter 7 discusses the use of multiple stylesheets by including and importing them, as well as a discussion on template priority.

Chapter 8 shows how to work with variables and parameters.

Chapter 9 covers anything that is in some way iterative or conditional, as well as the utilities required to copy

Chapter 10 details the options for controlling output types, as well as stripping and preserving whitespace, and generating error messages.

Chapter 11 covers XSLT functions and their related elements, including importing external

.

Chapter 12 discusses extensions, processors, and Java, as well as three "commercial" XSLT processors.

Chapter 13 describes three "freeware" processors: Xalan, Saxon, and XT, along with installation instructions and extension implementations.

There are three appendices that cover a variety of topics and case studies, as well as contributed material.

Versions

This book is written according to XSL Transformations (XSLT) Version 1.0,

The version of James Clarks' XT used for the tests in this book is 19991105. The version of Michael Kay's Saxon used is 6.2.2.

Read More Show Less

Table of Contents

Preface
Acknowledgments
1 Anatomy of an XSLT Stylesheet 2
2 Fundamental Concepts of XSLT Stylesheets 24
3 Advanced Stylesheet Concepts 44
4 XPath Expressions 78
5 Xpath Functions 112
6 Building New XML Documents with XSLT 188
7 Using Multiple Stylesheets 224
8 Working with Variables 250
9 Duplication, Iteration, and Conditional XSLT Elements 270
10 Controlling Output Options 316
11 XSLT Functions and Related XSLT Elements 346
12 XSLT Processors, Extensions, and Java 390
13 Xalan, Saxon, and XT 418
App. A: Case Studies 481
App. B Grouping Using the Muenchian Method 523
App. C Using XSLT for the Artificial Intelligence "N-Queens" Problem 527
Index 543
Read More Show Less

Preface

Preface

You've heard of XML; your manager wants you to use it in your applications. Now what?

You've used HTML, and you know what a tag is; you know that it is somehow related to XML. You may even know what XML is and what it does. What you may not know is that, while XML identifies and adds structure to the content of a document, it does not tell you anything about how to process that content, or how to do anything useful with it beyond storage. This is good news, because this means your content can be used for many different purposes.

There are many things you can use to process content once it is marked up using XML. However, we have chosen to talk about the only standard application that allows you to do many different things with it. With XSLT, you can add style to XML, convert it to other XML, or simply chop it up and regenerate it in a different form.

XSLT is the power behind the throne of XML. It assures that every level of every piece of XML data is accessible and reusable across platforms and forward in time. It is not an exaggeration to say that XSLT and its companion XPath are the very glue and mortar that hold together and build the endlessly varying applications of markup data for any industry, academy, or individual. XSLT is the fastest cure for the fear of having obsolescence in a data or information architecture design.

XSLT is easy to use. In fact, XSLT itself is XML. XSLT "speaks the language," or the syntax, of XML with a powerful vocabulary of programming-like features that are nonetheless easy to use, learn, and understand.

XSLT attempts to be a bridge to nonprogrammers, bringing the easily understood syntax of XML together with a powerful scripting mechanism and simple pathing approach to document navigation.

It is our belief-and our approach in writing this book-that both the experienced programmer and the newly trained markup technologist can become more comfortable with the potent set of tools for preserving, augmenting, updating, and delivering XML data-whether it's on the Web or your corporation's intranet or B2B.

If you are constantly wishing you had just a little more control over your information, this book will deliver that-and much more. In fact, by the end of the first chapter, you will be able to perform basic conversions from XML documents to HTML that will display in any Web browser. Subsequent chapters build upon and enhance that base of knowledge, matching examples with detailed explanations and providing focus upon commonly misunderstood areas.

When you read this book, have your computer handy. Take the time to load up one of the XSLT processors and work along as you read. Learning by doing is always best, especially with XSLT and XPath. Chapter 13 will show you how to install the software included on the CD. Each example in the book is found on the CD in the examples directory, organized by chapter.

XSLT is rewarding and creative to use. Be prepared to enjoy this learning experience. You will be surprised by how quickly productive use of this technology increases.

Why Should You Use XSLT?

Browsers display HTML, not general XML tags. You have to do something with the XML once you have it. Can you print with XML? Can you send XML to the Web? Can you browse XML? Yes, but not alone.

XSLT lets you convert XML to HTML, other types of XML or just plain text. With a little creativity, and the proper knowledge of XSLT, you can generate practically any form of output from XML.

XSLT provides quick, easy solutions to all XML transformation issues. However, the designers of XSLT did not intend for you to use the specification without additional help.

"This book, along with the proper tools, is what is required for XML to succeed with the average business application."

—Sharon Adler, Co-Chair W3C XSL Working Group

The latest version of XSLT (for which this book is written) is 1.0. There are many additional features that are being considered by the W3C XSL committee, and version 2.0 promises to add some of these new features, as well as provide support for XML Schema, XML Query, and others.

Who Is This Book For?

This book is for anyone who works with electronic data and wants to enable XML transformations without a difficult programming language learning curve. If you are comfortable working with SGML, XML, or even HTML, you will benefit greatly from the common markup syntax.

Some people may find XSLT difficult because it is not a procedural programming language. Most programming languages have a very structured, concise syntax. The syntax of XSLT is XML and is designed to be human readable and easily understandable. You must have some knowledge of markup before using XSLT.

Some people may find XSLT difficult to use because it does not provide solutions to every transformation situation. For example, you cannot use XSLT to convert text to XML. There are situations when additional processing may be required. However, for most of your day-to-day XML transformations, XSLT is the tool of choice.

Organization

The book is organized to build a base of knowledge that will be added to chapter by chapter. Basic XSLT concepts and a brief overview of XML are covered in Chapter 1. The remainder of the chapters add functionality as required when creating stylesheets. The more complex the problem, the later it is covered.

Chapter 1 provides everything you need to know about XML and XSLT in a nutshell. This chapter gives a good overview with minimum syntax, and can be used by people at any level of markup experience as a review or for general information.

Chapter 2 covers stylesheet concepts that are crucial to understanding XSLT, as well as general stylesheet terminology.

Chapter 3 adds more concepts, a little more explanation and usage, and an in-depth study of templates to the basics covered in Chapters 1 and 2.

Chapter 4 defines and explains XPath expressions and patterns.

Chapter 5 covers XPath functions, which are crucial to using most of the elements in XSLT.

Chapter 6 walks through the creation of new XML elements and attributes using several different methods.

Chapter 7 discusses the use of multiple stylesheets by including and importing them, as well as a discussion on template priority.

Chapter 8 shows how to work with variables and parameters.

Chapter 9 covers anything that is in some way iterative or conditional, as well as the utilities required to copy XML from the input to the output.

Chapter 10 details the options for controlling output types, as well as stripping and preserving whitespace, and generating error messages.

Chapter 11 covers XSLT functions and their related elements, including importing external XML documents with the document() function, and using keys with .

Chapter 12 discusses extensions, processors, and Java, as well as three "commercial" XSLT processors.

Chapter 13 describes three "freeware" processors: Xalan, Saxon, and XT, along with installation instructions and extension implementations.

There are three appendices that cover a variety of topics and case studies, as well as contributed material.

Versions

This book is written according to XSL Transformations (XSLT) Version 1.0, XML Path Language (XPath) Version 1.0, and Extensible Markup Language (XML) 1.0. Additional reference material came from Namespaces in XML REC-xml-names-19990114.

The version of James Clarks' XT used for the tests in this book is 19991105. The version of Michael Kay's Saxon used is 6.2.2.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 3 Customer Reviews
  • Anonymous

    Posted September 2, 2002

    The real Guide!

    It's not absolutly complete but it's a fine book. You can get the most out of it! XML, XSLT, and XPATh are the new world to web. Try it!

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted February 5, 2002

    Not worth buying

    I bought this book because I thought it would cover xslt deaply, but I was wrong. The script in this book is very large and what could be said in one page, it takes at least 10 explaining the most basic things which are not needed. It looks like it's doing that to provide a big book. I was very disappointed and I ordered a different book. Don't make the same mistake I did.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 18, 2001

    A must read. A practical guide for the beginner as well as for the seasoned developer.

    <P>I HAVE read this book. In fact, I am still reading it. It is well written and well structured. The subject matter is clear and concise. It discusses the key subjects necessary to master XML transformations. The contributions from industry experts of several corporations and associations, such as the W3C, make it a well rounded syllabus. <P>The title is what initially drew me to this book. Why? I was thrown into the thick of things developing an XSLT based Web site templating engine. My first XSLT book was Wrox's XSLT Programmer's Reference. Although I found the syntactical information I needed to craft the templates of the XSLT stylesheet, I was missing the answers to some recurring questions: how do I effectively navigate the source XML document? how do I extract the desired node-set? <P>From my previous hands-on XSLT experience, it quickly became evident how important it was to master XPath. Learning how to effectively write a rule set and optimize a style sheet requires a good understanding of how to navigate an XML document. <P>This is a good book to introduce newcomers to the world of XSLT transformations as it is a good book for knowledgeable XSLT developers to further refine their template design and coding skills. <P>This book lays a solid foundation to begin coding XSLT style sheets. It builds upon this foundation by expanding on more complex subjects in subsequent chapters. I also find it to be a useful reference. I've typically found what I was looking for using the detailed index. <P>I was taken aback by one of the appendices, which reveals the true power of XSLT, solving the classic 'N-Queens' AI problem via an XSLT stylesheet! <P>I'm quite happy to have purchased this title, and if I were to have the choice of only one book on XSLT this would be the book.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 3 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)