OMNeT++ NEDXML  5.5
SAXParser Class Reference

#include <saxparser.h>

Description

Wraps XML SAX parsers.

Expat and LibXML are supported at the moment, decided at compile-time. DTD validation is supported with LibXML.

One must provide a SAXHandler for this class to be useful.

Public Member Functions

 SAXParser ()
 
void setHandler (SAXHandler *sh)
 
bool parse (const char *filename)
 
bool parseContent (const char *content)
 
int getCurrentLineNumber ()
 
const char * getErrorMessage ()
 

Protected Member Functions

bool doParse (const char *filename, const char *content)
 

Protected Attributes

char errorText [512]
 
SAXHandlersaxHandler
 
void * currentParser
 

Constructor & Destructor Documentation

◆ SAXParser()

SAXParser ( )

Constructor

Member Function Documentation

◆ doParse()

bool doParse ( const char *  filename,
const char *  content 
)
protected

◆ setHandler()

void setHandler ( SAXHandler sh)

Install a SAX handler into the parser.

◆ parse()

bool parse ( const char *  filename)

Parse XML input read from the given file. Methods of the SAX handler will be called as the parser processes the file. Returns false if there was an error; in that case use getErrorMessage() to learn the cause of the error.

◆ parseContent()

bool parseContent ( const char *  content)

Parse the given string as XML content. Methods of the SAX handler will be called as the parser processes the file. Returns false if there was an error; in that case use getErrorMessage() to learn the cause of the error.

◆ getCurrentLineNumber()

int getCurrentLineNumber ( )

Returns the current line number in the input. Can be called from SAX handler code.

◆ getErrorMessage()

const char* getErrorMessage ( )
inline

Can be called after parse() returned false. Returns the error description.

Member Data Documentation

◆ errorText

char errorText[512]
protected

◆ saxHandler

SAXHandler* saxHandler
protected

◆ currentParser

void* currentParser
protected

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