XSLT Programmer's Reference 读书笔记

看的是英文电子版,读到一些好句子,摘录一下,大家看着玩玩

  • 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> and <xsl:import> is that conflicting definitions are resolved differently:

    • <xsl:include> effectively does a textual inclusion of the referenced stylesheet module, minus its containing <xsl:stylesheet> element, at the point where the <xsl:include> 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> element itself.

    • <xsl:import> 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 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> 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. 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 is discussed in detail in Chapter 9.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值