Stage 2: Setting Version 2.0


Stage 2: Setting Version="2.0"

The next stage in your transition to XSLT 2.0 is to switch off backwards compatibility mode by setting the version attribute in the <xsl:stylesheet> element to «2 . 0 » . This section looks at what changes you should be prepared for when you do this. I'll assume here that you have fixed any problems that arose during stage 1: for example, that you have added a «[1] » predicate to any node sets used in <xsl:value-of> as suggested above.

At the XSLT level, there should be no further problems, given these assumptions.

In XPath, you will probably find that some expressions that previously worked now fail with type errors. For example, the expression «concat ("Chapter", 5) » is no longer allowed, because the arguments to concat() have to be strings. Type errors may also arise because you supply a sequence of items where a singleton is expected. In all such cases, you can get round the problems by doing explicit conversions. For example, you can rewrite the above expression as «concat (" Chapter", string (5) ) » .




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