bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
ncml_module::OtherXMLParser Class Reference

#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
 
const std::string & getString () const
 
virtual void onCharacters (const std::string &content)
 
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)
 
virtual void onParseError (std::string msg)
 
virtual void onParseWarning (std::string msg)
 
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)
 
 OtherXMLParser (NCMLParser &p)
 
void reset ()
 
virtual void setParseLineNumber (int)
 

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 47 of file OtherXMLParser.h.

Constructor & Destructor Documentation

◆ OtherXMLParser()

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

Definition at line 36 of file OtherXMLParser.cc.

◆ ~OtherXMLParser()

ncml_module::OtherXMLParser::~OtherXMLParser ( )
virtual

Definition at line 41 of file OtherXMLParser.cc.

Member Function Documentation

◆ getParseDepth()

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 46 of file OtherXMLParser.cc.

◆ getString()

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

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

Definition at line 52 of file OtherXMLParser.cc.

◆ onCharacters()

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 125 of file OtherXMLParser.cc.

◆ onEndDocument()

void ncml_module::OtherXMLParser::onEndDocument ( )
virtual

Implements ncml_module::SaxParser.

Definition at line 68 of file OtherXMLParser.cc.

◆ onEndElement()

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 83 of file OtherXMLParser.cc.

◆ onEndElementWithNamespace()

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 118 of file OtherXMLParser.cc.

◆ onParseError()

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

An unrecoverable parse error occurred

Implements ncml_module::SaxParser.

Definition at line 137 of file OtherXMLParser.cc.

◆ onParseWarning()

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

A recoverable parse error occured.

Implements ncml_module::SaxParser.

Definition at line 131 of file OtherXMLParser.cc.

◆ onStartDocument()

void ncml_module::OtherXMLParser::onStartDocument ( )
virtual

Implements ncml_module::SaxParser.

Definition at line 63 of file OtherXMLParser.cc.

◆ onStartElement()

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 73 of file OtherXMLParser.cc.

◆ onStartElementWithNamespace()

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 89 of file OtherXMLParser.cc.

◆ reset()

void ncml_module::OtherXMLParser::reset ( )

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

Definition at line 57 of file OtherXMLParser.cc.

◆ setParseLineNumber()

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 113 of file SaxParser.h.


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