Chapter 8: Extensibility


Overview

The previous three chapters covered all the facilities defined the XSLT language. This chapter discusses what happens when you need to stray beyond the XSLT 2.0 language specification. It's concerned with questions such as:

  • What extensions are vendors allowed to provide?

  • How much are implementations allowed to vary from each other?

  • How can your write your own extensions?

  • How can you write stylesheets that will run on more than one vendor's XSLT processor?

There is some interesting history here. The draft XSLT 1.1 specification defined a general mechanism for calling extension functions written in any language, and then defined detailed interfaces for Java and JavaScript (or ECMAScript, to give it its vendor-neutral name ). This specification was published as a working draft, but was subsequently withdrawn. There were a number of reasons for this, one of which was simply that events were overtaken by the more ambitious XSLT 2.0 initiative. But part of the reason was that the proposals for standardizing extension function interfaces attracted heavy public criticism (see http://xml.coverpages.org/withdraw-xslScript.html). It's difficult in retrospect to summarize the arguments that were waged against the idea, but they probably fell into three categories: some people thought extension functions were a bad idea in principle and should not be encouraged; some people disapproved of singling out two languages (Java and JavaScript) for special treatment; and some people felt that the W3C shouldn't be putting language bindings into the core XSLT specification, the job should be done in separate specifications preferably produced by a different organization.

The result of this minor furor is that there is no defined interface for writing extension functions, either in XSLT 1.0 or in XSLT 2.0. However, conventions have emerged at least for XSLT 1.0 (the draft 1.1 specification was influenced by these conventions, and in turn exerted its own influence on the products, despite being abandoned ) and it is worth giving these some space.




XSLT 2.0 Programmer's Reference
NetBeansв„ў IDE Field Guide: Developing Desktop, Web, Enterprise, and Mobile Applications (2nd Edition)
ISBN: 764569090
EAN: 2147483647
Year: 2003
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net