XSLT Programmer’s Reference 讀書筆記

來源:互聯網
上載者:User

看的是英文電子版,讀到一些好句子,摘錄一下,大家看著玩玩

  • 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.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.