XSLT Programmer's Reference 读书笔记
2005-09-12 18:01
155 查看
看的是英文电子版,读到一些好句子,摘录一下,大家看着玩玩
There is no explicit provision for XHTML output, but since XHTML is pure XML, it can be written using the XML method in the same way as any other XML document type.
The difference between <xsl:include[/b]> and <xsl:import[/b]> is that conflicting definitions are resolved differently:
<xsl:include[/b]> effectively does a textual inclusion of the referenced stylesheet module, minus its containing <xsl:stylesheet[/b]> element, at the point where the <xsl:include[/b]> element is written. The included module is treated exactly as if its top-level elements, with their contents, appeared in the parent module in place of the <xsl:include[/b]> element itself.
<xsl:import[/b]> also incorporates the top-level elements from the referenced stylesheet module, but in this case the definitions in the imported module have lower import precedence[/b] than the definitions in the parent module. If there are conflicting definitions, the one with higher import precedence will generally win. The detailed rules actually depend on the type of definition, and are given in the specification of <xsl:import[/b]> on page 226, in Chapter 4. Importing a module is thus rather like defining a subclass, in that the parent module can use some definitions unchanged from the imported module, and override others with definitions of its own.
It is an error for a stylesheet module to import or include itself, directly or indirectly, because doing so would define an infinite loop.
It isn't an error, however, for a stylesheet module to be included or imported at more than one place in the stylesheet program.
People often ask for some kind of facility to load stylesheet modules dynamically, based on a decision made while the transformation is running. The simple answer is that you can't do this.
The typical way of using this is to have one stylesheet containing common template rules, followed by more specific stylesheet modules distinguished using the title or media pseudo-attributes. But other products, notably Microsoft's MSXML3, simply use the first stylesheet and ignore the others.
Bitten by years of experience with proprietary vendor extensions to HTML, the W3C committee responsible for XSLT took great care to allow vendor extensions in a tightly controlled way.
What this means in practice is that if you want to be specific about whitespace characters, write them as character references; if you just want to use them as separators and padding, use the whitespace characters directly.
Unlike variables in many programming languages, XSLT variables cannot be updated[/b]. Once they are given an initial value, they retain that value until they go out of scope. This feature has a profound effect on the programming style used when a stylesheet needs to do calculations. The subject of programming without assignment statements[/i] is discussed in detail in Chapter 9.
There is no explicit provision for XHTML output, but since XHTML is pure XML, it can be written using the XML method in the same way as any other XML document type.
The difference between <xsl:include[/b]> and <xsl:import[/b]> is that conflicting definitions are resolved differently:
<xsl:include[/b]> effectively does a textual inclusion of the referenced stylesheet module, minus its containing <xsl:stylesheet[/b]> element, at the point where the <xsl:include[/b]> element is written. The included module is treated exactly as if its top-level elements, with their contents, appeared in the parent module in place of the <xsl:include[/b]> element itself.
<xsl:import[/b]> also incorporates the top-level elements from the referenced stylesheet module, but in this case the definitions in the imported module have lower import precedence[/b] than the definitions in the parent module. If there are conflicting definitions, the one with higher import precedence will generally win. The detailed rules actually depend on the type of definition, and are given in the specification of <xsl:import[/b]> on page 226, in Chapter 4. Importing a module is thus rather like defining a subclass, in that the parent module can use some definitions unchanged from the imported module, and override others with definitions of its own.
It is an error for a stylesheet module to import or include itself, directly or indirectly, because doing so would define an infinite loop.
It isn't an error, however, for a stylesheet module to be included or imported at more than one place in the stylesheet program.
People often ask for some kind of facility to load stylesheet modules dynamically, based on a decision made while the transformation is running. The simple answer is that you can't do this.
The typical way of using this is to have one stylesheet containing common template rules, followed by more specific stylesheet modules distinguished using the title or media pseudo-attributes. But other products, notably Microsoft's MSXML3, simply use the first stylesheet and ignore the others.
Bitten by years of experience with proprietary vendor extensions to HTML, the W3C committee responsible for XSLT took great care to allow vendor extensions in a tightly controlled way.
What this means in practice is that if you want to be specific about whitespace characters, write them as character references; if you just want to use them as separators and padding, use the whitespace characters directly.
Unlike variables in many programming languages, XSLT variables cannot be updated[/b]. Once they are given an initial value, they retain that value until they go out of scope. This feature has a profound effect on the programming style used when a stylesheet needs to do calculations. The subject of programming without assignment statements[/i] is discussed in detail in Chapter 9.
相关文章推荐
- XSLT Programmer's Reference 读书笔记
- XSLT 2.0 Programmer's Reference, Third Edition
- XSLT Programmer's Reference
- 读书笔记:A tour of computer system<computer system a programmer perspective第一章>
- VBScript Programmer's Reference
- Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies 读书笔记之三 推荐
- [读书笔记]A Programmer's Guide to Data Mining - chapter 2 Get Started with Recommendation Systems
- 『重构--改善既有代码的设计』读书笔记----Change Value to Reference
- DirectX Programmer's Reference Components
- 读书笔记《Effective c++》 条款21 必须返回对象时,别妄想返回其reference
- [Python Essential Reference, Fourth Edition (2009)]读书笔记
- 《Java: The Complete Reference》《Java 8 编程参考官方教程(第9版)》读书笔记
- 读书笔记_Effective_C++_条款二十一:当必须返回对象时,别妄想返回其reference
- 读书笔记 - Derby Reference Manual(一)
- 读书笔记 - Derby Reference Manual(三)
- 读书笔记: optimizing program performance<computer system a programmer perspective>
- Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies 读书笔记之六
- XSLT(1) XSLT and XPath Reference
- 读书笔记《Effective c++》 条款10 令operator= 返回一个reference to *this
- 《Star Schema The Complete Reference》 读书笔记(1)