Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
In the first case:
sum(//book/(price * sales))
In the second case:
sum(//price/number(substring-after(., ‘$’))
See Also
avg()
on page 718
count()
on page 733
system-property
This function is available in XSLT only
.
The
system-property()
function returns information about the processing environment.
For example, with a processor that implements XSLT version 2.0, the expression
system-property (‘xsl:version’)
returns
2.0
.
Changes in 2.0
Several new system properties have been defined in XSLT 2.0.
The result of the function is now always a string. In XSLT 1.0 (although the spec was not a hundred percent clear on the point) the
xsl:version
system property was returned as a number.
Signature
Argument | Type | Meaning |
name | xs:string | Specifies the name of the system property required. The value of the string should be in the form of a lexical QName that identifies a system property. If there is no system property with this name, the function returns a zero-length string. |
Result | xs:string | The value of the requested system property . |
Effect
The supplied argument is converted into an expanded name using the namespace declarations in scope for the stylesheet element that contains the call on
system-property()
.
There are several system properties that every implementation must support. These are all in the XSLT namespace, and are listed as follows. The first three were available in XSLT 1.0, the others are new in XSLT 2.0.
System Property | Value |
xsl:version | A number giving the version of XSLT implemented by the processor. For conformant XSLT processors, this will be 1.0 or 2.0. For processors that provide a partial implementation, or an implementation of intermediate working drafts, other versions may be returned. It's a good idea to write your stylesheet on the assumption that new XSLT versions may be introduced in the future. |
xsl:vendor | A string identifying the vendor of the XSLT processor. In practice it will sometimes also identify the product name, but the actual value is implementation defined. For Microsoft's MSXML3 product, the value is simply Microsoft . |
xsl:vendor-url | A string: the URL of the vendor's Web site. For example, MSXML3 returns http://www.microsoft.com . |
xsl:product-name | This property is new in XSLT 2.0. It is intended to identify the product name of the XSLT processor; for example, Xalan or Saxon . |
xsl:product-version | This property is new in XSLT 2.0. It is intended to identify which version of the XSLT processor is being used; for example, 7.6.5 . If there are several variants of a product (for example, Xalan-C and Xalan-J), it is up to the implementor whether the variant is returned as part of the product name or as part of the product version. |
xsl:is-schema-aware | This property returns the string yes or no , depending on whether the XSLT 2.0 processor is schema-aware or not. |