17 #ifndef _uxmlparser_hpp_ 18 #define _uxmlparser_hpp_ 1 19 #include <ubit/udom.hpp> 51 {
return parse(docname,buffer);}
86 void readElement(
UElem* parent);
87 void readText(
UElem* parent);
88 bool readXMLDeclaration();
89 void readXMLInstruction(
UElem* parent);
90 void readSGMLData(
UElem* parent);
93 UChar readCharEntityReference();
95 bool readQuotedValue(
UStr&, UChar quoting_char);
96 bool readUnquotedValue(
UStr&);
97 bool readNameValuePair(
UStr& name,
UStr& value);
98 UElem* readElementStartTag(
UStr& elem_name,
int& stat);
99 int readElementEndTag(
const UStr& elem_name);
101 void error(
const char* msg,
const UChar* line);
102 void error(
const char* msg_start,
const UStr& name,
103 const char* msg_end,
const UChar* line);
104 void unexpected(
const char* msg,
const UChar* line);
109 static const int INVALID_TAG = 0, END_TAG = 1, END_TAG_AND_ELEM = 2;
111 bool permissive, collapse_spaces;
112 const UChar *text_buffer, *p;
UXmlDocument * readBuffer(const UStr &docname, const UStr &buffer)
synonym for parse();
Definition: uxmlparser.hpp:50
Error management.
Definition: uappli.hpp:410
XML parser.
Definition: uxmlparser.hpp:30
UXmlParser()
creates a new XML parser.
Definition: uxmlparser.cpp:667
void addGrammar(const UXmlGrammar &)
adds a grammar to the parser.
Definition: uxmlparser.cpp:682
void setPermissive(bool b)
parses documents in permissive mode (default is false).
Definition: uxmlparser.hpp:68
UXmlDocument * parse(const UStr &docname, const UStr &buffer)
reads and parses a XML buffer and returns the corresponding XML tree.
Definition: uxmlparser.cpp:701
UXmlDocument * read(const UStr &path)
reads and parses a XML file and returns the corresponding XML tree.
Definition: uxmlparser.cpp:688
lightweight general purpose container.
Definition: uelem.hpp:44
void setCollapseSpaces(bool b)
collapses whitespaces (and tabs and newlines) in elements (default is false).
Definition: uxmlparser.hpp:78
UErrorHandler * getErrorHandler()
returns the current error handler.
Definition: uxmlparser.hpp:62
Smart Pointer for UObject instances (.
Definition: uobject.hpp:365
XML Grammar.
Definition: uxmlgrammar.hpp:27
Definition: uxmlparser.hpp:32
Definition: uhardfont.hpp:31
XML Doc.
Definition: udom.hpp:106
List of XML Grammars.
Definition: uxmlgrammar.hpp:59
int getStatus()
returns the reading/parsing status.
Definition: uxmlparser.hpp:59
void setErrorHandler(UErrorHandler *eh)
changes the error handler (UAppli default handler used if argument is null).
Definition: uxmlparser.hpp:65
Ubit String.
Definition: ustr.hpp:72