OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
ncml_module::OtherXMLParser Class Reference

Class used to handle parsing in an attribute of type=="OtherXML" which basically just has to keep appending the elements and content into a string until the containing <attribute> element is closed. More...

#include <OtherXMLParser.h>

Inheritance diagram for ncml_module::OtherXMLParser:
Inheritance graph
Collaboration diagram for ncml_module::OtherXMLParser:
Collaboration graph

Public Member Functions

int getParseDepth () const
 Get the current parse depth (how many elements we've opened with onStartElement and not closed yet) It's an int so negative implies an underflow error state. More...
 
const std::string & getString () const
 Get the parsed data as big string that we've been parsing in. More...
 
virtual void onCharacters (const std::string &content)
 Called when characters are encountered within an element. More...
 
virtual void onEndDocument ()
 
virtual void onEndElement (const std::string &name)
 
virtual void onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri)
 SAX2 End element with namespace information. More...
 
virtual void onParseError (std::string msg)
 An unrecoverable parse error occurred. More...
 
virtual void onParseWarning (std::string msg)
 A recoverable parse error occured. More...
 
virtual void onStartDocument ()
 
virtual void onStartElement (const std::string &name, const XMLAttributeMap &attrs)
 
virtual void onStartElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri, const XMLAttributeMap &attributes, const XMLNamespaceMap &namespaces)
 SAX2 start element call with gets namespace information. More...
 
 OtherXMLParser (NCMLParser &p)
 
void reset ()
 Reset the string and depth so we can start parsing from scratch again. More...
 
virtual void setParseLineNumber (int)
 Before any of the callbacks are issued, this function is called to let the implementing parser know what line number in the parse the next callback is being issued from to allow for more informative error messages. More...
 
virtual ~OtherXMLParser ()
 

Detailed Description

Class used to handle parsing in an attribute of type=="OtherXML" which basically just has to keep appending the elements and content into a string until the containing <attribute> element is closed.

Subclass of SaxParser so the NCMLParser can just hand off calls to it and it can do what it needs to do, as well as give a proper error.

Definition at line 49 of file OtherXMLParser.h.

Constructor & Destructor Documentation

ncml_module::OtherXMLParser::OtherXMLParser ( NCMLParser p)
explicit

Definition at line 37 of file OtherXMLParser.cc.

ncml_module::OtherXMLParser::~OtherXMLParser ( )
virtual

Definition at line 44 of file OtherXMLParser.cc.

References reset().

Here is the call graph for this function:

Member Function Documentation

int ncml_module::OtherXMLParser::getParseDepth ( ) const

Get the current parse depth (how many elements we've opened with onStartElement and not closed yet) It's an int so negative implies an underflow error state.

Definition at line 50 of file OtherXMLParser.cc.

const std::string & ncml_module::OtherXMLParser::getString ( ) const

Get the parsed data as big string that we've been parsing in.

Definition at line 57 of file OtherXMLParser.cc.

void ncml_module::OtherXMLParser::onCharacters ( const std::string &  content)
virtual

Called when characters are encountered within an element.

content is only valid for the call duration. Note: this will return all whitespace in the document as well, which makes it messy to use.

Implements ncml_module::SaxParser.

Definition at line 146 of file OtherXMLParser.cc.

Referenced by ncml_module::NCMLParser::onCharacters().

void ncml_module::OtherXMLParser::onEndDocument ( )
virtual

Implements ncml_module::SaxParser.

Definition at line 76 of file OtherXMLParser.cc.

References THROW_NCML_INTERNAL_ERROR.

void ncml_module::OtherXMLParser::onEndElement ( const std::string &  name)
virtual
Deprecated:
We are preferring onEndElementWithNamespace() now. Called at the end of the element with the given name. The args are only valid for the duration of the call, so copy if necessary to keep.

Implements ncml_module::SaxParser.

Definition at line 93 of file OtherXMLParser.cc.

Referenced by ncml_module::NCMLParser::onEndElement().

void ncml_module::OtherXMLParser::onEndElementWithNamespace ( const std::string &  localname,
const std::string &  prefix,
const std::string &  uri 
)
virtual

SAX2 End element with namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix or "" on the element
urithe uri (or "") associated with the namespace of the element.

Implements ncml_module::SaxParser.

Definition at line 136 of file OtherXMLParser.cc.

References ncml_module::XMLAttribute::getQName().

Referenced by ncml_module::NCMLParser::onEndElementWithNamespace().

Here is the call graph for this function:

void ncml_module::OtherXMLParser::onParseError ( std::string  msg)
virtual

An unrecoverable parse error occurred.

Implements ncml_module::SaxParser.

Definition at line 160 of file OtherXMLParser.cc.

References THROW_NCML_PARSE_ERROR.

void ncml_module::OtherXMLParser::onParseWarning ( std::string  msg)
virtual

A recoverable parse error occured.

Implements ncml_module::SaxParser.

Definition at line 153 of file OtherXMLParser.cc.

References THROW_NCML_PARSE_ERROR.

void ncml_module::OtherXMLParser::onStartDocument ( )
virtual

Implements ncml_module::SaxParser.

Definition at line 70 of file OtherXMLParser.cc.

References THROW_NCML_INTERNAL_ERROR.

void ncml_module::OtherXMLParser::onStartElement ( const std::string &  name,
const XMLAttributeMap attrs 
)
virtual
Deprecated:
We are preferring onStartElementWithNamespace() now Called at the start of the element with the given name and attribute dictionary The args are only valid for the duration of the call, so copy if necessary to keep.
Parameters
namename of the element
attrsa map of any attributes -> values. Volatile for this call.
See also
onStartElementWithNamespace()

Implements ncml_module::SaxParser.

Definition at line 82 of file OtherXMLParser.cc.

Referenced by ncml_module::NCMLParser::onStartElement().

void ncml_module::OtherXMLParser::onStartElementWithNamespace ( const std::string &  localname,
const std::string &  prefix,
const std::string &  uri,
const XMLAttributeMap attributes,
const XMLNamespaceMap namespaces 
)
virtual

SAX2 start element call with gets namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix of the element, or "" if none.
urithe uri for the namespace of the element.
attributestable of the attributes (excluding namespace attributes prefixed with xmlns)
namespacetable of all the namespaces specification on this element

Implements ncml_module::SaxParser.

Definition at line 100 of file OtherXMLParser.cc.

References BESDEBUG, ncml_module::XMLNamespaceStack::getFlattenedNamespacesUsingLexicalScoping(), and ncml_module::NCMLParser::getXMLNamespaceStack().

Referenced by ncml_module::NCMLParser::onStartElementWithNamespace().

Here is the call graph for this function:

void ncml_module::OtherXMLParser::reset ( )

Reset the string and depth so we can start parsing from scratch again.

Definition at line 63 of file OtherXMLParser.cc.

Referenced by ~OtherXMLParser().

virtual void ncml_module::SaxParser::setParseLineNumber ( int  )
inlinevirtualinherited

Before any of the callbacks are issued, this function is called to let the implementing parser know what line number in the parse the next callback is being issued from to allow for more informative error messages.

(Default impl is to ignore it now).

Reimplemented in ncml_module::NCMLParser.

Definition at line 119 of file SaxParser.h.


The documentation for this class was generated from the following files: