fn:environment-variable

Returns the value of a system environment variable, if it exists.

environment-variable($name as xs:string) ➔ xs:string?

Arguments

 

$name

xs:string

The name of the required environment variable

Result

xs:string?

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 3.1 Functions and Operators

Notes on the Saxon implementation

Implemented in Saxon 9.3 under the name get-environment-variable; name changed to environment-variable in Saxon 9.4. Available provided XPath 3.0 is enabled.

Implemented in Saxon using the Java method System.getenv(). The rule in the XPath specification requiring the result to be deterministic is not enforced.