XSLT 2.0 and XPath 2.0 Programmer's Reference, 4/e
暫譯: XSLT 2.0 與 XPath 2.0 程式設計師參考手冊,第4版
Michael Kay
- 出版商: Wrox Press
- 出版日期: 2008-04-01
- 售價: $3,000
- 貴賓價: 9.5 折 $2,850
- 語言: 英文
- 頁數: 1368
- 裝訂: Hardcover
- ISBN: 0470192747
- ISBN-13: 9780470192740
-
相關分類:
XML
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
$3,630$3,449 -
$650$514 -
$1,340$1,273 -
$399Professional XML
-
$299Beginning XML, 4/e (Paperback)
-
$1,540XSLT, 2/e (Paperback)
-
$450$383 -
$780$663 -
$580$458 -
$650$514 -
$750$638 -
$540$421 -
$1,630$1,549 -
$750$593 -
$299$236 -
$450$351 -
$480$408 -
$850$723 -
$750$593 -
$520$411 -
$580$458 -
$948Single Page Web Applications: JavaScript end-to-end (Paperback)
-
$1,307Making Java Groovy (Paperback)
-
$1,742Java Network Programming, 4/e (Paperback)
-
$1,197Java Web Services: Up and Running, 2/e (Paperback)
商品描述
The book does assume a basic knowledge of XML, HTML, and the architecture of the Web, and it is written for experienced programmers. There’s no assumption that you know any particular language such as Java or Visual Basic, just that you recognize the concepts that all programming languages have in common.
The book is suitable both for XSLT 1.0 users upgrading to XSLT 2.0, and for newcomers to XSLT. The book is also equally suitable whether you work in the Java or .NET world.
As befits a reference book, a key aim is that the coverage should be comprehensive and authoritative. It is designed to give you all the details, not just an overview of the 20 percent of the language that most people use 80 percent of the time. It’s designed so that you will keep coming back to the book whenever you encounter new and challenging programming tasks, not as a book that you skim quickly and then leave on the shelf. If you like detail, you will enjoy this book; if not, you probably won’t.
But as well as giving the detail, this book aims to explain the concepts, in some depth. It’s therefore a book for people who not only want to use the language but who also want to understand it at a deep level.
The book aims to tell you everything you need to know about the XSLT 2.0 language. It gives equal weight to the things that are new in XSLT 2.0 and the things that were already present in version 1.0. The book is about the language, not about specific products. However, there are appendices about Saxon (the author’s own implementation of XSLT 2.0), about the Altova XSLT 2.0 implementation, and about the Java and Microsoft APIs for controlling XSLT transformations, which will no doubt be upgraded to handle XSLT 2.0 as well as 1.0. A third XSLT 2.0 processor, Gestalt, was released shortly before the book went to press, too late to describe it in any detail. But the experience of XSLT 1.0 is that there has been a very high level of interoperability between different XSLT processors, and if you can use one of them, then you can use them all.
In the previous edition we split XSLT 2.0 and XPath 2.0 into separate volumes. The idea was that some readers might be interested in XPath alone. However, many bought the XSLT 2.0 book without its XPath companion and were left confused as a result; so this time, the material is back together. The XPath reference information is in self-contained chapters, so it should still be accessible when you use XPath in contexts other than XSLT.
The book does not cover XSL Formatting Objects, a big subject in its own right. Nor does it cover XML Schemas in any detail. If you want to use these important technologies in conjunction with XSLT, there are other books that do them justice.
This book contains twenty chapters and eight appendixes (the last of which is a glossary) organized into four parts. The following section outlines what you can find in each part, chapter, and appendix.
Part I: Foundations: The first part of the book covers essential concepts. You should read these before you start coding. If you ignore this advice, as most people do, then you read them when you get to that trough of despair when you find it impossible to make the language do anything but the most trivial tasks. XSLT is different from other languages, and to make it work for you, you need to understand how it was designed to be used.
Chapter 1: XSLT in Context: This chapter explains how XSLT fits into the big picture: how the language came into being and how it sits alongside other technologies. It also has a few simple coding examples to keep you alert.
Chapter 2: The XSLT Processing Model: This is about the architecture of an XSLT processor: the inputs, the outputs, and the data model. Understanding the data model is perhaps the most important thing that distinguishes an XSLT expert from an amateur; it may seem like information that you can’t use immediately, but it’s knowledge that will stop you making a lot of stupid mistakes.
Chapter 3: Stylesheet Structure: XSLT development is about writing stylesheets, and this chapter takes a bird’s eye view of what stylesheets look like. It explains the key concepts of rule-based programming using templates, and explains how to undertake programming-in-the-large by structuring your application using modules and pipelines.
Chapter 4: Stylesheets and Schemas: A key innovation in XSLT 2.0 is that stylesheets can take advantage of knowledge about the structure of your input and output documents, provided in the form of an XML Schema. This chapter provides a quick overview of XML Schema to describe its impact on XSLT development. Not everyone uses schemas, and you can skip this chapter if you fall into that category.
Chapter 5: The Type System: XPath 2.0 and XSLT 2.0 offer strong typing as an alternative to the weak typing approach of the 1.0 languages. This means that you can declare the types of your variables, functions, and parameters, and use this information to get early warning of programming errors. This chapter explains the data types available and the mechanisms for creating user-defined types.
Part II: XSLT and XPath Reference: This section of the book contains reference material, organized in the hope that you can easily find what you need when you need it. It’s not designed for sequential reading, though you might well want to leaf through the pages to discover what’s there.
Chapter 6: XSLT Elements: This monster chapter lists all the XSLT elements you can use in a stylesheet, in alphabetical order, giving detailed rules for the syntax and semantics of each element, advice on usage, and examples. This is probably the part of the book you will use most frequently as you become an expert XSLT user. It’s a “no stone unturned” approach, based on the belief that as a professional developer you need to know what happens when the going gets tough, not just when the wind is in your direction.
Chapter 7: XPath Fundamentals: This chapter explains the basics of XPath: the low-level constructs such as literals, variables, and function calls. It also explains the context rules, which describe how the evaluation of XPath expressions depends on the XSLT processing context in which they appear.
Chapter 8: XPath: Operators on Items: XPath offers the usual range of operators for performing arithmetic, boolean comparison, and the like. However, these don’t always behave exactly as you would expect, so it’s worth reading this chapter to see what’s available and how it differs from the last language that you used.
Chapter 9: XPath: Path Expressions: Path expressions are what make XPath special; they enable you to navigate around the structure of an XML document. This chapter explains the syntax of path expressions, the 13 axes that you can use to locate the nodes that you need, and associated operators such as union, intersection, and difference.
Chapter 10: XPath: Sequence Expressions: Unlike XPath 1.0, in version 2.0 all values are sequences (singletons are just a special case). Some of the most important operators in XPath 2.0 are those that manipulate sequences, notably the «for»
expression, which translates one sequence into another by applying a mapping.
Chapter 11: XPath: Type Expressions: The type system was explained in Chapter 5; this chapter explains the operations that you can use to take advantage of types. This includes the «cast»
operation which is used to convert values from one type to another.A big part of this chapter is devoted to the detailed rules for how these conversions are done.
Chapter 12: XSLT Patterns: This chapter returns from XPath to a subject that’s specific to XSLT. Patterns are used to define template rules, the essence of XSLT’s rule-based programming approach. The reason for explaining them now is that the syntax and semantics of patterns depends strongly on the corresponding rules for XPath expressions.
Chapter 13: The Function Library: XPath 2.0 includes a library of functions that can be called from any XPath expression; XSLT 2.0 extends this with some additional functions that are available only when XPath is used within XSLT. The library has grown immensely since XPath 1.0. This chapter provides a single alphabetical reference for all these functions.
Chapter 14: Regular Expressions: Processing of text is an area where XSLT 2.0 and XPath 2.0 are much more powerful than version 1.0, and this is largely through the use of constructs that exploit regular expressions. If you’re familiar with regexes from languages such as Perl, this chapter tells you how XPath regular expressions differ. If you’re new to the subject, it explains it from first principles.
Chapter 15: Serialization: Serialization in XSLT means the ability to generate a textual XML document from the tree structure that’s manipulated by a stylesheet. This isn’t part of XSLT processing proper, so (following W3C’s lead) it’s separated it into its own chapter. You can control serialization from the stylesheet using an
declaration, but many products also allow you to control it directly via an API.
Part III: Exploitation: The final section of the book is advice and guidance on how to take advantage of XSLT to write real applications. It’s intended to make you not just a competent XSLT coder, but a competent designer too. The best way of learning is by studying the work of ot...
商品描述(中文翻譯)
這本書主要是為專業 XSLT 開發人員提供的實用參考書。它假設讀者對該語言沒有先前的了解,許多開發人員將其作為他們首次接觸 XSLT 的入門書;然而,它並不是以教程的形式結構化的,還有其他書籍提供了對初學者更為溫和的介紹。
這本書假設讀者對 XML、HTML 和網路架構有基本的了解,並且是為有經驗的程式設計師撰寫的。並不假設你知道任何特定的語言,例如 Java 或 Visual Basic,只要你能認識所有程式語言共有的概念即可。
這本書適合 XSLT 1.0 使用者升級到 XSLT 2.0,也適合 XSLT 的新手。無論你是在 Java 還是 .NET 環境中工作,這本書同樣適用。
作為一本參考書,其主要目標是涵蓋全面且具權威性。它旨在提供所有細節,而不僅僅是大多數人使用 80% 時的 20% 語言概述。它的設計使你在遇到新的和具有挑戰性的程式設計任務時,會不斷回到這本書,而不是一本你快速瀏覽後就放在書架上的書。如果你喜歡細節,你會喜歡這本書;如果不喜歡,你可能不會。
除了提供細節外,這本書還旨在深入解釋概念。因此,這是一本不僅想使用語言,還想深入理解它的人所需的書。
這本書旨在告訴你有關 XSLT 2.0 語言的所有必要知識。它對 XSLT 2.0 中的新內容和 1.0 版本中已存在的內容給予同等重視。這本書是關於語言,而不是特定產品。然而,書中有關於 Saxon(作者自己實現的 XSLT 2.0)、Altova XSLT 2.0 實現以及控制 XSLT 轉換的 Java 和 Microsoft API 的附錄,這些無疑會升級以處理 XSLT 2.0 和 1.0。第三個 XSLT 2.0 處理器 Gestalt 在書籍印刷前不久發布,來不及詳細描述。但 XSLT 1.0 的經驗表明,不同 XSLT 處理器之間的互操作性非常高,如果你能使用其中一個,那麼你就能使用所有的。
在前一版中,我們將 XSLT 2.0 和 XPath 2.0 分為兩卷。這個想法是一些讀者可能只對 XPath 感興趣。然而,許多人購買了沒有 XPath 附錄的 XSLT 2.0 書籍,結果感到困惑;因此這次,這些材料重新合併。XPath 參考信息在獨立的章節中,因此在你在 XSLT 以外的上下文中使用 XPath 時,仍然應該能夠輕鬆訪問。
這本書不涵蓋 XSL Formatting Objects,這是一個獨立的大主題。它也不詳細涵蓋 XML Schema。如果你想將這些重要技術與 XSLT 結合使用,還有其他書籍能夠公正地介紹它們。
這本書包含二十章和八個附錄(最後一個是詞彙表),分為四個部分。以下部分概述了每個部分、章節和附錄中可以找到的內容。
**第一部分:基礎:** 本書的第一部分涵蓋了基本概念。你應該在開始編碼之前閱讀這些內容。如果你忽略這個建議,像大多數人一樣,那麼當你發現無法讓語言執行任何非平凡的任務時,你會在絕望的低谷中閱讀它們。XSLT 與其他語言不同,為了讓它為你工作,你需要理解它的設計用途。
**第一章:XSLT 的背景:** 本章解釋了 XSLT 如何融入大局:這種語言是如何產生的,以及它如何與其他技術並存。它還有一些簡單的編碼示例,以保持你的警覺。
**第二章:XSLT 處理模型:** 本章介紹 XSLT 處理器的架構:輸入、輸出和數據模型。理解數據模型可能是區分 XSLT 專家和業餘者的最重要因素;這似乎是你無法立即使用的信息,但這是能夠幫助你避免許多愚蠢錯誤的知識。
**第三章:樣式表結構:** XSLT 開發是關於編寫樣式表,本章從高層次概述樣式表的外觀。它解釋了使用模板的基於規則的編程的關鍵概念,並解釋了如何通過使用模塊和管道來進行大型編程。
**第四章:樣式表和模式:** XSLT 2.0 的一個關鍵創新是樣式表可以利用有關輸入和輸出文檔結構的知識,這些知識以 XML Schema 的形式提供。本章提供了 XML Schema 的快速概述,以描述其對 XSLT 開發的影響。並非每個人都使用模式,如果你屬於這一類別,可以跳過這一章。
**第五章:類型系統:** XPath 2.0 和 XSLT 2.0 提供強類型作為 1.0 語言的弱類型方法的替代方案。這意味著你可以聲明變量、函數和參數的類型,並利用這些信息提前警告程式錯誤。本章解釋了可用的數據類型和創建用戶定義類型的機制。
**第二部分:XSLT 和 XPath 參考:** 本書的這一部分包含參考材料,組織的希望是你能在需要時輕鬆找到所需的內容。它並不是為了順序閱讀,儘管你可能會想翻閱頁面以發現裡面的內容。
**第六章:XSLT 元素:** 本章列出了你可以在樣式表中使用的所有 XSLT 元素,按字母順序排列,提供每個元素的語法和語義的詳細規則、使用建議和示例。這可能是你成為 XSLT 專家時最常使用的部分。這是一種「不留死角」的方法,基於專業開發人員需要知道在困難情況下會發生什麼,而不僅僅是在順風的時候。
**第七章:XPath 基礎:** 本章解釋了 XPath 的基本知識:低級構造,如字面量、變量和函數調用。它還解釋了上下文規則,描述了 XPath 表達式的評估如何依賴於它們出現的 XSLT 處理上下文。
**第八章:XPath:項目上的運算符:** XPath 提供了執行算術、布林比較等的常見運算符。然而,這些運算符的行為並不總是如你所預期的,因此閱讀這一章以了解可用的運算符及其與你使用的最後一種語言的不同之處是值得的。
**第九章:XPath:路徑表達式:** 路徑表達式使 XPath 特別;它們使你能夠在 XML 文檔的結構中導航。本章解釋了路徑表達式的語法、你可以用來定位所需節點的 13 個軸,以及聯集、交集和差異等相關運算符。
**第十章:XPath:序列表達式:** 與 XPath 1.0 不同,在 2.0 版本中,所有值都是序列(單例只是特例)。XPath 2.0 中一些最重要的運算符是那些操作序列的運算符,特別是 «for»
表達式,它通過應用映射將一個序列轉換為另一個序列。
**第十一章:XPath:類型表達式:** 第五章解釋了類型系統;本章解釋了你可以用來利用類型的操作。這包括 «cast»
操作,用於將值從一種類型轉換為另一種類型。本章的大部分內容專注於這些轉換的詳細規則。
**第十二章:XSLT 模式:** 本章從 XPath 返回到 XSLT 特有的主題。模式用於定義模板規則,這是 XSLT 基於規則的編程方法的精髓。現在解釋它們的原因是模式的語法和語義強烈依賴於相應的 XPath 表達式規則。
**第十三章:函數庫:** XPath 2.0 包含一個可以從任何 XPath 表達式調用的函數庫;XSLT 2.0 在此基礎上擴展了一些僅在 XSLT 中使用 XPath 時可用的附加函數。自 XPath 1.0 以來,函數庫已經大幅增長。本章提供了所有這些函數的單一字母順序參考。
**第十四章:正則表達式:** 文本處理是 XSLT 2.0 和 XPath 2.0 比 1.0 版本更強大的領域,這主要是通過使用利用正則表達式的構造。如果你熟悉來自 Perl 等語言的正則表達式,本章告訴你 XPath 正則表達式的不同之處。如果你對這個主題不熟悉,它將從基本原則開始解釋。
**第十五章:序列化:** 在 XSLT 中,序列化意味著能夠從樣式表操作的樹結構生成文本 XML 文檔。這不是 XSLT 處理的正式部分,因此(遵循 W3C 的做法)它被分離到自己的章節中。你可以通過 聲明從樣式表控制序列化,但許多產品也允許你通過 API 直接控制它。
**第三部分:利用:** 本書的最後一部分是有關如何利用 XSLT 編寫實際應用程序的建議和指導。它旨在使你不僅成為一名合格的 XSLT 編碼者,還成為一名合格的設計師。學習的最佳方式是研究其他人的工作……