source: gaycko/trunk/src/dom/dom.h @ 4739

Last change on this file since 4739 was 4739, checked in by Jean-Yves Lamoureux, 10 years ago
  • Added table / tr / td
File size: 1.1 KB
Line 
1#ifndef _DOM_H
2#define _DOM_H
3
4#include <libxml/parser.h>
5#include <libxml/xinclude.h>
6#include <libxml/tree.h>
7#include <libxml/xmlIO.h>
8#include <libxml/HTMLparser.h>
9
10
11typedef enum  {
12    ELEM_UNKNOW = 0,
13    ELEM_TEXT,
14    ELEM_HTML,
15    ELEM_HEAD,
16    ELEM_TITLE,
17    ELEM_META,
18    ELEM_BODY,
19    ELEM_H1,
20    ELEM_BR,
21    ELEM_P,
22    ELEM_IMG,
23    ELEM_TABLE,
24    ELEM_TR,
25    ELEM_TD
26}elementType;
27
28struct gAttribute_ {
29    char *name;
30    char *value;
31};
32typedef struct gAttribute_ gAttribute;
33
34typedef struct gElement_ gElement;
35struct gElement_ {
36    elementType  type;
37        char        *name;
38    unsigned int level;
39   
40    unsigned int attribute_count;
41    gAttribute  *attributes;
42    char        *text;
43   
44    unsigned int children_count;
45    gElement   **children;
46   
47    gElement     *parent;
48};
49
50
51struct gDOM_ {
52        gElement *root;
53};
54
55typedef struct gDOM_ gDOM;
56
57
58gDOM *gaycko_convert_dom(htmlDocPtr doc);
59gElement* explore(gElement **elem, htmlNodePtr element, unsigned int level , gElement *parent);
60gElement *add_element(htmlNodePtr node);
61void pretty_print(gElement *elem);
62#endif
Note: See TracBrowser for help on using the repository browser.