barcode generator github c# Testing XSLT Processors in Font

Generator PDF 417 in Font Testing XSLT Processors

Testing XSLT Processors
Making PDF 417 In None
Using Barcode maker for Font Control to generate, create PDF 417 image in Font applications.
www.OnBarcode.com
Barcode Encoder In None
Using Barcode encoder for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
You can access information about the XSLT processor that s being used from within the stylesheet itself using the system-property() function. The system-property() function takes a single argument, which is a string in the format of a qualified name, and returns a string providing a value for that property. The most important property for our purpose here is the xsl:version property, which tells you the version of XSLT that s supported by the processor that you re using. It returns the string '2.0' in XSLT 2.0 processors and the number 1.0 in XSLT 1.0 processors.
Encode QR In None
Using Barcode printer for Font Control to generate, create QR Code image in Font applications.
www.OnBarcode.com
ANSI/AIM Code 128 Creation In None
Using Barcode encoder for Font Control to generate, create Code 128B image in Font applications.
www.OnBarcode.com
Caution In XSLT 1.0, the system-property() function didn t always return a string; for example, it
PDF417 Printer In None
Using Barcode generator for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
Drawing UCC - 12 In None
Using Barcode encoder for Font Control to generate, create EAN / UCC - 14 image in Font applications.
www.OnBarcode.com
returned the number 1.0 when you asked for the xsl:version property. Make sure that you explicitly cast the result of system-property('xsl:version') to either a string or a number before you use it, so that the code works the same way in both XSLT 1.0 and XSLT 2.0 processors.
Draw Barcode In None
Using Barcode encoder for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Drawing Bookland EAN In None
Using Barcode generation for Font Control to generate, create ISBN - 13 image in Font applications.
www.OnBarcode.com
For example, to test whether the processor being used is an XSLT 1.0 processor, you can use <xsl:choose> <xsl:when test="number(system-property('xsl:version')) = 1.0"> ... code used by XSLT 1.0 processor ... </xsl:when> <xsl:otherwise> ... code used by other XSLT processors ... </xsl:otherwise> </xsl:choose>
PDF417 Drawer In Visual C#.NET
Using Barcode encoder for .NET framework Control to generate, create PDF417 image in Visual Studio .NET applications.
www.OnBarcode.com
Generating PDF417 In Java
Using Barcode generator for Eclipse BIRT Control to generate, create PDF 417 image in Eclipse BIRT applications.
www.OnBarcode.com
CHAPTER 14 BACKWARDS COMPATIBILITY AND EXTENSIONS
QR Code 2d Barcode Generation In .NET
Using Barcode drawer for Reporting Service Control to generate, create Quick Response Code image in Reporting Service applications.
www.OnBarcode.com
Painting UPC Symbol In Objective-C
Using Barcode generation for iPad Control to generate, create Universal Product Code version A image in iPad applications.
www.OnBarcode.com
Caution XSLT processors that support the XSLT 1.1 Working Draft will return 1.1 as the result of
Making EAN-13 In Java
Using Barcode printer for Java Control to generate, create European Article Number 13 image in Java applications.
www.OnBarcode.com
Encode Data Matrix ECC200 In .NET Framework
Using Barcode generator for Reporting Service Control to generate, create Data Matrix image in Reporting Service applications.
www.OnBarcode.com
system-property('xsl:version'). Similarly, XSLT processors that don t quite support XSLT 2.0 completely will probably return a number between 1.0 and 2.0.
UPC A Creation In Objective-C
Using Barcode creation for iPhone Control to generate, create GS1 - 12 image in iPhone applications.
www.OnBarcode.com
Encoding EAN13 In Java
Using Barcode maker for Java Control to generate, create European Article Number 13 image in Java applications.
www.OnBarcode.com
The full list of arguments that you can give to the system-property() function appears in Table 14-1. Note that XSLT 1.0 processors only recognize some of these arguments, as indicated by a check mark. Table 14-1. System Properties
Generate EAN-13 In None
Using Barcode creator for Software Control to generate, create GS1 - 13 image in Software applications.
www.OnBarcode.com
Code 128C Creator In Visual Basic .NET
Using Barcode generator for Visual Studio .NET Control to generate, create Code 128 Code Set C image in Visual Studio .NET applications.
www.OnBarcode.com
Property
Scanning Barcode In Java
Using Barcode Control SDK for BIRT reports Control to generate, create, read, scan barcode image in BIRT applications.
www.OnBarcode.com
Reading UCC - 12 In C#.NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
xsl:version xsl:vendor xsl:vendor-url xsl:product-name xsl:product-version xsl:is-schema-aware
Description
The version of XSLT supported by the processor A string identifying the XSLT processor being used A URL for the XSLT processor The name of the XSLT processor being used The version of the XSLT processor being used Gives 'yes' if the XSLT processor is schema-aware, 'no' otherwise Gives 'yes' if the XSLT processor can be used to serialize a result tree, 'no' otherwise Gives 'yes' if the XSLT processor can behave in a backwards-compatible fashion, 'no' otherwise
XSLT 1.0
xsl:supports-serialization
xsl:supports-backwards-compatibility
Note We ll look at the effect of support for backwards compatibility in the next section.
XSLT processors can return values for other properties as well; look at your XSLT processor s documentation to see what properties it supports. If you try to get the value of a property that the XSLT processor doesn t understand (for example, if you re using an XSLT 1.0 processor and you try to access the value of the xsl:is-schema-aware property), you will get an empty string as a result.
Summary You can test the capabilities of an XSLT processor using the system-property() function.
CHAPTER 14 BACKWARDS COMPATIBILITY AND EXTENSIONS
Getting Information About Your XSLT Processor
When it comes to debugging a stylesheet, it s often useful to be able to tell which XSLT processor you re using. This is particularly true if you re operating with a system where the XSLT processor is determined based on the environment, such as when using Java-based XSLT processors. In this example, we ll create a simple stylesheet, info.xsl, which will generate a text file that lists the important information about the XSLT processor you re using, accessing it using the system-property() function. The stylesheet itself is an XSLT 2.0 stylesheet that uses the following text output method: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> ... </xsl:stylesheet> The stylesheet only needs one template, which may as well match the root document node of whatever XML is used as the input to the stylesheet (the input doesn t matter at all, since we won t be using any information from it). Within this template, we ll test the version of XSLT that s being supported, and use that information to determine which other properties are worth looking at, since XSLT 1.0 processors don t support properties such as xsl:product-name and xsl:product-version. To get the basic information about the XSLT processor, we ll use the following template: <xsl:template match="/"> <xsl:choose> <xsl:when test="number(system-property('xsl:version')) > 1.0"> <xsl:text>XSLT version </xsl:text> <xsl:value-of select="system-property('xsl:version')" /> <xsl:text> processor</xsl:text> <xsl:text> Processor: </xsl:text> <xsl:value-of select="system-property('xsl:product-name')" /> <xsl:text> Version: </xsl:text> <xsl:value-of select="system-property('xsl:product-version')" /> <xsl:text> Vendor: </xsl:text> <xsl:value-of select="system-property('xsl:vendor-url')" /> </xsl:when> <xsl:otherwise> <xsl:text>XSLT version 1.0 processor</xsl:text> <xsl:text> Processor: </xsl:text> <xsl:value-of select="system-property('xsl:vendor')" /> <xsl:text> Vendor: </xsl:text> <xsl:value-of select="system-property('xsl:vendor-url')" /> </xsl:otherwise> </xsl:choose> </xsl:template> Running this stylesheet with itself as the input using Saxon 8.4B gives info.saxon.txt, shown in Listing 14-1.
Copyright © OnBarcode.com . All rights reserved.