Returns information about the operating system.
<p:declare-step type="p:os-info"> <output port="result" primary="true" content-types="application/xml" sequence="false"/> </p:declare-step>
The p:os-info
step returns information about the operating system the XProc processor is running on, which appears on the result
port as an XML document.
Ports:
Port | Type | Primary? | Content types | Seq? | Description |
---|---|---|---|---|---|
|
|
|
|
| A |
The p:os-info
step gathers information about the operating system the XProc processor is running on. This results in an XML document on the
result
port.
The document appearing on the result
port has a <c:result>
root element (the c
prefix here is bound to
the http://www.w3.org/ns/xproc-step
namespace).
Basic information is contained in a number of mandatory attributes. XProc processors may add other attributes with operating system information, but these are, of course, implementation-defined and therefore depend on the XProc processor used. Attribute values can be the empty string if they do not apply to the runtime environment (which will rarely happen).
Environment variables are listed in <c:environment>
child elements.
<c:result cwd file-separator os-architecture os-name os-version path-separator user-home user-name *? > <c:environment name="…" value="…">* </c:result>
Attribute | # | Description |
---|---|---|
| 1 | The current working directory (in operating system dependent notation). For instance |
| 1 | The file/path separator character. For instance |
| 1 | The operating system architecture. For instance |
| 1 | The name of the operating system. For instance |
| 1 | The version of the operating system. For instance |
| 1 | The path separator character. For instance |
| 1 | The home directory of the current user (in operating system dependent notation). For instance |
| 1 | The (login) name of the current user. For instance |
| ? | The XProc processor may add other attributes with information about the operating system (in a different namespace). These attributes, their values and meaning are implementation-defined and therefore depend on the XProc processor used. |
Pipeline document:
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0"> <p:output port="result"/> <p:os-info/> </p:declare-step>
On the system used to develop the XProcRef site on, the partial result is:
<c:result xmlns:c="http://www.w3.org/ns/xproc-step" os-name="Windows 10" user-home="C:\Users\erik" file-separator="\" user-name="erik" path-separator=";" os-version="10.0" cwd="C:\…" os-architecture="amd64"> <c:environment name="…" value="…"/> </c:result>
Some information (especially the names and values of the environment variables) is left out for privacy reasons.
The document appearing on the result
port only has a content-type
property. It has no other
document-properties (also no base-uri
).
This description of the p:os-info
step is for XProc version: 3.0. This is a non-required step (an XProc 3.0 processor does not have to support this).
The formal specification for the p:os-info
step can be found here.
The p:os-info
step is part of categories:
The p:os-info
step is also present in version:
3.1.