Пример #1
0
static void startElement(void *user, const char *name, char **atts)
{
    if (strcasecmp(name, "TABLE") == 0) {
	htmllval.tbl = mkTbl(atts);
	state.inCell = 0;
	state.tok = T_table;
    } else if ((strcasecmp(name, "TR") == 0)
	       || (strcasecmp(name, "TH") == 0)) {
	state.inCell = 0;
	state.tok = T_row;
    } else if (strcasecmp(name, "TD") == 0) {
	state.inCell = 1;
	htmllval.cell = mkCell(atts);
	state.tok = T_cell;
    } else if (strcasecmp(name, "FONT") == 0) {
	htmllval.font = mkFont(atts);
	state.tok = T_font;
    } else if (strcasecmp(name, "BR") == 0) {
	mkBR(atts);
	state.tok = T_br;
    } else if (strcasecmp(name, "IMG") == 0) {
	htmllval.img = mkImg(atts);
	state.tok = T_img;
    } else if (strcasecmp(name, "HTML") == 0) {
	state.tok = T_html;
    } else {
	lexerror(name);
    }
}
Пример #2
0
static void startElement(void *user, const char *name, char **atts)
{
    GVC_t *gvc = (GVC_t*)user;

    if (strcasecmp(name, "TABLE") == 0) {
	htmllval.tbl = mkTbl(atts);
	state.inCell = 0;
	state.tok = T_table;
    } else if ((strcasecmp(name, "TR") == 0)
	       || (strcasecmp(name, "TH") == 0)) {
	state.inCell = 0;
	state.tok = T_row;
    } else if (strcasecmp(name, "TD") == 0) {
	state.inCell = 1;
	htmllval.cell = mkCell(atts);
	state.tok = T_cell;
    } else if (strcasecmp(name, "FONT") == 0) {
	htmllval.font = mkFont(gvc, atts, 0, 0);
	state.tok = T_font;
    } else if (strcasecmp(name, "B") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_BF, 0);
	state.tok = T_bold;
    } else if (strcasecmp(name, "S") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_S, 0);
	state.tok = T_s;
    } else if (strcasecmp(name, "U") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_UL, 1);
	state.tok = T_underline;
    } else if (strcasecmp(name, "O") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_OL, 1);
	state.tok = T_overline;
    } else if (strcasecmp(name, "I") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_IF, 0);
	state.tok = T_italic;
    } else if (strcasecmp(name, "SUP") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_SUP, 0);
	state.tok = T_sup;
    } else if (strcasecmp(name, "SUB") == 0) {
	htmllval.font = mkFont(gvc, 0, HTML_SUB, 0);
	state.tok = T_sub;
    } else if (strcasecmp(name, "BR") == 0) {
	mkBR(atts);
	state.tok = T_br;
    } else if (strcasecmp(name, "HR") == 0) {
	state.tok = T_hr;
    } else if (strcasecmp(name, "VR") == 0) {
	state.tok = T_vr;
    } else if (strcasecmp(name, "IMG") == 0) {
	htmllval.img = mkImg(atts);
	state.tok = T_img;
    } else if (strcasecmp(name, "HTML") == 0) {
	state.tok = T_html;
    } else {
	lexerror(name);
    }
}