Re: simple redraft Re: Environment Variable Retrieval Spec
"John L. Clark" <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <20060217202226.GZ10347@rejoice> |
On Fri, Feb 17, 2006 at 01:37:57PM +0100, James Fuller wrote:
> > I think it would be better to structure the namespace, i.e
> > .../system/environment.
> I agree.
That's fine. It was a relatively arbitrary decision, primarily meant to
be consistent with our other namespaces.
I've made the change in the spec, as well as a couple other fixes and
clarifications. The new draft should be attached to this email, as well
as the HTML-formatted user page.
Take care,
John L. Clark
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list
sys.xml
(text/plain, 2.8 KB)
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../style/module.stylesheet.xsl" ?>
<exslt:module xmlns:exslt="http://exslt.org/documentation"
version="1" prefix="sys">
<exslt:name>System</exslt:name>
<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
ID="sys">
<dc:subject>EXSLT</dc:subject>
<dc:subject>system</dc:subject>
<dc:subject>module</dc:subject>
<exslt:revision>
<rdf:Description xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
ID="sys.1">
<exslt:version>1</exslt:version>
<dc:creator>John L. Clark</dc:creator>
<dc:date>2006-02-15</dc:date>
<dc:description>Specify a namespace for access to environment variables.</dc:description>
</rdf:Description>
</exslt:revision>
</rdf:Description>
<exslt:doc xmlns="http://www.w3.org/1999/xhtml">
<div>
<p><em>EXSLT - System</em> provides features for using the host
system.</p>
<p>This module defines an additional namespace,
<code>http://exsl.org/system/environment</code>, through which a user
can access system environment variables via the <a
href="http://www.w3.org/TR/xslt.html#function-system-property"><code>system-property</code></a>
function.</p>
<p>Use this namespace as follows. Given <code>SQ</code>, a string that
is a <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a>
with a prefix that maps to
<code>http://exsl.org/system/environment</code> and local part
<code>L</code>, <code>system-property(SQ)</code> returns the value of
the system environment variable <code>L</code>. For example, if
"<code>env</code>" maps to this namespace, then
<code>system-property("env:USER")</code> might return "john".</p>
<p>The result of a call to system-property("env:X") MUST always return
the same value (for a given X) throughout the processing session. Which
environment variables are available to a given XSLT transformation is
system- and implementation-dependent, and an implementation SHOULD
document any special steps it takes when exposing environment variables.
Whenever an implementation cannot provide a value for a given
environment variable, it MUST return the zero-length string as the
result of the <code>system-property</code> call. The mapping of the
encoding of the variable's original value to that of the XPath string
object is implementation-dependent.</p>
<p><strong>Note:</strong> Retrieving environment variables can pose a
security risk if those environment variables expose sensitive system
information.</p>
</div>
</exslt:doc>
</exslt:module>
index.html
(text/html, 4.8 KB)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/schema/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>EXSLT - System</title><link href="http://exslt.org/base.css" rel="stylesheet"/></head><body><h1 id="#title"><a href="http://www.exslt.org/">EXSLT</a> - <a href="http://www.exslt.org/sys/">System</a></h1><table><tr><td id="menu"><p class="level1"><a href="sys.html">Implementer Page</a></p><p class="level1"><a href="../howto.html">How To</a></p><p class="level1"><a href="../download.html">Downloads</a></p><p class="level1">Modules</p><p class="level2"><a href="../date/index.html">Dates and Times</a></p><p class="level2"><a href="../dyn/index.html">Dynamic</a></p><p class="level2"><a href="../exsl/index.html">Common</a></p><p class="level2"><a href="../func/index.html">Functions</a></p><p class="level2"><a href="../math/index.html">Math</a></p><p class="level2"><a href="../random/index.html">Random</a></p><p class="level2"><a href="../regexp/index.html">Regular Expressions</a></p><p class="level2"><a href="../set/index.html">Sets</a></p><p class="level2"><a href="../str/index.html">Strings</a></p><p class="level2"><a href="../sys/index.html">System</a></p><p class="level1"><a href="../submissions/">Submissions</a></p><p class="level1"><a href="../list">Mailing List</a></p><p class="level1"><a href="../contact.html">Contact</a></p></td><td id="content"><p><b>Implementer Page: </b><a href="sys.html">sys.html</a><br/><b><a href="../howto.html#module-level">Module Package</a>: </b><a href="sys.zip">sys.zip</a></p><div><p><em>EXSLT - System</em> provides features for using the host
system.</p><p>This module defines an additional namespace,
<code>http://exsl.org/system/environment</code>, through which a user
can access system environment variables via the <a href="http://www.w3.org/TR/xslt.html#function-system-property"><code>system-property</code></a>
function.</p><p>Use this namespace as follows. Given <code>SQ</code>, a string that
is a <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a>
with a prefix that maps to
<code>http://exsl.org/system/environment</code> and local part
<code>L</code>, <code>system-property(SQ)</code> returns the value of
the system environment variable <code>L</code>. For example, if
"<code>env</code>" maps to this namespace, then
<code>system-property("env:USER")</code> might return "john".</p><p>The result of a call to system-property("env:X") MUST always return
the same value (for a given X) throughout the processing session. Which
environment variables are available to a given XSLT transformation is
system- and implementation-dependent, and an implementation SHOULD
document any special steps it takes when exposing environment variables.
Whenever an implementation cannot provide a value for a given
environment variable, it MUST return the zero-length string as the
result of the <code>system-property</code> call. The mapping of the
encoding of the variable's original value to that of the XPath string
object is implementation-dependent.</p><p><strong>Note:</strong> Retrieving environment variables can pose a
security risk if those environment variables expose sensitive system
information.</p></div><p>
XSLT processors may support any number of the extension elements and functions given in this module.
</p><p class="note">
Using EXSLT will only make your stylesheet portable amongst the implementations that support EXSLT. Note that there is no requirement for XSLT processors that are compliant to XSLT to support the extensions described within EXSLT.
</p><h2>Namespace</h2><p>
The namespace for EXSLT - System is:
</p><pre>http://exslt.org/system</pre><p>
Throughout this document, the prefix <code>sys</code> is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions).
</p><p>
To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:
</p><pre>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sys="http://exslt.org/system"
extension-element-prefixes="sys">
<xsl:import href="sys.xsl" />
...
</xsl:stylesheet>
</pre></td></tr></table><div id="colophon"><p><a href="http://www.exslt.org/sys/index.html">http://www.exslt.org/sys/index.html</a> last modified 2006-02-15</p></div></body></html>
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) iD8DBQFD9jCCjkcskvOyl78RArGsAJ9Upcvwt46i5RNvR7d1Zv6fZPCM5ACfegdF ttwjsBlM6dFEEBu/SutlvEs= =vrD4 -----END PGP SIGNATURE-----