This page was created by the IDL library routine
mk_html_help2.
Last modified: Thu Oct 24 15:35:45 2019.
NAME:
READ_XML8
PURPOSE:
READ an XML document file into IDL (Interactive Data Language, ITT).
This function is specifically for IDL version 8 and above because
it uses both OrderedHashes and Lists which were introduced in version 8.
Output is an IDL Ordered Hash with Lists for repeating elements.
This function reads the file and parses the XML document into a DOM
(Document Object Model) object or IDLffXMLDOMDocument.
It passes oDoc to XML2IDL8 which walks through the nodes creating the hash.
CATEGORY:
Datafile handling; XML
CALLING SEQUENCE:
Result = READ_XML8(filename, [ outFile=outFile, validation = validation ])
INPUTS:
filename - name of XML file to read (string)
OUTPUTS:
Result is a hash of hashes or lists that represents the XML file.
One can access the various nodes
by indexing into it, like this:
IDL> print, hash[rootname,elname,childname,'_text']
If there are siblings with the same name, then they are pulled together
in a list which is indexed by number:
IDL> i++
IDL> print, hash[rootname,repeatedname,i,childname,'_text'];
To see what the childnames are for element elnameN:
IDL> print, hash[rootname,elname,...,elnameN].Keys()
KEYWORDS:
outFile - If set to a filename, will save pretty printout to that file
validation - Turns on validation of xml file
The Schema or DTD need to on local disk.
PROCEDURES USED:
XML2IDL8
PACKAGE LOCATION:
http://www.astro.umd.edu/~eshaya/PDS/pds4readxml.tar
MODIFICATION HISTORY:
Written by Ed Shaya / U. of Maryland [Nov 5, 2013]
Removed path variable. Now filename should contain path if needed. ES/Dec 3, 2013.
Switched to ordered hash so elements stay in order. Now using
XML2IDL8.pro. ES/Oct 10, 2014.
Removed use of prettyhash (toscreen) since IDL now does this
natively when you enter the hash name ES/Oct 10, 2014
(See projects/SPP/fields/util/read_xml8.pro)
NAME: spp_fld_statusplot PROCEDURE: spp_fld_statusplot, x, y, overplot = overplot, limits = lim, data = data INPUT: x: array of x values. y: array of y strings. PURPOSE: Procedure used to display status bars on a TPLOT. SPP_FLD_STATUSPLOT uses the SPECPLOT routine to plot a TPLOT variable that can take on one of several discrete STRING values. KEYWORDS: DATA: A structure containing the elements 'x' and 'y'. LIMITS: The limits structure for the TPLOT variable. OVERPLOT: If set, data is plotted over current plot. STAT_VALS: An array of strings containing possible values for the 'y' variable. If STAT_VALS is unset, STATUSPLOT plots status bars for each unique string contained in the 'y' variable. EXAMPLE: If 'Channel' is a TPLOT variable with possible values of 'Ch1', 'Ch2', and 'Off', then the following commands will set up statusplot. options, 'Channel', 'tplot_routine', 'statusplot' options, 'Channel', 'stat_vals', ['Off', 'Ch1', 'Ch2'] tplot, 'Channel' MOD HISTORY: Original version, based on the STRPLOT procedure, created 27 May 2009 by Marc Pulupa.
(See projects/SPP/fields/util/spp_fld_statusplot.pro)
NAME:
STR_CLEAN
PURPOSE:
To remove all unprintable characters from the given string
CALLING SEQUENCE:
Result = STR_CLEAN (text, [/SPACE])
INPUTS:
Text: Scalar string of characters to be cleaned
OUTPUTS:
Result: Scalar string of characters removed of all unprintable characters
OPTIONAL INPUTS:
SPACE: removes all unprintable characters including all space chars.
EXAMPLE:
To remove all unprintable chars except space
IDL> word = STR_CLEAN ('the [tab]file is [lf][cr]')
IDL> print, word
the file is
To remove all unprintable chars including space
IDL> word = STR_CLEAN ('the [tab]file is [lf][cr]',/SPACE)
IDL> print, word
thefileis
PACKAGE LOCATION:
http://www.astro.umd.edu/~eshaya/PDS/pds4readxml.tar
MODIFICATION HISTORY:
Written by Puneet Khetarpal, January 15, 2003
(See projects/SPP/fields/util/str_clean.pro)
NAME:
XML2IDL8
PURPOSE:
Translate a DOM (Document Object Model) object (read in
from an XML file with read_xml.pro) into either an IDL hash
by recursion through the document tree. The '8' in the name
indicates this version is for IDL version 8.3 and above
as it uses ordered hashes and lists which were introduced to IDL in
version 8.3. For the IDL hash, XML element names become
key names in the hash. Elements with non-null text get a
'_text' key. Comments are attached to parent elements with
'_comment' key. Attributes are similarly treated with the
attribute name as the key. They can be distinguished from
element text by the lack of a '_text' key.
All non-essential whitespace is removed. IDL variable names are allowed
to have only the special characters '_','$', and '!', so all other
special characters are converted to '_'.
CATEGORY:
Datafile handling; XML
CALLING SEQUENCE:
myhash = XML2IDL8(oChild,nodeName=childName,nodeValue=childValue)
INPUTS:
oNode - DOM Document object (IDLffXMLDOMDocument) or top DOM Node
(IDLffXMLDOMNode) to convert to string array
OUTPUTS:
Returns a hash of hashes or lists that represents the XML file. One can access the various nodes
by indexing into it, like this:
IDL> print, hash[rootname,elName,childname,'_text']
If there are siblings with the same name, then they are pulled together in a list which
is indexed by number:
IDL> i++
IDL> print, hash[rootname,repeatedname,i,childname,'_text']
KEYWORDS:
nodeName - returns nodeName of oNode
nodeVAlue - returns nodeValue of oNode
hash - If there are children elements, this returns a hash
holding information on them
PROCEDURE:
A number of input parameters and keywords are used internally only.
They are used when the program walks through the document tree by
recursively calling itself. These are: paramArr, nodeName,
and nodeValue
MODIFICATION HISTORY:
Written by Ed Shaya / U. of Maryland [Nov 5, 2013]
Removed empty _text except for true empty elements ES [Dec 2013]
(See projects/SPP/fields/util/xml2idl8.pro)