Index of XSLT Examples:

  This directory contains several examples of the transformations which can be
performed on XML data using eXtensible Stylesheet Language Transforms.  XML
output is available from nearly all SymCLI commands, as documented at
../docs/Readme.  When using this XML output, XSLT technology is recommended as a
middle processing layer between the SymCLI and scripts or other tools.  Using 
XML will result in less ambiguous, more robust scripts; XSLT will serve to make
the information presented in XML form accessible to the familiar plaintext-based
scripting techniques.  Full information on XSLT can be found at 
http://www.w3.org/TR/xslt.

  In crafting these stylesheets, we have used the Java-based XSLT engines Xalan
and XT.  These are available from http://xml.apache.org and 
http://jclark.com/xml/ respectively.  Assuming that one of these tools is 
present and correctly referenced, the included examples should work.  For 
simplicity, little effort has been made to check for malformed arguments and so
forth, so please refer to the sample commands below for legal parameter values.

  Each example entry below contains a short description, the relevant files,
and an example command line.  The commands assume that either Xalan or XT has
been properly installed.  The aliases 'xalan' and 'xt' refer respectively to  
"java org.apache.xalan.xslt.Process" and "java com.jclark.xsl.sax.Driver".  
Please note that these examples are provided as just that, and accordingly
are not supported.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Example 1: Using "symdev list" output; meant as an introduction.  Demonstrates 
  numerous constructs, including templates, text display, value selection, 
  conditionals, counting, selection using XPath, for-loops, and sorting.

  Files: example1.xml (symdev list), example1.xsl, example1.txt

  Xalan: xalan -q -in example1.xml -xsl example1.xsl

  XT:    xt example1.xml example1.xsl

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example 2: Uses the power of wildcards and parameters to grab specified 
  attributes from arbitrary XML.  Takes parameters 'element', name of element to
  search through; 'fields', list of fields to print; 'separator', a string to
  separate fields; and 'delimiter', a set of characters to surround fields with.

  Files: example2.xml (symcfg list -v), example2.xsl, example2.txt

  Xalan: xalan -q -in example2.xml -xsl example2.xsl -param element "'Symmetrix'" \
           -param fields "'Symmetrix.id Symmetrix.attachment Cache.megabytes'" \
           -param separator "';'"

  XT:    xt example2.xml example2.xsl element="Symmetrix" separator=";" \
           fields="Symmetrix.id Symmetrix.attachment Cache.megabytes"

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example 3: This is a more specific example where we use XSL to summarize 
  the information about Meta devices returned to us by "symdev list -v".  Note
  the recursive structure used to allow easy access to specified elements.  A 
  stylesheet like this could be used to prepare a daily report with the
  specific information that an Administrator might want formatted nicely.

  Files: example3.xml (symdev list -v), example3.xsl, example3.txt

  Xalan: xalan -q -in example3.xml -xsl example3.xsl  \
           -param dev-list "'0000,0001,00D8,00D9'"
  
  XT:    xt example3.xml example3.xsl dev-list="0000,0001,00D8,00D9"

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Example 4: Using "symdev list -v" output, searches for devices on the same 
  physical disk as the selected device.  If the device is part of a meta, all 
  members are used in the search.  A rather complex query which would require
  heavy scripting to perform on standard output, this shows the value of having
  all the information readily accessible in a tree-like structure. 

  Files: example3.xml, example4.xsl, example4a.txt, example4b.txt

  Xalan: xalan -q -in example3.xml -xsl example4.xsl -param dev_name "'00D7'"
         xalan -q -in example3.xml -xsl example4.xsl -param dev_name "'00D8'"

  XT:    xt example3.xml example4.xsl dev_name="00D7"
         xt example3.xml example4.xsl dev_name="00D8"

       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
