dods.dap.XMLparser
Class DDSXMLParser

java.lang.Object
  |
  +--dods.dap.XMLparser.DDSXMLParser

public class DDSXMLParser
extends java.lang.Object

DDSXMLParser is used to parse a DDX (the XML formatted persistent representation of a DDS) into a DDS object in memory. This parser uses the Xerces XML parser and JDOM packages to perform it's duties.

Version:
$Revision: 11906 $
Author:
ndp

Constructor Summary
DDSXMLParser(java.lang.String nameSpace)
          Constructs a new DDSXMLParser.
 
Method Summary
 org.jdom.Document getLastDomDoc()
          Returns the Document object created by the most recent invocation of the parser.
static java.lang.String normalizeToXML(java.lang.String s)
          This method is used to normalize strings prior to their inclusion in XML documents.
 void parse(java.io.InputStream is, DDS targetDDS, BaseTypeFactory fac)
          Parse the DDX waiting in the InputStream and instantiate all of the member BaseType variables and their associated Attributes into a DDS using the passed BaseTypeFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDSXMLParser

public DDSXMLParser(java.lang.String nameSpace)
Constructs a new DDSXMLParser. The DODS namespace is defined during the construction of an instance of this class.

Method Detail

getLastDomDoc

public org.jdom.Document getLastDomDoc()
Returns the Document object created by the most recent invocation of the parser. This might be usefull to some XML hacker somewhere. :)

Returns:
The Document object created by the most recent invocation of the parser.

parse

public void parse(java.io.InputStream is,
                  DDS targetDDS,
                  BaseTypeFactory fac)
           throws DODSException
Parse the DDX waiting in the InputStream and instantiate all of the member BaseType variables and their associated Attributes into a DDS using the passed BaseTypeFactory

Parameters:
is - The InputStream containing the DDX to parse.
targetDDS - The DDS in which to place all of the BaseType variables and their associated Attributes.
fac - The BaseTypeFactory to use when creating new BaseType variables.
DODSException
See Also:
DDS, BaseTypeFactory

normalizeToXML

public static java.lang.String normalizeToXML(java.lang.String s)
This method is used to normalize strings prior to their inclusion in XML documents. XML has certain parsing requirements around reserved characters. These reserved characters must be replaced with symbols recognized by the XML parser as place holder for the actual symbol.

The rule for this normalization is as follows:

Parameters:
s - The String to be normalized.
Returns:
The normalized String.