Re: simple redraft Re: Environment Variable Retrieval Spec

"John L. Clark" <[email protected]>
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <20060220193806.GL10347@rejoice>
On Sun, Feb 19, 2006 at 09:16:08PM -0700, Uche Ogbuji wrote:
> I agree.  Colin does raise an important point, but I think the only
> really sane thing to do is to make the matching implementation
> specific.  Yeah, this isn't the best for compatibility, but I think
> there's not really much to be done about it.

I've added statements to the specification to this effect.  I've
attached the new draft and its HTML view to this email, for your ongoing
review.

With respect to compatibility, I think it's acceptable to advise users
who are interested in portability that they should craft the function
call carefully on case-insensitive systems.  For example, they can
choose to use `system-property("env:HOME")` instead of
`system-property("env:Home")`, even if both might work on a particular
system.  Of course, this requires them to be aware of the nuances on
their system and on other possible target systems, but I don't think
there's any way for us to help relieve that.

Take care,

    John L. Clark

_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list
sys.xml (text/plain, 3.2 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".  If the
    system uses case-insensitive environment variable names, then the
    implementation SHOULD match <code>L</code> to the system's environment
    variable names in a case-insensitive manner and it SHOULD document the
    systems on which this behavior takes place.  For example, on a
    case-insensitive system the previous function call would match
    <code>USER</code>, <code>user</code>, and <code>User</code> environment
    variable names, among others.</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, 5.3 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".  If the
    system uses case-insensitive environment variable names, then the
    implementation SHOULD match <code>L</code> to the system's environment
    variable names in a case-insensitive manner and it SHOULD document the
    systems on which this behavior takes place.  For example, on a
    case-insensitive system the previous function call would match
    <code>USER</code>, <code>user</code>, and <code>User</code> environment
    variable names, among others.</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>
&lt;xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:sys="http://exslt.org/system"
                extension-element-prefixes="sys"&gt;

&lt;xsl:import href="sys.xsl" /&gt;

...
              
&lt;/xsl:stylesheet&gt;
</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)

iD8DBQFD+hqejkcskvOyl78RAnz9AJ0d6ctlBvksJSoRUNZdVBr0+C63xACePS5i
gP/6N5VxZHsVbjGWAoLCm48=
=qyDN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.