barcodewriter zxing c# Using the function-available() function is more accurate than determining what functions might Tip in Font

Generate PDF 417 in Font Using the function-available() function is more accurate than determining what functions might Tip

Using the function-available() function is more accurate than determining what functions might Tip
Creating PDF 417 In None
Using Barcode generator for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
UPC Symbol Creator In None
Using Barcode generation for Font Control to generate, create GS1 - 12 image in Font applications.
www.OnBarcode.com
be supported based on the version of XSLT the processor claims to support using the system-property() function, because processors that don t have full conformance with XSLT 2.0 might still support the function. It s also less work for you than trying to work out what functions are supported based on the name and ver-
Drawing PDF 417 In None
Using Barcode generation for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
Printing Barcode In None
Using Barcode printer for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
CHAPTER 14 BACKWARDS COMPATIBILITY AND EXTENSIONS
ANSI/AIM Code 39 Generation In None
Using Barcode drawer for Font Control to generate, create Code 39 image in Font applications.
www.OnBarcode.com
Data Matrix 2d Barcode Generator In None
Using Barcode maker for Font Control to generate, create ECC200 image in Font applications.
www.OnBarcode.com
Functions sometimes have optional arguments, and sometimes a processor might only support the function with (or without) those optional arguments. For example, the third argument to the key() function was only introduced in XSLT 2.0, so XSLT 1.0 processors won t understand it. The function-available() function can take a second argument, specifying the number of arguments for the function. For example, you could work out whether a processor supported the three-argument version of the key() function with function-available('key', 3)
Paint Barcode In None
Using Barcode maker for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Painting MSI Plessey In None
Using Barcode encoder for Font Control to generate, create MSI Plessey image in Font applications.
www.OnBarcode.com
Caution The two-argument version of function-available() was only introduced in XSLT 2.0, so you
PDF-417 2d Barcode Printer In Visual Basic .NET
Using Barcode creation for Visual Studio .NET Control to generate, create PDF-417 2d barcode image in VS .NET applications.
www.OnBarcode.com
PDF 417 Printer In None
Using Barcode maker for Office Excel Control to generate, create PDF 417 image in Microsoft Excel applications.
www.OnBarcode.com
shouldn t use it in code that might be executed by an XSLT 1.0 processor.
Drawing USS Code 128 In C#
Using Barcode maker for VS .NET Control to generate, create Code 128 Code Set A image in .NET framework applications.
www.OnBarcode.com
Barcode Drawer In None
Using Barcode creation for Office Excel Control to generate, create Barcode image in Microsoft Excel applications.
www.OnBarcode.com
Summary You can use the function-available() function to test whether the XSLT processor being
USS Code 39 Drawer In Visual Basic .NET
Using Barcode drawer for .NET Control to generate, create Code 39 image in VS .NET applications.
www.OnBarcode.com
Make Barcode In Objective-C
Using Barcode creation for iPhone Control to generate, create Barcode image in iPhone applications.
www.OnBarcode.com
used supports a particular function.
Barcode Scanner In .NET Framework
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
USS-128 Generator In None
Using Barcode creator for Software Control to generate, create UCC.EAN - 128 image in Software applications.
www.OnBarcode.com
Testing Instruction Availability
Paint Code 39 In Visual Studio .NET
Using Barcode printer for VS .NET Control to generate, create Code 3/9 image in VS .NET applications.
www.OnBarcode.com
Code 128 Code Set A Creator In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Code128 image in .NET applications.
www.OnBarcode.com
Just as the function-available() function tests whether a particular function is available, the element-available() function tests whether a particular instruction is available. Again, this can be used to accurately work out what a processor supports, and to test for support for extension instructions.
1D Barcode Maker In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create Linear 1D Barcode image in ASP.NET applications.
www.OnBarcode.com
Barcode Creator In .NET Framework
Using Barcode generator for ASP.NET Control to generate, create Barcode image in ASP.NET applications.
www.OnBarcode.com
Note Despite its name, the element-available() function only tests the availability of instructions
(elements that appear within a template). For example, element-available('xsl:template') will return false because the <xsl:template> element is not an instruction.
The element-available() function takes a single argument the name of the extension element that you are interested in. If the processor supports the extension element, then it returns true; if it doesn t support the extension element, then it returns false. For example, to test whether the processor supports the <xsl:for-each-group> instruction from XSLT 2.0, you could use element-available('xsl:for-each-group')
Note The element-available() function tests what instructions an XSLT processor supports; it doesn t
test whether an element is present within an XML document or stylesheet.
Summary The element-available() function returns true if the element whose name is passed as
the argument to the function is supported by the XSLT processor.
CHAPTER 14 BACKWARDS COMPATIBILITY AND EXTENSIONS
Excluding Portions of a Stylesheet
In XSLT 2.0, a new attribute called use-when has been introduced that provides an alternative mechanism for including or excluding code. The use-when attribute can be present on any XSLT element, and there s an xsl:use-when attribute that you can use on literal result elements to the same effect. If the XPath expression that it contains evaluates to false, then the element on which the use-when attribute is found and all its contents are completely ignored by the XSLT processor. The evaluation of use-when attributes happens very early on in the process, when the stylesheet is first parsed and interpreted by the XSLT processor. Because this happens so early, use-when is a very efficient mechanism for getting the processor to ignore code that it should never use. However, it does mean that the XPath expressions you can use within the use-when attribute are restricted. These expressions can t refer to information in source documents used by the stylesheet; they can t refer to global variables or parameters; they can t use stylesheet functions, keys, decimal formats, and so on; they can t refer to element or attribute declarations or type definitions that have been imported into the stylesheet with <xsl:import-schema>. What use-when can do is test whether the processor supports particular functions or elements, or optional features. To reuse the example that we ve been looking at, rather than <xsl:choose> <xsl:when test="number(system-property('xsl:version')) >= 2.0"> <xsl:for-each-group select="/TVGuide/Channel/Program" group-by="Series"> ... </xsl:for-each-group> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="/TVGuide/Channel/Program" /> </xsl:otherwise> </xsl:choose> which won t work if the processor is an XSLT 2.0 processor that doesn t yet support <xsl:for-each-group>, you could use <xsl:for-each-group select="/TVGuide/Channel/Program" group-by="Series" use-when="element-available('xsl:for-each-group')"> ... </xsl:for-each-group> <xsl:apply-templates select="/TVGuide/Channel/Program" use-when="not(element-available('xsl:for-each-group'))" /> There s actually not much point in using use-when to test whether XSLT 2.0 instructions are supported, since XSLT 1.0 processors won t understand use-when attributes. If you run the preceding code on an XSLT 1.0 processor, you ll get an error because the <xsl:for-each-group> instruction isn t supported and no fallback has been provided. It s better in this situation to use <xsl:fallback>, as in <xsl:for-each-group select="/TVGuide/Channel/Program" group-by="Series">
Copyright © OnBarcode.com . All rights reserved.