XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (2 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
9.13Mb size Format: txt, pdf, ePub

Summary

Chapter 11: XPath: Type Expressions

Converting Atomic Values

Sequence Type Descriptors

The
instance of
Operator

The
treat as
Operator

Summary

Chapter 12: XSLT Patterns

Patterns and Expressions

Changes in XSLT 2.0

The Formal Definition

An Informal Definition

Conflict Resolution

Matching Parentless Nodes

The Syntax of Patterns

Summary

Chapter 13: The Function Library

A Word about Naming

Functions by Category

Notation

Code Samples

Function Definitions

Summary

Chapter 14: Regular Expressions

Branches and Pieces

Quantifiers

Atoms

Subexpressions

Back-References

Character Groups

Character Ranges

Character Class Escapes

Character Blocks

Character Categories

Flags

Disallowed Constructs

Summary

Chapter 15: Serialization

The XML Output Method

The HTML Output Method

The XHTML Output Method

The Text Output Method

Using the declaration

Character Maps

Disable Output Escaping

Summary

Part III: Exploitation

Chapter 16: Extensibility

What Vendor Extensions Are Allowed?

Extension Functions

Keeping Extensions Portable

Summary

Chapter 17: Stylesheet Design Patterns

Fill-in-the-Blanks Stylesheets

Navigational Stylesheets

Rule-Based Stylesheets

Computational Stylesheets

Summary

Chapter 18: Case Study: XMLSpec

Formatting the XML Specification

Preface

Creating the HTML Outline

Formatting the Document Header

Creating the Table of Contents

Creating Section Headers

Formatting the Text

Producing Lists

Making Cross-References

Setting Out the Production Rules

Overlay Stylesheets

Stylesheets for Other Specifications

Summary

Chapter 19: Case Study: A Family Tree

Modeling a Family Tree

Creating a Data File

Displaying the Family Tree Data

Summary

Chapter 20: Case Study: Knight's Tour

The Problem

The Algorithm

Placing the Knight

Displaying the Final Board

Finding the Route

Running the Stylesheet

Observations

Summary

Part IV: Appendices

Appendix A: XPath 2.0 Syntax Summary

Whitespace and Comments

Tokens

Syntax Productions

Operator Precedence

Appendix B: Error Codes

Functions and Operators (FO)

XPath Errors (XP)

XSLT Errors (XT)

Appendix C: Backward Compatibility

Stage 1: Backward-Compatibility Mode

Stage 2: Setting version=“2.0”

Stage 3: Adding a Schema

Summary

Appendix D: Microsoft XSLT Processors

MSXML

System.Xml

Summary

Appendix E: JAXP: The Java API for Transformation

The JAXP Parser API

The JAXP Transformation API

Examples of JAXP Transformations

Summary

Appendix F: Saxon

Using Saxon from the Command Line

Using Saxon via JAXP Interfaces

Using Saxon from a .NET Application

Saxon Tree Models

Extensibility

Extensions

The evaluate() Extension

Summary

Appendix G: Altova

Running from within XMLSpy

Conformance

Extensions and Extensibility

The Command Line Interface

Using the API

Summary

Appendix H: Glossary

Index

Advertisement

XSLT 2.0 and XPath 2.0 Programmer's Reference 4th Edition

Published by

Wiley Publishing, Inc.

10475 Crosspoint Boulevard

Indianapolis, IN 46256

www.wiley.com

Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-0-470-19274-0

Library of Congress Cataloging-in-Publication Data is available from the publisher.

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
http://www.wiley.com/go/permissions
.

Limit of Liability/Disclaimer of Warranty:
The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Trademarks
: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

To Anyone Who Uses This Book

To Make the World a Better Place

About the Author

Michael Kay
has been working in the XML field since 1997; he became a member of the XSL Working Group soon after the publication of XSLT 1.0, and took over as editor of the XSLT 2.0 specification in early 2001. He is also a member of the XQuery and XML Schema Working Groups, and is a joint editor of the XPath 2.0 specification. He is well known not only through previous editions of this book but also as the developer of the open source Saxon product, a pioneering implementation of XSLT 2.0, XPath 2.0, and XQuery 1.0.

In 2004 the author formed his own company, Saxonica, to provide commercial software and services building on the success of the Saxon technology. Previously, he spent three years with Software AG, working with the developers of the Tamino XML server, an early XQuery implementation. His background is in database technology: after leaving the University of Cambridge with a Ph.D., he worked for many years with the (then) computer manufacturer ICL, developing network, relational, and object-oriented database software products as well as a text search engine, and held the position of ICL Fellow.

Michael lives in Reading, England, with his wife and daughter. His hobbies (reflected in his choice of examples) include genealogy and choral singing, and once included chess. Since completing the previous edition he has found time to improve his croquet handicap to 6.

Other books

Just a Family Affair by Veronica Henry
Black And Blue by Ian Rankin
Second Chance by Leighann Dobbs
Saturday by Ian McEwan
Flawed by Avelynn, Kate
El pequeño vampiro y la guarida secreta by Angela Sommer-Bodenburg
PS... You’re Mine by Alexa Riley
Forever Your Earl by Eva Leigh
Portal Combat by Bryan Cohen
Meat by Opal Carew