diff --git a/README.md b/README.md index c78b90e..533a55f 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,21 @@ list_all_SPs_csv.xsl ## Overview -Bash script ``http_xsltproc.sh`` is a wrapper around the ``xsltproc`` command-line tool. Unlike ``xsltproc``, script ``http_xsltproc.sh`` fetches the target XML document from an HTTP server. See the inline help file for details: +Bash script ``http_xsltproc.sh`` is a wrapper around the ``xsltproc`` command-line tool. Unlike ``xsltproc``, the ``http_xsltproc.sh`` script fetches the target XML document from an HTTP server using HTTP Conditional GET [RFC 7232]. If the server responds with 200, the script caches the resource and returns the response body. If the server responds with 304, the script returns the cached resource instead. See the inline help file for details: ```Shell $ $BIN_DIR/http_xsltproc.sh -h ``` -The following examples illustrate usage of the script. +The ``http_xsltproc.sh`` script requires two environment variables. ``CACHE_DIR`` is the absolute path to the cache directory (which may or may not exist) whereas ``LIB_DIR`` specifies a directory containing various helper scripts. + +For example, let's use the library installed in the previous section and specify the cache as follows: + +```Shell +$ export CACHE_DIR=/tmp/cache +``` + +The following examples show how to use the script to create some cron jobs on incommon.org. ### Example #1 @@ -78,7 +86,7 @@ Observe that the command ``http_xsltproc.sh -F`` forces a fresh SAML metadata fi ### Example #2 -Consider the following URLs: +This example is similar to the previous example except that two resources are created. Consider the following URLs: ```Shell xml_location=http://md.incommon.org/InCommon/InCommon-metadata.xml @@ -117,7 +125,7 @@ mv $resource1_file $resource2_file $resource_dir exit 0 ``` -Observe the commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C``. The former forces a fresh SAML metadata file as in the previous example. The latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files. +Observe the commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C``. The former forces a fresh SAML metadata file as in the previous example; the latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files. ### Example #3