-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
33 lines (27 loc) · 1.39 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
srcML SAX2Framework
Framework provides a simplified sax2 interface built
off of libxml2 library for srcML documents. The
framework automatically handles srcML archives and
non-archives.
srcMLControlHandler provides the control mechanism
inwhich to setup and parse a srcML file. User specific
handling is specified through inheriting from the
srcMLHandler which is supplied to the parse method.
SAX2srcMLHandler implements the actual libxml2 parts and calls
the necessary handler functions from srcMLHandler. startDocument
and endDocument are called exactly once. startRoot and endRoot
are also called exactly once for the begining and ending of the
root element. startUnit and endUnit are called once each for
each inner unit. All other open and closing tags are handled
by startElementNs and endElementNs. Character data is handled
by charactersRoot called for characters that occur directly within
a root tag between units, and charactersUnit which is called
for all character data occuring within a unit. Two additional
function comment and cdataBlock are called when their XML
equivalents are encountered, however, these are not generally
included in srcML documents. Overide methods to get the
intended behaviour.
Parsing can be stopped at any point by calling stop_parser.
For usage examples, including running in a separate thread see examples.
Author: Michael John Decker
Email: [email protected]