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

Interface class for the wrapper between libxml C SAX parser and our NCMLParser. More...

#include <SaxParser.h>

Inheritance diagram for ncml_module::SaxParser:
Inheritance graph
Collaboration diagram for ncml_module::SaxParser:
Collaboration graph

Public Member Functions

virtual void onCharacters (const std::string &content)=0
 
virtual void onEndDocument ()=0
 
virtual void onEndElement (const std::string &name)=0
 
virtual void onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri)=0
 
virtual void onParseError (std::string msg)=0
 
virtual void onParseWarning (std::string msg)=0
 
virtual void onStartDocument ()=0
 
virtual void onStartElement (const std::string &name, const XMLAttributeMap &attrs)=0
 
virtual void onStartElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri, const XMLAttributeMap &attributes, const XMLNamespaceMap &namespaces)=0
 
virtual void setParseLineNumber (int)
 

Detailed Description

Interface class for the wrapper between libxml C SAX parser and our NCMLParser.

Also contains definition for AttrMap, which is how the attrs will be returned to the parser. The user should also be careful about making copies of any returned const reference objects (string or AttrMap) as they are only valid in memory for the scope of the handler calls!

Author
mjohnson m.joh.nosp@m.nson.nosp@m.@open.nosp@m.dap..nosp@m.org

Definition at line 48 of file SaxParser.h.

Constructor & Destructor Documentation

◆ SaxParser()

SaxParser::SaxParser ( )
protected

Definition at line 34 of file SaxParser.cc.

◆ ~SaxParser()

virtual ncml_module::SaxParser::~SaxParser ( )
inlinevirtual

Definition at line 53 of file SaxParser.h.

Member Function Documentation

◆ onCharacters()

virtual void ncml_module::SaxParser::onCharacters ( const std::string & content)
pure 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.

Implemented in ncml_module::NCMLParser, ncml_module::OtherXMLParser, and ncml_module::SimpleLocationParser.

◆ onEndElement()

virtual void ncml_module::SaxParser::onEndElement ( const std::string & name)
pure 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.

Implemented in ncml_module::NCMLParser, ncml_module::OtherXMLParser, and ncml_module::SimpleLocationParser.

◆ onEndElementWithNamespace()

virtual void ncml_module::SaxParser::onEndElementWithNamespace ( const std::string & localname,
const std::string & prefix,
const std::string & uri )
pure 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.

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

◆ onParseError()

virtual void ncml_module::SaxParser::onParseError ( std::string msg)
pure virtual

An unrecoverable parse error occurred

Implemented in ncml_module::NCMLParser, ncml_module::OtherXMLParser, and ncml_module::SimpleLocationParser.

◆ onParseWarning()

virtual void ncml_module::SaxParser::onParseWarning ( std::string msg)
pure virtual

A recoverable parse error occured.

Implemented in ncml_module::NCMLParser, ncml_module::OtherXMLParser, and ncml_module::SimpleLocationParser.

◆ onStartElement()

virtual void ncml_module::SaxParser::onStartElement ( const std::string & name,
const XMLAttributeMap & attrs )
pure 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()

Implemented in ncml_module::NCMLParser, ncml_module::OtherXMLParser, and ncml_module::SimpleLocationParser.

◆ onStartElementWithNamespace()

virtual void ncml_module::SaxParser::onStartElementWithNamespace ( const std::string & localname,
const std::string & prefix,
const std::string & uri,
const XMLAttributeMap & attributes,
const XMLNamespaceMap & namespaces )
pure 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

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

◆ setParseLineNumber()

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

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: