2 * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_ixhtml10.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_conv_z2h.h"
26 #include "chxj_header_inf.h"
27 #include "chxj_google.h"
30 #define GET_IXHTML10(X) ((ixhtml10_t *)(X))
33 #define W_L(X) do { ixhtml10->out = BUFFERED_WRITE_LITERAL(ixhtml10->out, &doc->buf, (X)); } while(0)
34 #define W_V(X) do { ixhtml10->out = (X) ? BUFFERED_WRITE_VALUE(ixhtml10->out, &doc->buf, (X)) \
35 : BUFFERED_WRITE_LITERAL(ixhtml10->out, &doc->buf, ""); } while(0)
37 #define W_NLCODE() do { char *nlcode = TO_NLCODE(ixhtml10->conf); W_V(nlcode); } while (0)
39 static char *s_ixhtml10_start_html_tag (void *pdoc, Node *node);
40 static char *s_ixhtml10_end_html_tag (void *pdoc, Node *node);
41 static char *s_ixhtml10_start_meta_tag (void *pdoc, Node *node);
42 static char *s_ixhtml10_end_meta_tag (void *pdoc, Node *node);
43 static char *s_ixhtml10_start_head_tag (void *pdoc, Node *node);
44 static char *s_ixhtml10_end_head_tag (void *pdoc, Node *node);
45 static char *s_ixhtml10_start_title_tag (void *pdoc, Node *node);
46 static char *s_ixhtml10_end_title_tag (void *pdoc, Node *node);
47 static char *s_ixhtml10_start_base_tag (void *pdoc, Node *node);
48 static char *s_ixhtml10_end_base_tag (void *pdoc, Node *node);
49 static char *s_ixhtml10_start_body_tag (void *pdoc, Node *node);
50 static char *s_ixhtml10_end_body_tag (void *pdoc, Node *node);
51 static char *s_ixhtml10_start_a_tag (void *pdoc, Node *node);
52 static char *s_ixhtml10_end_a_tag (void *pdoc, Node *node);
53 static char *s_ixhtml10_start_pre_tag (void *pdoc, Node *node);
54 static char *s_ixhtml10_end_pre_tag (void *pdoc, Node *node);
55 static char *s_ixhtml10_start_p_tag (void *pdoc, Node *node);
56 static char *s_ixhtml10_end_p_tag (void *pdoc, Node *node);
57 static char *s_ixhtml10_start_ul_tag (void *pdoc, Node *node);
58 static char *s_ixhtml10_end_ul_tag (void *pdoc, Node *node);
59 static char *s_ixhtml10_start_ol_tag (void *pdoc, Node *node);
60 static char *s_ixhtml10_end_ol_tag (void *pdoc, Node *node);
61 static char *s_ixhtml10_start_li_tag (void *pdoc, Node *node);
62 static char *s_ixhtml10_end_li_tag (void *pdoc, Node *node);
63 static char *s_ixhtml10_start_br_tag (void *pdoc, Node *node);
64 static char *s_ixhtml10_end_br_tag (void *pdoc, Node *node);
65 static char *s_ixhtml10_start_table_tag (void *pdoc, Node *node);
66 static char *s_ixhtml10_end_table_tag (void *pdoc, Node *node);
67 static char *s_ixhtml10_start_tr_tag (void *pdoc, Node *node);
68 static char *s_ixhtml10_end_tr_tag (void *pdoc, Node *node);
69 static char *s_ixhtml10_start_th_tag (void *pdoc, Node *node);
70 static char *s_ixhtml10_end_th_tag (void *pdoc, Node *node);
71 static char *s_ixhtml10_start_td_tag (void *pdoc, Node *node);
72 static char *s_ixhtml10_end_td_tag (void *pdoc, Node *node);
73 static char *s_ixhtml10_start_td_or_th_tag (void *pdoc, Node *node,char *tagName);
74 static char *s_ixhtml10_end_td_or_th_tag (void *pdoc, Node *node,char *tagName);
75 static char *s_ixhtml10_start_font_tag (void *pdoc, Node *node);
76 static char *s_ixhtml10_end_font_tag (void *pdoc, Node *node);
77 static char *s_ixhtml10_start_form_tag (void *pdoc, Node *node);
78 static char *s_ixhtml10_end_form_tag (void *pdoc, Node *node);
79 static char *s_ixhtml10_start_input_tag (void *pdoc, Node *node);
80 static char *s_ixhtml10_end_input_tag (void *pdoc, Node *node);
81 static char *s_ixhtml10_start_center_tag (void *pdoc, Node *node);
82 static char *s_ixhtml10_end_center_tag (void *pdoc, Node *node);
83 static char *s_ixhtml10_start_hr_tag (void *pdoc, Node *node);
84 static char *s_ixhtml10_end_hr_tag (void *pdoc, Node *node);
85 static char *s_ixhtml10_start_img_tag (void *pdoc, Node *node);
86 static char *s_ixhtml10_end_img_tag (void *pdoc, Node *node);
87 static char *s_ixhtml10_start_select_tag (void *pdoc, Node *node);
88 static char *s_ixhtml10_end_select_tag (void *pdoc, Node *node);
89 static char *s_ixhtml10_start_option_tag (void *pdoc, Node *node);
90 static char *s_ixhtml10_end_option_tag (void *pdoc, Node *node);
91 static char *s_ixhtml10_start_div_tag (void *pdoc, Node *node);
92 static char *s_ixhtml10_end_div_tag (void *pdoc, Node *node);
93 static char *s_ixhtml10_start_textarea_tag (void *pdoc, Node *node);
94 static char *s_ixhtml10_end_textarea_tag (void *pdoc, Node *node);
95 static char *s_ixhtml10_start_b_tag (void *pdoc, Node *node);
96 static char *s_ixhtml10_end_b_tag (void *pdoc, Node *node);
97 static char *s_ixhtml10_chxjif_tag (void *pdoc, Node *node);
98 static char *s_ixhtml10_text_tag (void *pdoc, Node *node);
99 static char *s_ixhtml10_start_blockquote_tag (void *pdoc, Node *node);
100 static char *s_ixhtml10_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_ixhtml10_start_dir_tag (void *pdoc, Node *node);
102 static char *s_ixhtml10_end_dir_tag (void *pdoc, Node *node);
103 static char *s_ixhtml10_start_dl_tag (void *pdoc, Node *node);
104 static char *s_ixhtml10_end_dl_tag (void *pdoc, Node *node);
105 static char *s_ixhtml10_start_dt_tag (void *pdoc, Node *node);
106 static char *s_ixhtml10_end_dt_tag (void *pdoc, Node *node);
107 static char *s_ixhtml10_start_dd_tag (void *pdoc, Node *node);
108 static char *s_ixhtml10_end_dd_tag (void *pdoc, Node *node);
109 static char *s_ixhtml10_start_h1_tag (void *pdoc, Node *node);
110 static char *s_ixhtml10_end_h1_tag (void *pdoc, Node *node);
111 static char *s_ixhtml10_start_h2_tag (void *pdoc, Node *node);
112 static char *s_ixhtml10_end_h2_tag (void *pdoc, Node *node);
113 static char *s_ixhtml10_start_h3_tag (void *pdoc, Node *node);
114 static char *s_ixhtml10_end_h3_tag (void *pdoc, Node *node);
115 static char *s_ixhtml10_start_h4_tag (void *pdoc, Node *node);
116 static char *s_ixhtml10_end_h4_tag (void *pdoc, Node *node);
117 static char *s_ixhtml10_start_h5_tag (void *pdoc, Node *node);
118 static char *s_ixhtml10_end_h5_tag (void *pdoc, Node *node);
119 static char *s_ixhtml10_start_h6_tag (void *pdoc, Node *node);
120 static char *s_ixhtml10_end_h6_tag (void *pdoc, Node *node);
121 static char *s_ixhtml10_start_menu_tag (void *pdoc, Node *node);
122 static char *s_ixhtml10_end_menu_tag (void *pdoc, Node *node);
123 static char *s_ixhtml10_start_plaintext_tag (void *pdoc, Node *node);
124 static char *s_ixhtml10_start_plaintext_tag_inner (void *pdoc, Node *node);
125 static char *s_ixhtml10_end_plaintext_tag (void *pdoc, Node *node);
126 static char *s_ixhtml10_start_blink_tag (void *pdoc, Node *node);
127 static char *s_ixhtml10_end_blink_tag (void *pdoc, Node *node);
128 static char *s_ixhtml10_start_marquee_tag (void *pdoc, Node *node);
129 static char *s_ixhtml10_end_marquee_tag (void *pdoc, Node *node);
130 static char *s_ixhtml10_newline_mark (void *pdoc, Node *node);
131 static char *s_ixhtml10_link_tag (void *pdoc, Node *node);
132 static char *s_ixhtml10_start_span_tag (void *pdoc, Node *node);
133 static char *s_ixhtml10_end_span_tag (void *pdoc, Node *node);
134 static char *s_ixhtml10_style_tag (void *pdoc, Node *node);
135 static char *s_ixhtml10_create_style_data(apr_pool_t *pool, const char *style_data);
136 static char *s_ixhtml10_start_nobr_tag (void *pdoc, Node *node);
137 static char *s_ixhtml10_end_nobr_tag (void *pdoc, Node *node);
138 static char *s_ixhtml10_start_small_tag (void *pdoc, Node *node);
139 static char *s_ixhtml10_end_small_tag (void *pdoc, Node *node);
140 static char *s_ixhtml10_start_object_tag (void *pdoc, Node *node);
141 static char *s_ixhtml10_end_object_tag (void *pdoc, Node *node);
142 static char *s_ixhtml10_start_param_tag (void *pdoc, Node *node);
143 static char *s_ixhtml10_start_caption_tag (void *pdoc, Node *node);
144 static char *s_ixhtml10_end_caption_tag (void *pdoc, Node *node);
146 static void s_init_ixhtml10(ixhtml10_t *ixhtml10, Doc *doc, request_rec *r, device_table *spec);
148 static int s_ixhtml10_search_emoji(ixhtml10_t *ixhtml10, char *txt, char **rslt,Node *node);
150 static char *s_ixhtml10_istyle_to_wap_input_format(apr_pool_t *p, const char *s);
151 static css_prop_list_t *s_ixhtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
152 static css_prop_list_t *s_ixhtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
157 tag_handler ixhtml10_handler[] = {
160 s_ixhtml10_start_html_tag,
161 s_ixhtml10_end_html_tag,
165 s_ixhtml10_start_meta_tag,
166 s_ixhtml10_end_meta_tag,
170 s_ixhtml10_start_textarea_tag,
171 s_ixhtml10_end_textarea_tag,
175 s_ixhtml10_start_p_tag,
176 s_ixhtml10_end_p_tag,
180 s_ixhtml10_start_pre_tag,
181 s_ixhtml10_end_pre_tag,
185 s_ixhtml10_start_ul_tag,
186 s_ixhtml10_end_ul_tag,
190 s_ixhtml10_start_li_tag,
191 s_ixhtml10_end_li_tag,
195 s_ixhtml10_start_ol_tag,
196 s_ixhtml10_end_ol_tag,
200 s_ixhtml10_start_h1_tag,
201 s_ixhtml10_end_h1_tag,
205 s_ixhtml10_start_h2_tag,
206 s_ixhtml10_end_h2_tag,
210 s_ixhtml10_start_h3_tag,
211 s_ixhtml10_end_h3_tag,
215 s_ixhtml10_start_h4_tag,
216 s_ixhtml10_end_h4_tag,
220 s_ixhtml10_start_h5_tag,
221 s_ixhtml10_end_h5_tag,
225 s_ixhtml10_start_h6_tag,
226 s_ixhtml10_end_h6_tag,
230 s_ixhtml10_start_head_tag,
231 s_ixhtml10_end_head_tag,
235 s_ixhtml10_start_title_tag,
236 s_ixhtml10_end_title_tag,
240 s_ixhtml10_start_base_tag,
241 s_ixhtml10_end_base_tag,
245 s_ixhtml10_start_body_tag,
246 s_ixhtml10_end_body_tag,
250 s_ixhtml10_start_a_tag,
251 s_ixhtml10_end_a_tag,
255 s_ixhtml10_start_br_tag,
256 s_ixhtml10_end_br_tag,
260 s_ixhtml10_start_table_tag,
261 s_ixhtml10_end_table_tag,
265 s_ixhtml10_start_tr_tag,
266 s_ixhtml10_end_tr_tag,
270 s_ixhtml10_start_td_tag,
271 s_ixhtml10_end_td_tag,
280 s_ixhtml10_start_font_tag,
281 s_ixhtml10_end_font_tag,
285 s_ixhtml10_start_form_tag,
286 s_ixhtml10_end_form_tag,
290 s_ixhtml10_start_input_tag,
291 s_ixhtml10_end_input_tag,
295 s_ixhtml10_start_center_tag,
296 s_ixhtml10_end_center_tag,
300 s_ixhtml10_start_hr_tag,
301 s_ixhtml10_end_hr_tag,
305 s_ixhtml10_start_img_tag,
306 s_ixhtml10_end_img_tag,
310 s_ixhtml10_start_select_tag,
311 s_ixhtml10_end_select_tag,
315 s_ixhtml10_start_option_tag,
316 s_ixhtml10_end_option_tag,
320 s_ixhtml10_start_div_tag,
321 s_ixhtml10_end_div_tag,
325 s_ixhtml10_chxjif_tag,
330 s_ixhtml10_chxjif_tag,
335 s_ixhtml10_start_nobr_tag,
336 s_ixhtml10_end_nobr_tag,
340 s_ixhtml10_start_small_tag,
341 s_ixhtml10_end_small_tag,
345 s_ixhtml10_style_tag,
350 s_ixhtml10_start_span_tag,
351 s_ixhtml10_end_span_tag,
360 s_ixhtml10_start_th_tag,
361 s_ixhtml10_end_th_tag,
365 s_ixhtml10_start_b_tag,
366 s_ixhtml10_end_b_tag,
375 s_ixhtml10_start_dt_tag,
376 s_ixhtml10_end_dt_tag,
390 s_ixhtml10_start_blockquote_tag,
391 s_ixhtml10_end_blockquote_tag,
395 s_ixhtml10_start_dir_tag,
396 s_ixhtml10_end_dir_tag,
400 s_ixhtml10_start_dl_tag,
401 s_ixhtml10_end_dl_tag,
405 s_ixhtml10_start_dd_tag,
406 s_ixhtml10_end_dd_tag,
410 s_ixhtml10_start_menu_tag,
411 s_ixhtml10_end_menu_tag,
415 s_ixhtml10_start_plaintext_tag,
416 s_ixhtml10_end_plaintext_tag,
420 s_ixhtml10_start_blink_tag,
421 s_ixhtml10_end_blink_tag,
425 s_ixhtml10_start_marquee_tag,
426 s_ixhtml10_end_marquee_tag,
435 s_ixhtml10_newline_mark,
440 s_ixhtml10_start_object_tag,
441 s_ixhtml10_end_object_tag,
445 s_ixhtml10_start_param_tag,
450 s_ixhtml10_start_caption_tag,
451 s_ixhtml10_end_caption_tag,
457 * converts from CHTML5.0 to IXHTML10.
459 * @param r [i] Requet_rec is appointed.
460 * @param spec [i] The result of the device specification processing which
461 * was done in advance is appointed.
462 * @param src [i] The character string before the converting is appointed.
463 * @return The character string after the converting is returned.
466 chxj_convert_ixhtml10(
472 chxjconvrule_entry *entryp,
483 /*--------------------------------------------------------------------------*/
485 /*--------------------------------------------------------------------------*/
487 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
489 DBG(r,"REQ[%X] found qrcode xml",TO_ADDR(r));
493 /*--------------------------------------------------------------------------*/
494 /* The CHTML structure is initialized. */
495 /*--------------------------------------------------------------------------*/
496 s_init_ixhtml10(&ixhtml10, &doc, r, spec);
498 ixhtml10.entryp = entryp;
499 ixhtml10.cookie = cookie;
501 if (strcasecmp(spec->output_encoding,"UTF-8") == 0 ){
502 apr_table_setn(r->headers_out,HTTP_X_CHXJ_SET_CONTENT_TYPE,"application/xhtml+xml; charset=UTF-8");
504 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Shift_JIS"));
506 /*--------------------------------------------------------------------------*/
507 /* The character string of the input is analyzed. */
508 /*--------------------------------------------------------------------------*/
509 qs_init_malloc(&doc);
510 qs_init_root_node(&doc);
512 ss = apr_pcalloc(r->pool, srclen + 1);
514 memset(ss, 0, srclen + 1);
515 memcpy(ss, src, srclen);
517 if (IS_CSS_ON(ixhtml10.entryp)) {
518 /* current property list */
519 ixhtml10.css_prop_stack = chxj_new_prop_list_stack(&doc);
522 chxj_dump_out("[src] CHTML -> IXHTML10", ss, srclen);
525 qs_parse_string(&doc,ss,strlen(ss));
527 chxj_buffered_write_init(r->pool, &doc.buf);
528 /*--------------------------------------------------------------------------*/
529 /* It converts it from CHTML to IXHTML10. */
530 /*--------------------------------------------------------------------------*/
531 chxj_node_convert(spec,r,(void*)&ixhtml10, &doc, qs_get_root(&doc), 0);
532 ixhtml10.out = chxj_buffered_write_flush(ixhtml10.out, &doc.buf);
533 dst = apr_pstrcat(r->pool, (! ixhtml10.prev_style_data) ? "" : ixhtml10.prev_style_data,
534 s_ixhtml10_create_style_data(doc.pool, ixhtml10.style_data),
536 chxj_buffered_write_terminate(&doc.buf);
539 qs_all_free(&doc,QX_LOGMARK);
542 return apr_pstrdup(r->pool,ss);
545 dst = apr_psprintf(r->pool, "\n");
547 *dstlen = strlen(dst);
550 chxj_dump_out("[dst] CHTML -> IXHTML10", dst, *dstlen);
558 * The IXHTML10 structure is initialized.
560 * @param ixhtml10 [i/o] The pointer to the IXHTML10 structure that wants to be
561 * initialized is specified.
562 * @param doc [i] The Doc structure that should be set to the initialized
563 * IXHTML10 structure is specified.
564 * @param r [i] To use POOL, the pointer to request_rec is specified.
565 * @param spec [i] The pointer to the device_table
568 s_init_ixhtml10(ixhtml10_t *ixhtml10, Doc *doc, request_rec *r, device_table *spec)
570 memset(doc, 0, sizeof(Doc));
571 memset(ixhtml10, 0, sizeof(ixhtml10_t));
575 ixhtml10->spec = spec;
576 ixhtml10->out = qs_alloc_zero_byte_string(r->pool);
577 ixhtml10->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
578 ixhtml10->doc->parse_mode = PARSE_MODE_CHTML;
579 ixhtml10->prev_style_data = NULL;
580 ixhtml10->style_data = NULL;
585 * Corresponding EMOJI to a current character-code is retrieved.
586 * The substitution character string is stored in the rslt pointer if agreeing.
588 * @param ixhtml10 [i] The pointer to the IXHTML10 structure is specified.
589 * @param txt [i] The character string to want to examine whether it is
590 * EMOJI is specified.
591 * @param rslt [o] The pointer to the pointer that stores the result is
593 * @param node [i] The current node to check whether tag is span/font for CHXJ_IMODE_EMOJI_COLOR_AUTO.
594 * @return When corresponding EMOJI exists, it returns it excluding 0.
597 s_ixhtml10_search_emoji(ixhtml10_t *ixhtml10, char *txt, char **rslt, Node *node)
604 spec = ixhtml10->spec;
607 r = ixhtml10->doc->r;
610 DBG(r,"REQ[%X] spec is NULL",TO_ADDR(r));
614 for (ee = ixhtml10->conf->emoji;
617 if (ee->imode == NULL) {
618 DBG(r,"REQ[%X] emoji->imode is NULL",TO_ADDR(r));
622 if (ee->imode->string != NULL
623 && strlen(ee->imode->string) > 0
624 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
626 if (spec == NULL || spec->emoji_type == NULL) {
627 *rslt = apr_palloc(r->pool, 3);
628 (*rslt)[0] = ee->imode->hex1byte & 0xff;
629 (*rslt)[1] = ee->imode->hex2byte & 0xff;
632 if(ixhtml10->conf->imode_emoji_color >= CHXJ_IMODE_EMOJI_COLOR_AUTO ){
633 if(ee->imode->color != NULL){
634 if(ixhtml10->conf->imode_emoji_color == CHXJ_IMODE_EMOJI_COLOR_AUTO ){
635 if(strcasecmp(node->parent->name, "span") == 0 ||
636 strcasecmp(node->parent->name, "font") == 0 ){
637 return strlen(ee->imode->string);
640 char *tmp = apr_pstrdup(r->pool,*rslt);
641 *rslt = apr_psprintf(r->pool,
642 "<span style=\"color:%s\">%s</span>",ee->imode->color,tmp);
645 return strlen(ee->imode->string);
656 * It is a handler who processes the HTML tag.
658 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
659 * destination is specified.
660 * @param node [i] The HTML tag node is specified.
661 * @return The conversion result is returned.
664 s_ixhtml10_start_html_tag(void *pdoc, Node *UNUSED(node))
666 ixhtml10_t *ixhtml10;
671 ixhtml10 = GET_IXHTML10(pdoc);
674 DBG(r,"REQ[%X] start %s()",TO_ADDR(r),__func__);
676 W_L("<?xml version=\"1.0\" encoding=\"");
677 W_V(ixhtml10->spec->output_encoding);
680 W_L("<!DOCTYPE html PUBLIC \"-//i-mode group (ja)//DTD XHTML i-XHTML(Locale/Ver.=ja/2.0) 1.0//EN\" \"i-xhtml_4ja_10.dtd\">");
683 /*--------------------------------------------------------------------------*/
685 /*--------------------------------------------------------------------------*/
686 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"ja\" xml:lang=\"ja\">");
688 DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
690 ixhtml10->start_html_flag = 1;
691 return ixhtml10->out;
696 * It is a handler who processes the HTML tag.
698 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
699 * destination is specified.
700 * @param node [i] The HTML tag node is specified.
701 * @return The conversion result is returned.
704 s_ixhtml10_end_html_tag(void *pdoc, Node *UNUSED(child))
706 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
707 Doc *doc = ixhtml10->doc;
711 return ixhtml10->out;
716 * It is a handler who processes the META tag.
718 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
719 * destination is specified.
720 * @param node [i] The META tag node is specified.
721 * @return The conversion result is returned.
724 s_ixhtml10_start_meta_tag(void *pdoc, Node *node)
726 ixhtml10_t *ixhtml10;
730 int content_type_flag;
733 ixhtml10 = GET_IXHTML10(pdoc);
737 content_type_flag = 0;
740 /*--------------------------------------------------------------------------*/
742 /*--------------------------------------------------------------------------*/
743 for (attr = qs_get_attr(doc,node);
745 attr = qs_get_next_attr(doc,attr)) {
746 char *name = qs_get_attr_name(doc,attr);
747 char *value = qs_get_attr_value(doc,attr);
751 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
752 /*----------------------------------------------------------------------*/
754 /*----------------------------------------------------------------------*/
755 W_L(" http-equiv=\"");
758 if (STRCASEEQ('c','C',"content-type",value)) {
759 content_type_flag = 1;
761 if (STRCASEEQ('r','R',"refresh",value)) {
769 if (strcasecmp(name, "content") == 0 && value && *value) {
770 /*----------------------------------------------------------------------*/
772 /*----------------------------------------------------------------------*/
773 if (content_type_flag) {
777 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Shift_JIS"));
786 buf = apr_pstrdup(r->pool, value);
788 url = strchr(buf, ';');
790 sec = apr_pstrdup(r->pool, buf);
793 url = chxj_encoding_parameter(r, url, 1);
814 if (strcasecmp(name, "name") == 0 && value && *value) {
825 return ixhtml10->out;
830 * It is a handler who processes the META tag.
832 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
833 * destination is specified.
834 * @param node [i] The META tag node is specified.
835 * @return The conversion result is returned.
838 s_ixhtml10_end_meta_tag(void *pdoc, Node *UNUSED(child))
840 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
842 return ixhtml10->out;
847 * It is a handler who processes the HEAD tag.
849 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
850 * destination is specified.
851 * @param node [i] The HEAD tag node is specified.
852 * @return The conversion result is returned.
855 s_ixhtml10_start_head_tag(void *pdoc, Node *UNUSED(node))
857 ixhtml10_t *ixhtml10;
861 ixhtml10 = GET_IXHTML10(pdoc);
866 return ixhtml10->out;
871 * It is a handler who processes the HEAD tag.
873 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
874 * destination is specified.
875 * @param node [i] The HEAD tag node is specified.
876 * @return The conversion result is returned.
879 s_ixhtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
881 ixhtml10_t *ixhtml10;
885 ixhtml10 = GET_IXHTML10(pdoc);
889 ixhtml10->out = chxj_buffered_write_flush(ixhtml10->out, &doc->buf);
890 ixhtml10->prev_style_data = apr_pstrdup(doc->pool, ixhtml10->out);
891 ixhtml10->out = qs_alloc_zero_byte_string(r->pool);
894 return ixhtml10->out;
899 * It is a handler who processes the TITLE tag.
901 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
902 * destination is specified.
903 * @param node [i] The TITLE tag node is specified.
904 * @return The conversion result is returned.
907 s_ixhtml10_start_title_tag(void *pdoc, Node *node)
909 ixhtml10_t *ixhtml10;
913 ixhtml10 = GET_IXHTML10(pdoc);
919 if (ixhtml10->conf->use_google_analytics) {
920 ixhtml10->pagetitle = "";
922 for (child = qs_get_child_node(doc,node);
924 child = qs_get_next_node(doc,child)) {
925 char *textval = qs_get_node_value(doc,child);
926 ixhtml10->pagetitle = apr_pstrcat(doc->r->pool, ixhtml10->pagetitle, textval, NULL);
930 return ixhtml10->out;
935 * It is a handler who processes the TITLE tag.
937 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
938 * destination is specified.
939 * @param node [i] The TITLE tag node is specified.
940 * @return The conversion result is returned.
943 s_ixhtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
945 ixhtml10_t *ixhtml10;
949 ixhtml10 = GET_IXHTML10(pdoc);
954 return ixhtml10->out;
959 * It is a handler who processes the BASE tag.
961 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
962 * destination is specified.
963 * @param node [i] The BASE tag node is specified.
964 * @return The conversion result is returned.
967 s_ixhtml10_start_base_tag(void *pdoc, Node *node)
969 ixhtml10_t *ixhtml10;
974 ixhtml10 = GET_IXHTML10(pdoc);
979 /*--------------------------------------------------------------------------*/
981 /*--------------------------------------------------------------------------*/
982 for (attr = qs_get_attr(doc,node);
984 attr = qs_get_next_attr(doc,attr)) {
985 char *name = qs_get_attr_name(doc,attr);
986 char *value = qs_get_attr_value(doc,attr);
987 if (STRCASEEQ('h','H',"href",name)) {
994 return ixhtml10->out;
999 * It is a handler who processes the BASE tag.
1001 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1002 * destination is specified.
1003 * @param node [i] The BASE tag node is specified.
1004 * @return The conversion result is returned.
1007 s_ixhtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
1009 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
1010 return ixhtml10->out;
1015 * It is a handler who processes the BODY tag.
1017 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1018 * destination is specified.
1019 * @param node [i] The BODY tag node is specified.
1020 * @return The conversion result is returned.
1023 s_ixhtml10_start_body_tag(void *pdoc, Node *node)
1025 ixhtml10_t *ixhtml10;
1029 char *attr_bgcolor = NULL;
1030 char *attr_text = NULL;
1031 char *attr_link = NULL;
1032 char *attr_vlink = NULL;
1033 char *attr_alink = NULL;
1034 char *attr_style = NULL;
1035 char *attr_background = NULL;
1037 ixhtml10 = GET_IXHTML10(pdoc);
1038 doc = ixhtml10->doc;
1041 /*--------------------------------------------------------------------------*/
1042 /* Get Attributes */
1043 /*--------------------------------------------------------------------------*/
1044 for (attr = qs_get_attr(doc,node);
1046 attr = qs_get_next_attr(doc,attr)) {
1047 char *name = qs_get_attr_name(doc,attr);
1048 char *value = qs_get_attr_value(doc,attr);
1049 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1050 /*----------------------------------------------------------------------*/
1052 /*----------------------------------------------------------------------*/
1053 attr_bgcolor = value;
1055 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1061 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1062 /*----------------------------------------------------------------------*/
1064 /*----------------------------------------------------------------------*/
1067 else if (STRCASEEQ('a','A',"alink",name) && value && *value) {
1068 /*----------------------------------------------------------------------*/
1070 /*----------------------------------------------------------------------*/
1073 else if (STRCASEEQ('v','V',"vlink",name) && value && *value) {
1074 /*----------------------------------------------------------------------*/
1076 /*----------------------------------------------------------------------*/
1079 else if (STRCASEEQ('b','B',"background",name) && value && *value) {
1080 /*----------------------------------------------------------------------*/
1082 /*----------------------------------------------------------------------*/
1083 attr_background = value;
1085 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1090 if (IS_CSS_ON(ixhtml10->entryp)) {
1091 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1093 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1094 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1095 css_property_t *bgimage_prop = chxj_css_get_property_value(doc, style, "background-image");
1096 css_property_t *cur;
1097 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1098 if (cur->value && *cur->value) {
1099 attr_text = apr_pstrdup(doc->pool, cur->value);
1102 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1103 if (cur->value && *cur->value) {
1104 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1107 for (cur = bgimage_prop->next; cur != bgimage_prop; cur = cur->next) {
1108 if (cur->value && *cur->value) {
1109 char *tmp = apr_pstrdup(doc->pool, cur->value);
1110 char *tmps = strstr(tmp,"(");
1112 char *tmpe = strstr(tmp,")");
1113 size_t len = strlen(tmps) - strlen(tmpe) -1 ;
1115 attr_background = apr_pstrndup(doc->pool, tmps,len);
1120 if (ixhtml10->style) {
1121 css_stylesheet_t *pseudos = chxj_find_pseudo_selectors(doc, ixhtml10->style);
1122 css_selector_t *cur_sel;
1123 for (cur_sel = pseudos->selector_head.next; cur_sel != &pseudos->selector_head; cur_sel = cur_sel->next) {
1124 if (cur_sel->name && strcasecmp(cur_sel->name, "a:link") == 0) {
1125 css_property_t *cur;
1126 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1127 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1128 attr_link = apr_pstrdup(doc->pool, cur->value);
1132 else if (cur_sel->name && strcasecmp(cur_sel->name, "a:visited") == 0) {
1133 css_property_t *cur;
1134 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1135 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1136 attr_vlink = apr_pstrdup(doc->pool, cur->value);
1140 else if (cur_sel->name && strcasecmp(cur_sel->name, "a:focus") == 0) {
1141 css_property_t *cur;
1142 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1143 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1144 attr_alink = apr_pstrdup(doc->pool, cur->value);
1154 if (attr_bgcolor || attr_text || attr_background) {
1157 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1158 W_L("background-color:");
1163 attr_text = chxj_css_rgb_func_to_value(doc->pool, attr_text);
1168 if( attr_background) {
1169 W_L("background-image:url(");
1170 W_V(attr_background);
1176 char *style_data = NULL;
1178 attr_link = chxj_css_rgb_func_to_value(doc->pool, attr_link);
1179 style_data = apr_psprintf(doc->pool, "a:link { color:%s; }", attr_link);
1182 attr_vlink = chxj_css_rgb_func_to_value(doc->pool, attr_vlink);
1183 style_data = apr_pstrcat(doc->pool, (style_data) ? style_data : "",
1184 apr_psprintf(doc->pool, "a:visited { color:%s; }", attr_vlink), NULL);
1187 attr_alink = chxj_css_rgb_func_to_value(doc->pool, attr_alink);
1188 style_data = apr_pstrcat(doc->pool, (style_data) ? style_data : "",
1189 apr_psprintf(doc->pool, "a:focus { color:%s; }", attr_alink), NULL);
1192 ixhtml10->style_data = apr_pstrcat(doc->pool, (ixhtml10->style_data) ? ixhtml10->style_data : "",
1196 return ixhtml10->out;
1201 * It is a handler who processes the BODY tag.
1203 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1204 * destination is specified.
1205 * @param node [i] The BODY tag node is specified.
1206 * @return The conversion result is returned.
1209 s_ixhtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1211 ixhtml10_t *ixhtml10;
1215 ixhtml10 = GET_IXHTML10(pdoc);
1216 doc = ixhtml10->doc;
1219 if (ixhtml10->conf->use_google_analytics) {
1220 char *src = chxj_google_analytics_get_image_url(r, ixhtml10->pagetitle);
1228 if (IS_CSS_ON(ixhtml10->entryp)) {
1229 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1231 return ixhtml10->out;
1236 * It is a handler who processes the A tag.
1238 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1239 * destination is specified.
1240 * @param node [i] The A tag node is specified.
1241 * @return The conversion result is returned.
1244 s_ixhtml10_start_a_tag(void *pdoc, Node *node)
1246 ixhtml10_t *ixhtml10;
1250 char *attr_style = NULL;
1251 char *attr_id = NULL;
1252 char *attr_lcs = NULL;
1254 ixhtml10 = GET_IXHTML10(pdoc);
1255 doc = ixhtml10->doc;
1259 /*--------------------------------------------------------------------------*/
1260 /* Get Attributes */
1261 /*--------------------------------------------------------------------------*/
1262 for (attr = qs_get_attr(doc,node);
1264 attr = qs_get_next_attr(doc,attr)) {
1265 char *name = qs_get_attr_name(doc,attr);
1266 char *value = qs_get_attr_value(doc,attr);
1267 if (STRCASEEQ('i','I',"id",name)){
1268 attr_id = apr_pstrdup(doc->buf.pool, value);
1270 if (STRCASEEQ('n','N',"name",name)) {
1271 /*----------------------------------------------------------------------*/
1273 /*----------------------------------------------------------------------*/
1274 attr_id = apr_pstrdup(doc->buf.pool, value);
1276 else if (STRCASEEQ('h','H',"href",name)) {
1277 /*----------------------------------------------------------------------*/
1279 /*----------------------------------------------------------------------*/
1280 value = chxj_encoding_parameter(r, value, 1);
1281 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1282 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
1288 else if (STRCASEEQ('a','A',"accesskey",name)) {
1289 /*----------------------------------------------------------------------*/
1291 /*----------------------------------------------------------------------*/
1292 W_L(" accesskey=\"");
1296 else if (STRCASEEQ('c','C',"cti",name)) {
1297 /*----------------------------------------------------------------------*/
1299 /*----------------------------------------------------------------------*/
1304 else if (STRCASEEQ('i','I',"ijam",name)) {
1305 /*----------------------------------------------------------------------*/
1307 /*----------------------------------------------------------------------*/
1310 else if (STRCASEEQ('u','U',"utn",name)) {
1311 /*----------------------------------------------------------------------*/
1313 /* It is special only for CHTML. */
1314 /*----------------------------------------------------------------------*/
1315 W_L(" utn=\"utn\"");
1317 else if (STRCASEEQ('t','T',"telbook",name)) {
1318 /*----------------------------------------------------------------------*/
1320 /*----------------------------------------------------------------------*/
1323 else if (STRCASEEQ('k','K',"kana",name)) {
1324 /*----------------------------------------------------------------------*/
1326 /*----------------------------------------------------------------------*/
1329 else if (STRCASEEQ('e','E',"email",name)) {
1330 /*----------------------------------------------------------------------*/
1332 /*----------------------------------------------------------------------*/
1335 else if (STRCASEEQ('i','I',"ista",name)) {
1336 /*----------------------------------------------------------------------*/
1338 /*----------------------------------------------------------------------*/
1341 else if (STRCASEEQ('i','I',"ilet",name)) {
1342 /*----------------------------------------------------------------------*/
1344 /*----------------------------------------------------------------------*/
1347 else if (STRCASEEQ('i','I',"iswf",name)) {
1348 /*----------------------------------------------------------------------*/
1350 /*----------------------------------------------------------------------*/
1353 else if (STRCASEEQ('i','I',"irst",name)) {
1354 /*----------------------------------------------------------------------*/
1356 /*----------------------------------------------------------------------*/
1359 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1360 /*----------------------------------------------------------------------*/
1362 /*----------------------------------------------------------------------*/
1365 if (STRCASEEQ('l','L',"lcs",name)) {
1381 if (IS_CSS_ON(ixhtml10->entryp)) {
1382 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1385 return ixhtml10->out;
1390 * It is a handler who processes the A tag.
1392 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1393 * destination is specified.
1394 * @param node [i] The A tag node is specified.
1395 * @return The conversion result is returned.
1398 s_ixhtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1400 ixhtml10_t *ixhtml10;
1404 ixhtml10 = GET_IXHTML10(pdoc);
1405 doc = ixhtml10->doc;
1410 if (IS_CSS_ON(ixhtml10->entryp)) {
1411 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1414 return ixhtml10->out;
1419 * It is a handler who processes the BR tag.
1421 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1422 * destination is specified.
1423 * @param node [i] The BR tag node is specified.
1424 * @return The conversion result is returned.
1427 s_ixhtml10_start_br_tag(void *pdoc, Node *node)
1429 ixhtml10_t *ixhtml10;
1433 char *attr_style = NULL;
1434 char *attr_clear = NULL;
1436 ixhtml10 = GET_IXHTML10(pdoc);
1437 doc = ixhtml10->doc;
1440 /*--------------------------------------------------------------------------*/
1441 /* Get Attributes */
1442 /*--------------------------------------------------------------------------*/
1443 for (attr = qs_get_attr(doc,node);
1445 attr = qs_get_next_attr(doc,attr)) {
1446 char *name = qs_get_attr_name(doc,attr);
1447 char *value = qs_get_attr_value(doc,attr);
1448 if (STRCASEEQ('c','C',"clear",name)) {
1449 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1453 else if (STRCASEEQ('s','S',"style",name)) {
1457 if (IS_CSS_ON(ixhtml10->entryp)) {
1458 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1460 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
1461 css_property_t *cur;
1462 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
1463 if (cur->value && *cur->value) {
1464 if ( STRCASEEQ('l','L',"left", cur->value)
1465 || STRCASEEQ('r','R',"right", cur->value)
1466 || STRCASEEQ('b','B',"both" ,cur->value)) {
1467 attr_clear = apr_pstrdup(doc->pool, cur->value);
1478 if (STRCASEEQ('a','A',"all",attr_clear)) {
1492 return ixhtml10->out;
1497 * It is a handler who processes the BR tag.
1499 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1500 * destination is specified.
1501 * @param node [i] The BR tag node is specified.
1502 * @return The conversion result is returned.
1505 s_ixhtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1507 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
1508 return ixhtml10->out;
1513 * It is a handler who processes the TABLE tag.
1515 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1516 * destination is specified.
1517 * @param node [i] The TR tag node is specified.
1518 * @return The conversion result is returned.
1521 s_ixhtml10_start_table_tag(void *pdoc, Node *node)
1523 ixhtml10_t *ixhtml10;
1528 ixhtml10 = GET_IXHTML10(pdoc);
1529 doc = ixhtml10->doc;
1532 char *attr_style = NULL;
1533 char *attr_align = NULL;
1534 char *attr_width = NULL;
1535 char *attr_height = NULL;
1536 char *attr_bgcolor = NULL;
1537 char *attr_border_width = NULL;
1538 char *attr_border_color = NULL;
1540 /*--------------------------------------------------------------------------*/
1541 /* Get Attributes */
1542 /*--------------------------------------------------------------------------*/
1543 for (attr = qs_get_attr(doc,node);
1545 attr = qs_get_next_attr(doc,attr)) {
1546 char *name = qs_get_attr_name(doc,attr);
1547 char *val = qs_get_attr_value(doc,attr);
1548 if (STRCASEEQ('a','A',"align",name)) {
1549 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1550 attr_align = apr_pstrdup(doc->buf.pool, val);
1553 else if (STRCASEEQ('h','H',"height",name) && val && *val) {
1554 attr_height = apr_pstrdup(doc->buf.pool, val);
1556 else if (STRCASEEQ('w','W',"width",name) && val && *val) {
1557 attr_width = apr_pstrdup(doc->buf.pool, val);
1559 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1560 attr_style = apr_pstrdup(doc->buf.pool, val);
1562 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1563 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1564 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1566 else if (STRCASEEQ('b','B',"border",name) && val && *val) {
1567 attr_border_width = apr_pstrdup(doc->buf.pool, val);
1569 else if (STRCASEEQ('b','B',"bordercolor",name) && val && *val) {
1570 attr_border_color = apr_pstrdup(doc->buf.pool, val);
1571 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1575 if (IS_CSS_ON(ixhtml10->entryp)) {
1576 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1578 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
1579 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
1580 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1581 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1582 css_property_t *border_width_prop = chxj_css_get_property_value(doc, style, "border-width");
1583 css_property_t *border_color_prop = chxj_css_get_property_value(doc, style, "border-color");
1585 css_property_t *cur;
1586 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
1587 char *tmp = apr_pstrdup(doc->pool, cur->value);
1588 char *tmpp = strstr(tmp, "px");
1590 size_t len = strlen(tmp) - strlen(tmpp);
1591 attr_width = apr_pstrndup(doc->pool, tmp,len);
1594 attr_width = apr_pstrdup(doc->pool, tmp);
1597 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
1598 char *tmp = apr_pstrdup(doc->pool, cur->value);
1599 char *tmpp = strstr(tmp, "px");
1601 size_t len = strlen(tmp) - strlen(tmpp);
1602 attr_height = apr_pstrndup(doc->pool, tmp,len);
1605 attr_height = apr_pstrdup(doc->pool, tmp);
1608 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1609 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1610 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1613 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1614 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1615 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1617 for (cur = border_width_prop->next; cur != border_width_prop; cur = cur->next) {
1618 char *tmp = apr_pstrdup(doc->pool, cur->value);
1619 char *tmpp = strstr(tmp, "px");
1621 size_t len = strlen(tmp) - strlen(tmpp);
1622 attr_border_width = apr_pstrndup(doc->pool, tmp,len);
1625 attr_border_width = apr_pstrdup(doc->pool, tmp);
1628 for (cur = border_color_prop->next; cur != border_color_prop; cur = cur->next) {
1629 attr_border_color = apr_pstrdup(doc->pool, cur->value);
1630 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1651 if (attr_border_width){
1653 W_V(attr_border_width);
1656 if (attr_border_color && *attr_border_color){
1657 W_L(" bordercolor=\"");
1658 W_V(attr_border_color);
1661 if (attr_bgcolor && *attr_bgcolor){
1668 return ixhtml10->out;
1673 * It is a handler who processes the TABLE tag.
1675 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1676 * destination is specified.
1677 * @param node [i] The TR tag node is specified.
1678 * @return The conversion result is returned.
1681 s_ixhtml10_end_table_tag(void *pdoc, Node *UNUSED(child))
1683 ixhtml10_t *ixhtml10;
1687 ixhtml10 = GET_IXHTML10(pdoc);
1688 doc = ixhtml10->doc;
1693 if (IS_CSS_ON(ixhtml10->entryp)) {
1694 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1697 return ixhtml10->out;
1702 * It is a handler who processes the TR tag.
1704 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1705 * destination is specified.
1706 * @param node [i] The TR tag node is specified.
1707 * @return The conversion result is returned.
1710 s_ixhtml10_start_tr_tag(void *pdoc, Node *node)
1712 ixhtml10_t *ixhtml10;
1717 ixhtml10 = GET_IXHTML10(pdoc);
1718 doc = ixhtml10->doc;
1721 char *attr_style = NULL;
1722 char *attr_align = NULL;
1723 char *attr_valign = NULL;
1724 char *attr_bgcolor = NULL;
1726 /*--------------------------------------------------------------------------*/
1727 /* Get Attributes */
1728 /*--------------------------------------------------------------------------*/
1729 for (attr = qs_get_attr(doc,node);
1731 attr = qs_get_next_attr(doc,attr)) {
1732 char *name = qs_get_attr_name(doc,attr);
1733 char *val = qs_get_attr_value(doc,attr);
1734 if (STRCASEEQ('a','A',"align",name)) {
1735 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1736 attr_align = apr_pstrdup(doc->buf.pool, val);
1739 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1740 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1741 attr_valign = apr_pstrdup(doc->buf.pool, val);
1744 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1745 attr_style = apr_pstrdup(doc->buf.pool, val);
1747 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1748 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1749 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1753 if (IS_CSS_ON(ixhtml10->entryp)) {
1754 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1756 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1757 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1758 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1760 css_property_t *cur;
1761 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1762 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1763 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1766 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1767 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1768 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1771 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1772 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1773 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1789 if (attr_bgcolor && *attr_bgcolor){
1795 return ixhtml10->out;
1800 * It is a handler who processes the TR tag.
1802 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1803 * destination is specified.
1804 * @param node [i] The TR tag node is specified.
1805 * @return The conversion result is returned.
1808 s_ixhtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1810 ixhtml10_t *ixhtml10;
1814 ixhtml10 = GET_IXHTML10(pdoc);
1815 doc = ixhtml10->doc;
1819 return ixhtml10->out;
1823 * It is a handler who processes the TABLE tag.
1825 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1826 * destination is specified.
1827 * @param node [i] The TR tag node is specified.
1828 * @return The conversion result is returned.
1831 s_ixhtml10_start_td_or_th_tag(void *pdoc, Node *node,char *tagName)
1833 ixhtml10_t *ixhtml10;
1838 ixhtml10 = GET_IXHTML10(pdoc);
1839 doc = ixhtml10->doc;
1842 char *attr_style = NULL;
1843 char *attr_align = NULL;
1844 char *attr_valign = NULL;
1845 char *attr_bgcolor = NULL;
1846 char *attr_colspan = NULL;
1847 char *attr_rowspan = NULL;
1848 char *attr_width = NULL;
1849 char *attr_height = NULL;
1851 /*--------------------------------------------------------------------------*/
1852 /* Get Attributes */
1853 /*--------------------------------------------------------------------------*/
1854 for (attr = qs_get_attr(doc,node);
1856 attr = qs_get_next_attr(doc,attr)) {
1857 char *name = qs_get_attr_name(doc,attr);
1858 char *val = qs_get_attr_value(doc,attr);
1859 if (STRCASEEQ('a','A',"align",name)) {
1860 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1861 attr_align = apr_pstrdup(doc->buf.pool, val);
1864 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1865 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1866 attr_valign = apr_pstrdup(doc->buf.pool, val);
1869 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1870 attr_style = apr_pstrdup(doc->buf.pool, val);
1872 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1873 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1874 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1876 else if (STRCASEEQ('c','C',"colspan",name) && val && *val) {
1877 attr_colspan = apr_pstrdup(doc->buf.pool, val);
1879 else if (STRCASEEQ('r','R',"rowspan",name) && val && *val) {
1880 attr_rowspan = apr_pstrdup(doc->buf.pool, val);
1882 else if (STRCASEEQ('w','W',"width",name) && val && *val) {
1883 attr_width = apr_pstrdup(doc->buf.pool, val);
1885 else if (STRCASEEQ('h','H',"height",name) && val && *val) {
1886 attr_height = apr_pstrdup(doc->buf.pool, val);
1890 if (IS_CSS_ON(ixhtml10->entryp)) {
1891 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1893 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1894 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1895 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1896 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
1897 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
1899 css_property_t *cur;
1900 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1901 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1902 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1905 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1906 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1907 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1910 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1911 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1912 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1914 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
1915 char *tmp = apr_pstrdup(doc->pool, cur->value);
1916 char *tmpp = strstr(tmp, "px");
1918 size_t len = strlen(tmp) - strlen(tmpp);
1919 attr_width = apr_pstrndup(doc->pool, tmp,len);
1922 tmpp = strstr(tmp, "%");
1924 attr_width = apr_pstrdup(doc->pool, tmp);
1928 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
1929 char *tmp = apr_pstrdup(doc->pool, cur->value);
1930 char *tmpp = strstr(tmp, "px");
1932 size_t len = strlen(tmp) - strlen(tmpp);
1933 attr_height = apr_pstrndup(doc->pool, tmp,len);
1936 tmpp = strstr(tmp, "%");
1938 attr_height = apr_pstrdup(doc->pool, tmp);
1967 if (attr_bgcolor && *attr_bgcolor){
1983 return ixhtml10->out;
1988 * It is a handler who processes the TABLE tag.
1990 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1991 * destination is specified.
1992 * @param node [i] The TR tag node is specified.
1993 * @return The conversion result is returned.
1996 s_ixhtml10_end_td_or_th_tag(void *pdoc, Node *UNUSED(child),char *tagName)
1998 ixhtml10_t *ixhtml10;
2002 ixhtml10 = GET_IXHTML10(pdoc);
2003 doc = ixhtml10->doc;
2009 return ixhtml10->out;
2013 * It is a handler who processes the TABLE tag.
2015 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2016 * destination is specified.
2017 * @param node [i] The TR tag node is specified.
2018 * @return The conversion result is returned.
2021 s_ixhtml10_start_td_tag(void *pdoc, Node *node)
2023 return s_ixhtml10_start_td_or_th_tag(pdoc,node,"td");
2026 * It is a handler who processes the TABLE tag.
2028 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2029 * destination is specified.
2030 * @param node [i] The TR tag node is specified.
2031 * @return The conversion result is returned.
2034 s_ixhtml10_end_td_tag(void *pdoc, Node *node)
2036 return s_ixhtml10_end_td_or_th_tag(pdoc,node,"td");
2040 * It is a handler who processes the TABLE tag.
2042 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2043 * destination is specified.
2044 * @param node [i] The TR tag node is specified.
2045 * @return The conversion result is returned.
2048 s_ixhtml10_start_th_tag(void *pdoc, Node *node)
2050 return s_ixhtml10_start_td_or_th_tag(pdoc,node,"th");
2053 * It is a handler who processes the TABLE tag.
2055 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2056 * destination is specified.
2057 * @param node [i] The TR tag node is specified.
2058 * @return The conversion result is returned.
2061 s_ixhtml10_end_th_tag(void *pdoc, Node *node)
2063 return s_ixhtml10_end_td_or_th_tag(pdoc,node,"th");
2069 * It is a handler who processes the FONT tag.
2071 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2072 * destination is specified.
2073 * @param node [i] The FONT tag node is specified.
2074 * @return The conversion result is returned.
2077 s_ixhtml10_start_font_tag(void *pdoc, Node *node)
2079 ixhtml10_t *ixhtml10;
2083 char *attr_color = NULL;
2084 char *attr_size = NULL;
2085 char *attr_style = NULL;
2087 ixhtml10 = GET_IXHTML10(pdoc);
2088 doc = ixhtml10->doc;
2091 /*--------------------------------------------------------------------------*/
2092 /* Get Attributes */
2093 /*--------------------------------------------------------------------------*/
2094 for (attr = qs_get_attr(doc,node);
2096 attr = qs_get_next_attr(doc,attr)) {
2097 char *name = qs_get_attr_name(doc,attr);
2098 char *value = qs_get_attr_value(doc,attr);
2099 if (STRCASEEQ('c','C',"color",name) && value && *value) {
2100 attr_color = apr_pstrdup(doc->buf.pool, value);
2102 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2103 /*----------------------------------------------------------------------*/
2105 /*----------------------------------------------------------------------*/
2108 attr_size = "xx-small";
2111 attr_size = "x-small";
2114 attr_size = "small";
2117 attr_size = "medium";
2120 attr_size = "large";
2123 attr_size = "x-large";
2126 attr_size = "xx-large";
2130 if (chxj_chk_numeric(&value[1]) == 0) {
2131 attr_size = apr_pstrdup(doc->pool, value);
2138 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
2139 attr_style = apr_pstrdup(doc->buf.pool, value);
2142 if (IS_CSS_ON(ixhtml10->entryp)) {
2143 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2145 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2146 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2147 css_property_t *cur;
2148 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2149 if (cur->value && *cur->value) {
2150 attr_color = apr_pstrdup(doc->pool, cur->value);
2153 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2154 if (cur->value && *cur->value) {
2155 attr_size = apr_pstrdup(doc->pool, cur->value);
2156 if ( STRCASEEQ('x','X',"xx-small",attr_size)
2157 || STRCASEEQ('x','X',"x-small", attr_size)
2158 || STRCASEEQ('s','S',"small", attr_size)
2159 || STRCASEEQ('m','M',"medium", attr_size)
2160 || STRCASEEQ('l','L',"large", attr_size)
2161 || STRCASEEQ('x','X',"x-large", attr_size)
2162 || STRCASEEQ('x','X',"xx-large",attr_size)) {
2163 attr_size = apr_pstrdup(doc->pool, cur->value);
2170 if (attr_color || attr_size) {
2173 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2179 switch(*attr_size) {
2181 if (*(attr_size + 1) == '1') {
2182 attr_size = "small";
2185 if (*(attr_size + 1) == '2') {
2186 attr_size = "x-small";
2189 if (*(attr_size + 1) == '3') {
2190 attr_size = "xx-small";
2195 if (*(attr_size + 1) == '1') {
2196 attr_size = "large";
2199 if (*(attr_size + 1) == '2') {
2200 attr_size = "x-large";
2203 if (*(attr_size + 1) == '3') {
2204 attr_size = "xx-large";
2218 return ixhtml10->out;
2223 * It is a handler who processes the FONT tag.
2225 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2226 * destination is specified.
2227 * @param node [i] The FONT tag node is specified.
2228 * @return The conversion result is returned.
2231 s_ixhtml10_end_font_tag(void *pdoc, Node *UNUSED(node))
2233 ixhtml10_t *ixhtml10;
2237 ixhtml10 = GET_IXHTML10(pdoc);
2238 doc = ixhtml10->doc;
2239 r = ixhtml10->doc->r;
2242 if (IS_CSS_ON(ixhtml10->entryp)) {
2243 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2246 return ixhtml10->out;
2251 * It is a handler who processes the FORM tag.
2253 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2254 * destination is specified.
2255 * @param node [i] The FORM tag node is specified.
2256 * @return The conversion result is returned.
2259 s_ixhtml10_start_form_tag(void *pdoc, Node *node)
2261 ixhtml10_t *ixhtml10;
2265 char *attr_action = NULL;
2266 char *attr_method = NULL;
2267 char *attr_style = NULL;
2268 char *attr_color = NULL;
2269 char *attr_align = NULL;
2270 char *attr_name = NULL;
2271 char *new_hidden_tag = NULL;
2272 char *css_clear = NULL;
2274 ixhtml10 = GET_IXHTML10(pdoc);
2275 doc = ixhtml10->doc;
2278 /*--------------------------------------------------------------------------*/
2279 /* Get Attributes */
2280 /*--------------------------------------------------------------------------*/
2281 for (attr = qs_get_attr(doc,node);
2283 attr = qs_get_next_attr(doc,attr)) {
2284 char *name = qs_get_attr_name(doc,attr);
2285 char *value = qs_get_attr_value(doc,attr);
2289 if (strcasecmp(name, "action") == 0) {
2290 /*--------------------------------------------------------------------*/
2292 /*--------------------------------------------------------------------*/
2293 attr_action = value;
2299 if (strcasecmp(name, "method") == 0) {
2300 /*--------------------------------------------------------------------*/
2302 /*--------------------------------------------------------------------*/
2303 attr_method = value;
2309 if (strcasecmp(name, "name") == 0) {
2310 /*--------------------------------------------------------------------*/
2312 /*--------------------------------------------------------------------*/
2319 if (strcasecmp(name, "style") == 0) {
2328 if (IS_CSS_ON(ixhtml10->entryp)) {
2329 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2331 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
2332 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2333 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
2334 css_property_t *cur;
2335 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
2336 if (STRCASEEQ('l','L',"left", cur->value)) {
2337 attr_align = apr_pstrdup(doc->pool, "left");
2339 else if (STRCASEEQ('c','C',"center",cur->value)) {
2340 attr_align = apr_pstrdup(doc->pool, "center");
2342 else if (STRCASEEQ('r','R',"right",cur->value)) {
2343 attr_align = apr_pstrdup(doc->pool, "right");
2346 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2347 attr_color = apr_pstrdup(doc->pool, cur->value);
2349 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
2350 css_clear = apr_pstrdup(doc->pool, cur->value);
2355 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2359 attr_action = chxj_encoding_parameter(r, attr_action, 1);
2360 attr_action = chxj_add_cookie_parameter(r, attr_action, ixhtml10->cookie);
2362 char *new_query_string = NULL;
2363 q = strchr(attr_action, '?');
2365 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &new_query_string, CHXJ_TRUE, CHXJ_FALSE, ixhtml10->entryp);
2366 if (new_hidden_tag || new_query_string) {
2372 if (new_query_string) {
2374 W_V(new_query_string);
2398 ixhtml10_flags_t *flg = (ixhtml10_flags_t *)apr_palloc(doc->pool, sizeof(ixhtml10_flags_t));
2399 memset(flg, 0, sizeof(*flg));
2400 if (attr_color || attr_align) {
2401 W_L("<div style=\"");
2403 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2415 flg->with_div_flag = 1;
2418 node->userData = flg;
2419 if (new_hidden_tag) {
2420 W_V(new_hidden_tag);
2422 return ixhtml10->out;
2427 * It is a handler who processes the FORM tag.
2429 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2430 * destination is specified.
2431 * @param node [i] The FORM tag node is specified.
2432 * @return The conversion result is returned.
2435 s_ixhtml10_end_form_tag(void *pdoc, Node *node)
2437 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
2438 Doc *doc = ixhtml10->doc;
2440 ixhtml10_flags_t *flg = (ixhtml10_flags_t *)node->userData;
2441 if (flg && flg->with_div_flag) {
2445 if (IS_CSS_ON(ixhtml10->entryp)) {
2446 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2449 return ixhtml10->out;
2454 * It is a handler who processes the INPUT tag.
2456 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2457 * destination is specified.
2458 * @param node [i] The INPUT tag node is specified.
2459 * @return The conversion result is returned.
2462 s_ixhtml10_start_input_tag(void *pdoc, Node *node)
2464 ixhtml10_t *ixhtml10;
2468 char *attr_accesskey = NULL;
2469 char *attr_max_length = NULL;
2470 char *attr_type = NULL;
2471 char *attr_name = NULL;
2472 char *attr_value = NULL;
2473 char *attr_istyle = NULL;
2474 char *attr_size = NULL;
2475 char *attr_checked = NULL;
2476 char *attr_style = NULL;
2478 ixhtml10 = GET_IXHTML10(pdoc);
2479 doc = ixhtml10->doc;
2482 /*--------------------------------------------------------------------------*/
2483 /* Get Attributes */
2484 /*--------------------------------------------------------------------------*/
2485 for (attr = qs_get_attr(doc,node);
2487 attr = qs_get_next_attr(doc,attr)) {
2488 char *name = qs_get_attr_name(doc,attr);
2489 char *value = qs_get_attr_value(doc,attr);
2490 if (STRCASEEQ('t','T',"type",name) && value && *value) {
2491 char *tmp_type = qs_trim_string(doc->buf.pool, value);
2492 if (tmp_type && (STRCASEEQ('t','T',"text", tmp_type) ||
2493 STRCASEEQ('p','P',"password",tmp_type) ||
2494 STRCASEEQ('c','C',"checkbox",tmp_type) ||
2495 STRCASEEQ('r','R',"radio", tmp_type) ||
2496 STRCASEEQ('h','H',"hidden", tmp_type) ||
2497 STRCASEEQ('s','S',"submit", tmp_type) ||
2498 STRCASEEQ('r','R',"reset", tmp_type))) {
2499 attr_type = tmp_type;
2502 else if (STRCASEEQ('n','N',"name",name) && value && *value) {
2505 else if (STRCASEEQ('v','V',"value",name) && value && *value) {
2508 else if (STRCASEEQ('i','I',"istyle",name) && value && *value) {
2509 attr_istyle = value;
2511 else if (STRCASEEQ('m','M',"maxlength",name) && value && *value) {
2512 attr_max_length = value;
2514 else if (STRCASEEQ('c','C',"checked", name)) {
2515 attr_checked = value;
2517 else if (STRCASEEQ('a','A',"accesskey", name) && value && *value) {
2518 attr_accesskey = value;
2520 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
2523 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2528 if (IS_CSS_ON(ixhtml10->entryp)) {
2529 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2531 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
2532 css_property_t *cur;
2533 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
2534 if (strcasestr(cur->value, "<ja:n>")) {
2537 else if (strcasestr(cur->value, "<ja:en>")) {
2540 else if (strcasestr(cur->value, "<ja:hk>")) {
2543 else if (strcasestr(cur->value, "<ja:h>")) {
2568 if (STRCASEEQ('s','S',"submit",attr_type) || STRCASEEQ('r','R',"reset",attr_type)) {
2569 apr_size_t value_len = strlen(attr_value);
2570 attr_value = chxj_conv_z2h(r, attr_value, &value_len, ixhtml10->entryp);
2575 W_V(chxj_add_slash_to_doublequote(doc->pool, attr_value));
2578 if (attr_accesskey) {
2579 W_L(" accesskey=\"");
2580 W_V(attr_accesskey);
2583 if (attr_istyle && (*attr_istyle == '1' || *attr_istyle == '2' || *attr_istyle == '3' || *attr_istyle == '4')) {
2584 /*------------------------------------------------------------------------*/
2586 /*------------------------------------------------------------------------*/
2587 if (attr_type && STRCASEEQ('p','P',"password", attr_type) && ! ixhtml10->entryp->pc_flag ) {
2588 W_L(" style=\"-wap-input-format:"*<ja:n>";\"");
2591 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
2593 W_L("-wap-input-format:");
2599 else if (attr_type && STRCASEEQ('p','P',"password",attr_type)) {
2600 W_L(" style=\"-wap-input-format:"*<ja:n>";\"");
2602 /*--------------------------------------------------------------------------*/
2603 /* The figure is default for the password. */
2604 /*--------------------------------------------------------------------------*/
2605 if (attr_max_length && *attr_max_length) {
2606 if (chxj_chk_numeric(attr_max_length) == 0) {
2607 W_L(" maxlength=\"");
2608 W_V(attr_max_length);
2613 W_L(" checked=\"checked\"");
2617 ixhtml10_t *ixhtml10;
2629 ixhtml10 = GET_IXHTML10(pdoc);
2630 doc = ixhtml10->doc;
2642 /*--------------------------------------------------------------------------*/
2643 /* Get Attributes */
2644 /*--------------------------------------------------------------------------*/
2645 type = qs_get_type_attr(doc, node, doc->buf.pool);
2646 name = qs_get_name_attr(doc, node, doc->buf.pool);
2647 value = qs_get_value_attr(doc,node, doc->buf.pool);
2648 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2649 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2650 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2651 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2652 size = qs_get_size_attr(doc, node, doc->buf.pool);
2655 if (type && (STRCASEEQ('t','T',"text", type) ||
2656 STRCASEEQ('p','P',"password",type) ||
2657 STRCASEEQ('c','C',"checkbox",type) ||
2658 STRCASEEQ('r','R',"radio", type) ||
2659 STRCASEEQ('h','H',"hidden", type) ||
2660 STRCASEEQ('s','S',"submit", type) ||
2661 STRCASEEQ('r','R',"reset", type))) {
2667 if (size && *size) {
2672 if (name && *name) {
2677 if (value && *value) {
2679 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2682 if (accesskey && *accesskey) {
2683 W_L(" accesskey=\"");
2687 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
2688 /*------------------------------------------------------------------------*/
2690 /*------------------------------------------------------------------------*/
2691 if (type && STRCASEEQ('p','P',"password", type) && ! ixhtml10->entryp->pc_flag ) {
2692 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2695 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,istyle);
2697 W_L("-wap-input-format: ");
2703 else if (type && STRCASEEQ('p','P',"password",type)) {
2704 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2706 /*--------------------------------------------------------------------------*/
2707 /* The figure is default for the password. */
2708 /*--------------------------------------------------------------------------*/
2709 if (max_length && *max_length) {
2710 if (chxj_chk_numeric(max_length) == 0) {
2711 W_L(" maxlength=\"");
2718 W_L(" checked=\"checked\"");
2722 return ixhtml10->out;
2727 * It is a handler who processes the INPUT tag.
2729 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2730 * destination is specified.
2731 * @param node [i] The INPUT tag node is specified.
2732 * @return The conversion result is returned.
2735 s_ixhtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
2737 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
2738 return ixhtml10->out;
2743 * It is a handler who processes the CENTER tag.
2745 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2746 * destination is specified.
2747 * @param node [i] The CENTER tag node is specified.
2748 * @return The conversion result is returned.
2751 s_ixhtml10_start_center_tag(void *pdoc, Node *node)
2753 ixhtml10_t *ixhtml10;
2756 char *attr_style = NULL;
2757 char *attr_color = NULL;
2758 char *attr_size = NULL;
2760 ixhtml10 = GET_IXHTML10(pdoc);
2761 doc = ixhtml10->doc;
2763 for (attr = qs_get_attr(doc,node);
2765 attr = qs_get_next_attr(doc,attr)) {
2766 char *name = qs_get_attr_name(doc,attr);
2767 char *value = qs_get_attr_value(doc,attr);
2768 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2772 if (IS_CSS_ON(ixhtml10->entryp)) {
2773 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2775 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2776 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2777 css_property_t *cur;
2778 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2779 if (cur->value && *cur->value) {
2780 attr_color = apr_pstrdup(doc->pool, cur->value);
2783 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2784 if (cur->value && *cur->value) {
2785 attr_size = apr_pstrdup(doc->pool, cur->value);
2793 W_L("text-align:center;");
2800 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2808 return ixhtml10->out;
2813 * It is a handler who processes the CENTER tag.
2815 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2816 * destination is specified.
2817 * @param node [i] The CENTER tag node is specified.
2818 * @return The conversion result is returned.
2821 s_ixhtml10_end_center_tag(void *pdoc, Node *UNUSED(node))
2823 ixhtml10_t *ixhtml10;
2827 ixhtml10 = GET_IXHTML10(pdoc);
2828 doc = ixhtml10->doc;
2832 if (IS_CSS_ON(ixhtml10->entryp)) {
2833 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2835 return ixhtml10->out;
2840 * It is a handler who processes the li tag.
2842 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2843 * destination is specified.
2844 * @param node [i] The li tag node is specified.
2845 * @return The conversion result is returned.
2848 s_ixhtml10_start_li_tag(void *pdoc, Node *node)
2850 ixhtml10_t *ixhtml10;
2854 char *attr_type = NULL;
2855 char *attr_value = NULL;
2856 char *attr_style = NULL;
2858 ixhtml10 = GET_IXHTML10(pdoc);
2859 doc = ixhtml10->doc;
2862 for (attr = qs_get_attr(doc,node);
2864 attr = qs_get_next_attr(doc,attr)) {
2865 char *name = qs_get_attr_name(doc,attr);
2866 char *value = qs_get_attr_value(doc,attr);
2867 if (STRCASEEQ('t','T',"type",name)) {
2868 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2869 if (*value == '1') {
2870 attr_type = apr_pstrdup(doc->pool, "decimal");
2872 else if (*value == 'a') {
2873 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2875 else if (*value == 'A') {
2876 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2883 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2886 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2890 if (IS_CSS_ON(ixhtml10->entryp)) {
2891 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2893 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2894 css_property_t *cur;
2895 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2896 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2897 attr_type = apr_pstrdup(doc->pool, "decimal");
2899 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2900 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2902 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2903 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2905 else if (STRCASEEQ('d','D',"disc", cur->value)) {
2906 attr_type = apr_pstrdup(doc->pool, "disc");
2908 else if (STRCASEEQ('s','S',"square", cur->value)) {
2909 attr_type = apr_pstrdup(doc->pool, "square");
2911 else if (STRCASEEQ('c','C',"circle", cur->value)) {
2912 attr_type = apr_pstrdup(doc->pool, "circle");
2922 W_L("list-style-type:");
2933 return ixhtml10->out;
2938 * It is a handler who processes the li tag.
2940 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2941 * destination is specified.
2942 * @param node [i] The li tag node is specified.
2943 * @return The conversion result is returned.
2946 s_ixhtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
2948 ixhtml10_t *ixhtml10;
2952 ixhtml10 = GET_IXHTML10(pdoc);
2953 doc = ixhtml10->doc;
2956 if (IS_CSS_ON(ixhtml10->entryp)) {
2957 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2960 return ixhtml10->out;
2965 * It is a handler who processes the OL tag.
2967 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2968 * destination is specified.
2969 * @param node [i] The OL tag node is specified.
2970 * @return The conversion result is returned.
2973 s_ixhtml10_start_ol_tag(void *pdoc, Node *node)
2975 ixhtml10_t *ixhtml10;
2979 char *attr_style = NULL;
2980 char *attr_start = NULL;
2981 char *attr_type = NULL;
2982 char *css_clear = NULL;
2984 ixhtml10 = GET_IXHTML10(pdoc);
2985 doc = ixhtml10->doc;
2988 /*--------------------------------------------------------------------------*/
2989 /* Get Attributes */
2990 /*--------------------------------------------------------------------------*/
2991 for (attr = qs_get_attr(doc,node);
2993 attr = qs_get_next_attr(doc,attr)) {
2994 char *name = qs_get_attr_name(doc,attr);
2995 char *value = qs_get_attr_value(doc,attr);
2996 if (STRCASEEQ('t','T',"type",name) && value) {
2997 if (*value == '1') {
2998 attr_type = apr_pstrdup(doc->pool, "decimal");
3000 else if (*value == 'a') {
3001 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
3003 else if (*value == 'A') {
3004 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
3007 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
3010 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
3014 if (IS_CSS_ON(ixhtml10->entryp)) {
3015 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3017 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
3018 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3019 css_property_t *cur;
3020 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3021 if (STRCASEEQ('d','D',"decimal", cur->value)) {
3022 attr_type = apr_pstrdup(doc->pool, "decimal");
3024 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
3025 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
3027 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
3028 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
3031 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3032 css_clear = apr_pstrdup(doc->pool, cur->value);
3037 if (attr_type || css_clear) {
3040 W_L("list-style-type:");
3058 return ixhtml10->out;
3063 * It is a handler who processes the OL tag.
3065 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3066 * destination is specified.
3067 * @param node [i] The OL tag node is specified.
3068 * @return The conversion result is returned.
3071 s_ixhtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
3073 ixhtml10_t *ixhtml10;
3077 ixhtml10 = GET_IXHTML10(pdoc);
3078 doc = ixhtml10->doc;
3082 if (IS_CSS_ON(ixhtml10->entryp)) {
3083 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3085 return ixhtml10->out;
3090 * It is a handler who processes the P tag.
3092 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3093 * destination is specified.
3094 * @param node [i] The P tag node is specified.
3095 * @return The conversion result is returned.
3098 s_ixhtml10_start_p_tag(void *pdoc, Node *node)
3100 ixhtml10_t *ixhtml10;
3104 char *attr_align = NULL;
3105 char *attr_style = NULL;
3106 char *attr_color = NULL;
3107 char *attr_blink = NULL;
3108 char *css_clear = NULL;
3110 ixhtml10 = GET_IXHTML10(pdoc);
3111 doc = ixhtml10->doc;
3114 for (attr = qs_get_attr(doc,node);
3116 attr = qs_get_next_attr(doc,attr)) {
3117 char *nm = qs_get_attr_name(doc,attr);
3118 char *val = qs_get_attr_value(doc,attr);
3119 if (STRCASEEQ('a','A',"align", nm)) {
3120 /*----------------------------------------------------------------------*/
3121 /* CHTML 1.0 (W3C version 3.2) */
3122 /*----------------------------------------------------------------------*/
3123 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3124 attr_align = apr_pstrdup(doc->buf.pool, val);
3128 else if (STRCASEEQ('s','S',"style", nm) && val && *val) {
3129 attr_style = apr_pstrdup(doc->buf.pool, val);
3132 if (IS_CSS_ON(ixhtml10->entryp)) {
3133 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3135 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
3136 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3137 css_property_t *text_deco_prop = chxj_css_get_property_value(doc, style, "text-decoration");
3138 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3140 css_property_t *cur;
3141 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
3142 if (STRCASEEQ('l','L',"left",cur->value)) {
3143 attr_align = apr_pstrdup(doc->pool, "left");
3145 else if (STRCASEEQ('c','C',"center",cur->value)) {
3146 attr_align = apr_pstrdup(doc->pool, "center");
3148 else if (STRCASEEQ('r','R',"right",cur->value)) {
3149 attr_align = apr_pstrdup(doc->pool, "right");
3152 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3153 if (cur->value && *cur->value) {
3154 attr_color = apr_pstrdup(doc->pool, cur->value);
3157 for (cur = text_deco_prop->next; cur != text_deco_prop; cur = cur->next) {
3158 if (cur->value && *cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
3159 attr_blink = apr_pstrdup(doc->pool, cur->value);
3162 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3163 css_clear = apr_pstrdup(doc->pool, cur->value);
3168 if ((attr_align && *attr_align) || (attr_color && *attr_color) || (attr_blink && *attr_blink) || css_clear) {
3176 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
3182 W_L("text-decoration:");
3194 return ixhtml10->out;
3199 * It is a handler who processes the P tag.
3201 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3202 * destination is specified.
3203 * @param node [i] The P tag node is specified.
3204 * @return The conversion result is returned.
3207 s_ixhtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
3209 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3210 Doc *doc = ixhtml10->doc;
3213 if (IS_CSS_ON(ixhtml10->entryp)) {
3214 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3216 return ixhtml10->out;
3221 * It is a handler who processes the PRE tag.
3223 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3224 * destination is specified.
3225 * @param node [i] The PRE tag node is specified.
3226 * @return The conversion result is returned.
3229 s_ixhtml10_start_pre_tag(void *pdoc, Node *node)
3231 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3232 Doc *doc = ixhtml10->doc;
3234 char *attr_style = NULL;
3235 char *css_clear = NULL;
3237 for (attr = qs_get_attr(doc,node);
3239 attr = qs_get_next_attr(doc,attr)) {
3240 char *nm = qs_get_attr_name(doc,attr);
3241 char *val = qs_get_attr_value(doc,attr);
3242 if (val && STRCASEEQ('s','S',"style", nm)) {
3247 if (IS_CSS_ON(ixhtml10->entryp)) {
3248 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3250 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3252 css_property_t *cur;
3253 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3254 css_clear = apr_pstrdup(doc->pool, cur->value);
3259 ixhtml10->pre_flag++;
3269 return ixhtml10->out;
3274 * It is a handler who processes the PRE tag.
3276 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3277 * destination is specified.
3278 * @param node [i] The PRE tag node is specified.
3279 * @return The conversion result is returned.
3282 s_ixhtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
3284 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3285 Doc *doc = ixhtml10->doc;
3288 ixhtml10->pre_flag--;
3289 if (IS_CSS_ON(ixhtml10->entryp)) {
3290 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3293 return ixhtml10->out;
3298 * It is a handler who processes the UL tag.
3300 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3301 * destination is specified.
3302 * @param node [i] The UL tag node is specified.
3303 * @return The conversion result is returned.
3306 s_ixhtml10_start_ul_tag(void *pdoc, Node *node)
3308 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3309 Doc *doc = ixhtml10->doc;
3311 char *attr_type = NULL;
3312 char *attr_style = NULL;
3313 char *css_clear = NULL;
3315 /*--------------------------------------------------------------------------*/
3316 /* Get Attributes */
3317 /*--------------------------------------------------------------------------*/
3318 for (attr = qs_get_attr(doc,node);
3320 attr = qs_get_next_attr(doc,attr)) {
3321 char *name = qs_get_attr_name(doc,attr);
3322 char *value = qs_get_attr_value(doc,attr);
3323 if (STRCASEEQ('t','T',"type",name)) {
3324 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3328 else if (value && *value && STRCASEEQ('s','S',"style", name)) {
3332 if (IS_CSS_ON(ixhtml10->entryp)) {
3333 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3335 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
3336 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3337 css_property_t *cur;
3338 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3339 if (STRCASEEQ('d','D',"disc",cur->value)) {
3340 attr_type = apr_pstrdup(doc->pool, "disc");
3342 else if (STRCASEEQ('c','C',"circle",cur->value)) {
3343 attr_type = apr_pstrdup(doc->pool, "circle");
3345 else if (STRCASEEQ('s','S',"square",cur->value)) {
3346 attr_type = apr_pstrdup(doc->pool, "square");
3349 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3350 css_clear = apr_pstrdup(doc->pool, cur->value);
3355 if (attr_type || css_clear) {
3358 W_L("list-style-type:");
3370 return ixhtml10->out;
3375 * It is a handler who processes the UL tag.
3377 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3378 * destination is specified.
3379 * @param node [i] The UL tag node is specified.
3380 * @return The conversion result is returned.
3383 s_ixhtml10_end_ul_tag(void *pdoc, Node *UNUSED(child))
3385 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3386 Doc *doc = ixhtml10->doc;
3389 if (IS_CSS_ON(ixhtml10->entryp)) {
3390 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3392 return ixhtml10->out;
3397 * It is a handler who processes the HR tag.
3399 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3400 * destination is specified.
3401 * @param node [i] The HR tag node is specified.
3402 * @return The conversion result is returned.
3405 s_ixhtml10_start_hr_tag(void *pdoc, Node *node)
3408 ixhtml10_t *ixhtml10;
3411 char *attr_align = NULL;
3412 char *attr_size = NULL;
3413 char *attr_width = NULL;
3414 char *attr_noshade = NULL;
3415 char *attr_style = NULL;
3416 char *attr_color = NULL;
3417 char *attr_bgcolor = NULL;
3418 char *css_clear = NULL;
3420 ixhtml10 = GET_IXHTML10(pdoc);
3421 doc = ixhtml10->doc;
3424 for (attr = qs_get_attr(doc,node);
3426 attr = qs_get_next_attr(doc,attr)) {
3427 char *name = qs_get_attr_name (doc,attr);
3428 char *value = qs_get_attr_value(doc,attr);
3432 if (strcasecmp(name, "align") == 0) {
3433 /*--------------------------------------------------------------------*/
3435 /*--------------------------------------------------------------------*/
3436 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3444 if (strcasecmp(name, "size") == 0) {
3445 /*--------------------------------------------------------------------*/
3447 /*--------------------------------------------------------------------*/
3448 if (value && *value) {
3452 else if (strcasecmp(name, "style") == 0) {
3453 if (value && *value) {
3461 if (strcasecmp(name, "width") == 0) {
3462 /*--------------------------------------------------------------------*/
3464 /*--------------------------------------------------------------------*/
3465 if (value && *value) {
3473 if (strcasecmp(name, "noshade") == 0) {
3474 /*--------------------------------------------------------------------*/
3476 /*--------------------------------------------------------------------*/
3477 attr_noshade = apr_pstrdup(doc->pool, "noshade");
3483 if (strcasecmp(name, "color") == 0 && value && *value) {
3484 /*--------------------------------------------------------------------*/
3486 /*--------------------------------------------------------------------*/
3488 attr_bgcolor = value;
3496 if (IS_CSS_ON(ixhtml10->entryp)) {
3497 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3499 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
3500 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3501 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3502 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "border-color");
3503 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
3504 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3505 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3506 css_property_t *cur;
3507 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
3508 if (STRCASEEQ('s','S',"solid",cur->value)) {
3509 attr_noshade = "noshade";
3512 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3513 attr_color = apr_pstrdup(doc->pool, cur->value);
3515 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
3516 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3518 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3519 attr_size = apr_pstrdup(doc->pool, cur->value);
3521 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3522 char *tmp = apr_pstrdup(doc->pool, cur->value);
3523 char *tmpp = strstr(tmp, "px");
3525 attr_width = apr_pstrdup(doc->pool, tmp);
3528 tmpp = strstr(tmp, "%");
3530 attr_width = apr_pstrdup(doc->pool, tmp);
3535 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3536 char *tmp = apr_pstrdup(doc->pool, cur->value);
3538 attr_align = apr_pstrdup(doc->pool,tmp);
3542 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3543 css_clear = apr_pstrdup(doc->pool, cur->value);
3548 if (attr_align || attr_size || attr_width || attr_noshade || attr_color || attr_bgcolor || css_clear) {
3552 if (STRCASEEQ('c','C',"center",attr_align)) {
3563 if (chxj_chk_numeric(attr_size) == 0) {
3571 if (!strstr(attr_width, "px") && !strstr(attr_width, "%")) {
3577 W_L("border-style:solid;");
3580 W_L("border-color:");
3585 W_L("background-color:");
3598 return ixhtml10->out;
3603 * It is a handler who processes the HR tag.
3605 * @param ixhtml10 [i/o] The pointer to the IXHTML10 structure at the output
3606 * destination is specified.
3607 * @param node [i] The HR tag node is specified.
3608 * @return The conversion result is returned.
3611 s_ixhtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
3613 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3614 return ixhtml10->out;
3619 * It is a handler who processes the IMG tag.
3621 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3622 * destination is specified.
3623 * @param node [i] The IMG tag node is specified.
3624 * @return The conversion result is returned.
3627 s_ixhtml10_start_img_tag(void *pdoc, Node *node)
3629 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3630 Doc *doc = ixhtml10->doc;
3631 request_rec *r = doc->r;
3633 char *attr_src = NULL;
3634 char *attr_height = NULL;
3635 char *attr_width = NULL;
3636 char *attr_align = NULL;
3637 char *attr_alt = NULL;
3638 char *attr_style = NULL;
3639 char *attr_hspace = NULL;
3640 char *attr_vspace = NULL;
3642 char *css_float = NULL;
3643 char *css_margin_left = NULL;
3644 char *css_margin_right = NULL;
3645 char *css_margin_top = NULL;
3646 char *css_margin_bottom = NULL;
3647 char *css_display = NULL;
3648 char *css_valign = NULL;
3650 #ifndef IMG_NOT_CONVERT_FILENAME
3651 device_table *spec = ixhtml10->spec;
3654 /*--------------------------------------------------------------------------*/
3655 /* Get Attributes */
3656 /*--------------------------------------------------------------------------*/
3657 for (attr = qs_get_attr(doc,node);
3659 attr = qs_get_next_attr(doc,attr)) {
3660 char *name = qs_get_attr_name(doc,attr);
3661 char *value = qs_get_attr_value(doc,attr);
3662 if (STRCASEEQ('s','S',"src",name)) {
3663 /*----------------------------------------------------------------------*/
3665 /*----------------------------------------------------------------------*/
3666 #ifdef IMG_NOT_CONVERT_FILENAME
3667 value = chxj_encoding_parameter(r, value, 1);
3668 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
3669 value = chxj_add_cookie_no_update_parameter(r, value, 1);
3670 value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
3673 value = chxj_img_conv(r, spec, value);
3674 value = chxj_encoding_parameter(r, value, 1);
3675 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
3676 value = chxj_add_cookie_no_update_parameter(r, value, 1);
3677 value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
3681 else if (STRCASEEQ('a','A',"align",name)) {
3682 /*----------------------------------------------------------------------*/
3684 /*----------------------------------------------------------------------*/
3686 if (STRCASEEQ('t','T',"top", value) ||
3687 STRCASEEQ('m','M',"middle",value) ||
3688 STRCASEEQ('b','B',"bottom",value) ||
3689 STRCASEEQ('l','L',"left", value) ||
3690 STRCASEEQ('r','R',"right", value)) {
3693 else if (STRCASEEQ('c','C',"center",value)) {
3694 attr_align = apr_pstrdup(doc->pool, "middle");
3698 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
3699 /*----------------------------------------------------------------------*/
3701 /*----------------------------------------------------------------------*/
3704 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
3705 /*----------------------------------------------------------------------*/
3707 /*----------------------------------------------------------------------*/
3708 attr_height = value;
3710 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
3711 /*----------------------------------------------------------------------*/
3713 /*----------------------------------------------------------------------*/
3714 attr_hspace = value;
3716 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
3717 /*----------------------------------------------------------------------*/
3719 /*----------------------------------------------------------------------*/
3720 attr_vspace = value;
3722 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
3723 /*----------------------------------------------------------------------*/
3725 /*----------------------------------------------------------------------*/
3728 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
3729 /*----------------------------------------------------------------------*/
3731 /*----------------------------------------------------------------------*/
3736 if (IS_CSS_ON(ixhtml10->entryp)) {
3737 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3739 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3740 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3741 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
3742 css_property_t *margin_left_prop = chxj_css_get_property_value(doc, style, "margin-left");
3743 css_property_t *margin_right_prop = chxj_css_get_property_value(doc, style, "margin-right");
3744 css_property_t *margin_top_prop = chxj_css_get_property_value(doc, style, "margin-top");
3745 css_property_t *margin_bottom_prop = chxj_css_get_property_value(doc, style, "margin-bottom");
3748 css_property_t *cur;
3749 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3750 attr_height = apr_pstrdup(doc->pool, cur->value);
3752 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3753 attr_width = apr_pstrdup(doc->pool, cur->value);
3755 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
3756 css_valign = apr_pstrdup(doc->pool, cur->value);
3759 if (! attr_hspace) {
3760 for (cur = margin_left_prop->next; cur != margin_left_prop; cur = cur->next) {
3761 css_margin_left = apr_pstrdup(doc->pool, cur->value);
3763 for (cur = margin_right_prop->next; cur != margin_right_prop; cur = cur->next) {
3764 css_margin_right = apr_pstrdup(doc->pool, cur->value);
3768 if (! attr_vspace) {
3769 for (cur = margin_top_prop->next; cur != margin_top_prop; cur = cur->next) {
3770 css_margin_top = apr_pstrdup(doc->pool, cur->value);
3772 for (cur = margin_bottom_prop->next; cur != margin_bottom_prop; cur = cur->next) {
3773 css_margin_bottom = apr_pstrdup(doc->pool, cur->value);
3777 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3778 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3779 css_float = apr_pstrdup(doc->pool, cur->value);
3781 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
3782 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
3783 char *tmp = apr_pstrdup(doc->pool, cur->value);
3784 char *tmpp = strstr(tmp, "none");
3786 css_display = apr_pstrdup(doc->pool, tmp);
3798 DBG(r,"REQ[%X] mode is %d -> %s",TO_ADDR(r),ixhtml10->conf->image_rewrite_mode, attr_src);
3801 if (attr_align || attr_hspace || attr_vspace || css_float || css_margin_left || css_margin_right || css_margin_top || css_margin_bottom || css_valign ) {
3804 if (STRCASEEQ('t','T',"top", attr_align)) {
3806 W_L("vertical-align:top;");
3808 else if (STRCASEEQ('m','M',"middle", attr_align) || STRCASEEQ('c','C',"center",attr_align)) {
3810 W_L("vertical-align:middle;");
3812 else if (STRCASEEQ('b','B',"bottom", attr_align)) {
3814 W_L("vertical-align:bottom;");
3816 else if (STRCASEEQ('l','L',"left", attr_align)) {
3820 else if (STRCASEEQ('r','R',"right", attr_align)) {
3822 W_L("float:right;");
3833 W_L("vertical-align:");
3839 W_L("margin-left:");
3842 W_L("margin-right:");
3847 if(css_margin_left){
3848 W_L("margin-left:");
3849 W_V(css_margin_left);
3852 if(css_margin_right){
3853 W_L("margin-right:");
3854 W_V(css_margin_right);
3862 W_L("margin-bottom:");
3869 W_V(css_margin_top);
3872 if(css_margin_bottom){
3873 W_L("margin-bottom:");
3874 W_V(css_margin_bottom);
3900 return ixhtml10->out;
3905 * It is a handler who processes the IMG tag.
3907 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3908 * destination is specified.
3909 * @param node [i] The IMG tag node is specified.
3910 * @return The conversion result is returned.
3913 s_ixhtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
3915 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3916 return ixhtml10->out;
3921 * It is a handler who processes the SELECT tag.
3923 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3924 * destination is specified.
3925 * @param node [i] The SELECT tag node is specified.
3926 * @return The conversion result is returned.
3929 s_ixhtml10_start_select_tag(void *pdoc, Node *node)
3931 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3932 Doc *doc = ixhtml10->doc;
3936 char *multiple = NULL;
3937 char *attr_style = NULL;
3939 for (attr = qs_get_attr(doc,node);
3941 attr = qs_get_next_attr(doc,attr)) {
3942 char *nm = qs_get_attr_name(doc,attr);
3943 char *val = qs_get_attr_value(doc,attr);
3944 if (STRCASEEQ('s','S',"size",nm)) {
3945 /*----------------------------------------------------------------------*/
3946 /* CHTML 1.0 version 2.0 */
3947 /*----------------------------------------------------------------------*/
3948 size = apr_pstrdup(doc->buf.pool, val);
3950 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3951 /*----------------------------------------------------------------------*/
3952 /* CHTML 1.0 version 2.0 */
3953 /*----------------------------------------------------------------------*/
3954 attr_style = apr_pstrdup(doc->buf.pool, val);
3956 else if (STRCASEEQ('n','N',"name",nm)) {
3957 /*----------------------------------------------------------------------*/
3958 /* CHTML 1.0 version 2.0 */
3959 /*----------------------------------------------------------------------*/
3960 name = apr_pstrdup(doc->buf.pool, val);
3962 else if (STRCASEEQ('m','M',"multiple", nm)) {
3963 /*----------------------------------------------------------------------*/
3964 /* CHTML 1.0 version 2.0 */
3965 /*----------------------------------------------------------------------*/
3966 multiple = apr_pstrdup(doc->buf.pool, val);
3970 if (size && *size) {
3975 if (name && *name) {
3981 W_L(" multiple=\"multiple\"");
3985 if (IS_CSS_ON(ixhtml10->entryp)) {
3986 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3989 return ixhtml10->out;
3994 * It is a handler who processes the SELECT tag.
3996 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3997 * destination is specified.
3998 * @param node [i] The SELECT tag node is specified.
3999 * @return The conversion result is returned.
4002 s_ixhtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
4004 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4005 Doc *doc = ixhtml10->doc;
4008 if (IS_CSS_ON(ixhtml10->entryp)) {
4009 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4012 return ixhtml10->out;
4016 * It is a handler who processes the OPTION tag.
4018 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4019 * destination is specified.
4020 * @param node [i] The OPTION tag node is specified.
4021 * @return The conversion result is returned.
4024 s_ixhtml10_start_option_tag(void *pdoc, Node *node)
4026 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4027 Doc *doc = ixhtml10->doc;
4030 char *selected = NULL;
4032 char *attr_style = NULL;
4034 for (attr = qs_get_attr(doc,node);
4036 attr = qs_get_next_attr(doc,attr)) {
4037 char *nm = qs_get_attr_name(doc,attr);
4038 char *val = qs_get_attr_value(doc,attr);
4039 if (STRCASEEQ('s','S',"selected",nm)) {
4040 /*----------------------------------------------------------------------*/
4041 /* CHTML 1.0 version 2.0 */
4042 /*----------------------------------------------------------------------*/
4043 selected = apr_pstrdup(doc->buf.pool, val);
4045 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
4046 /*----------------------------------------------------------------------*/
4047 /* CHTML 1.0 version 2.0 */
4048 /*----------------------------------------------------------------------*/
4049 attr_style = apr_pstrdup(doc->buf.pool, val);
4051 else if (STRCASEEQ('v','V',"value",nm)) {
4052 /*----------------------------------------------------------------------*/
4053 /* CHTML 1.0 version 2.0 */
4054 /*----------------------------------------------------------------------*/
4055 value = apr_pstrdup(doc->buf.pool, val);
4065 W_L(" selected=\"selected\"");
4069 if (IS_CSS_ON(ixhtml10->entryp)) {
4070 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4073 return ixhtml10->out;
4078 * It is a handler who processes the OPTION tag.
4080 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4081 * destination is specified.
4082 * @param node [i] The OPTION tag node is specified.
4083 * @return The conversion result is returned.
4086 s_ixhtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
4088 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4089 Doc *doc = ixhtml10->doc;
4092 if (IS_CSS_ON(ixhtml10->entryp)) {
4093 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4096 return ixhtml10->out;
4101 * It is a handler who processes the DIV tag.
4103 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4104 * destination is specified.
4105 * @param node [i] The DIV tag node is specified.
4106 * @return The conversion result is returned.
4109 s_ixhtml10_start_div_tag(void *pdoc, Node *node)
4111 ixhtml10_t *ixhtml10;
4115 char *attr_style = NULL;
4116 char *attr_align = NULL;
4117 char *attr_display = NULL;
4118 char *attr_decoration = NULL;
4119 char *attr_wap_marquee_style = NULL;
4120 char *attr_wap_marquee_dir = NULL;
4121 char *attr_wap_marquee_loop = NULL;
4122 char *attr_color = NULL;
4123 char *attr_bgcolor = NULL;
4124 char *attr_font_size = NULL;
4125 char *css_clear = NULL;
4127 ixhtml10 = GET_IXHTML10(pdoc);
4128 doc = ixhtml10->doc;
4131 for (attr = qs_get_attr(doc,node);
4133 attr = qs_get_next_attr(doc,attr)) {
4134 char *nm = qs_get_attr_name(doc,attr);
4135 char *val = qs_get_attr_value(doc,attr);
4136 if (STRCASEEQ('a','A',"align",nm)) {
4137 /*----------------------------------------------------------------------*/
4138 /* CHTML 1.0 (W3C version 3.2) */
4139 /*----------------------------------------------------------------------*/
4140 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
4141 attr_align = apr_pstrdup(doc->buf.pool, val);
4144 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
4145 attr_style = apr_pstrdup(doc->buf.pool, val);
4149 if (IS_CSS_ON(ixhtml10->entryp)) {
4150 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4152 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
4153 css_property_t *text_decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
4154 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4155 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
4156 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
4157 css_property_t *background_color_prop = chxj_css_get_property_value(doc, style, "background-color");
4158 css_property_t *background_prop = chxj_css_get_property_value(doc, style, "background");
4159 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4161 css_property_t *cur;
4162 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
4163 if (strcasecmp("-wap-marquee", cur->value) == 0) {
4164 attr_display = apr_pstrdup(doc->pool, cur->value);
4167 for (cur = background_color_prop->next; cur != background_color_prop; cur = cur->next) {
4168 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
4169 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
4171 for (cur = background_prop->next; cur != background_prop; cur = cur->next) {
4172 char *ss = strchr(cur->value, '#');
4174 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
4175 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
4178 for (cur = text_decoration_prop->next; cur != text_decoration_prop; cur = cur->next) {
4179 if (STRCASEEQ('b','B',"blink", cur->value)) {
4180 attr_decoration = apr_pstrdup(doc->pool, cur->value);
4183 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4184 attr_color = apr_pstrdup(doc->pool, cur->value);
4186 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
4187 attr_align = apr_pstrdup(doc->pool, cur->value);
4189 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
4190 if ( STRCASEEQ('x','X',"xx-small",cur->value)
4191 || STRCASEEQ('x','X',"x-small",cur->value)
4192 || STRCASEEQ('s','S',"small",cur->value)
4193 || STRCASEEQ('m','M',"medium",cur->value)
4194 || STRCASEEQ('l','L',"large",cur->value)
4195 || STRCASEEQ('x','X',"x-large",cur->value)
4196 || STRCASEEQ('x','X',"xx-large",cur->value)) {
4197 attr_font_size = apr_pstrdup(doc->pool, cur->value);
4201 css_property_t *wap_marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
4202 css_property_t *wap_marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
4203 css_property_t *wap_marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
4204 for (cur = wap_marquee_style_prop->next; cur != wap_marquee_style_prop; cur = cur->next) {
4205 if (STRCASEEQ('s','S',"scroll", cur->value) || STRCASEEQ('s','S',"slide",cur->value) || STRCASEEQ('a','A',"alternate",cur->value)) {
4206 attr_wap_marquee_style = apr_pstrdup(doc->pool, cur->value);
4209 for (cur = wap_marquee_dir_prop->next; cur != wap_marquee_dir_prop; cur = cur->next) {
4210 if (STRCASEEQ('l','L',"ltr",cur->value)) {
4211 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
4213 else if (STRCASEEQ('r','R',"rtl",cur->value)) {
4214 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
4217 for (cur = wap_marquee_loop_prop->next; cur != wap_marquee_loop_prop; cur = cur->next) {
4218 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
4219 attr_wap_marquee_loop = "infinite";
4222 attr_wap_marquee_loop = apr_pstrdup(doc->pool, cur->value);
4226 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4227 css_clear = apr_pstrdup(doc->pool, cur->value);
4235 || attr_wap_marquee_style
4236 || attr_wap_marquee_dir
4237 || attr_wap_marquee_loop
4253 if (attr_decoration) {
4254 W_L("text-decoration:");
4255 W_V(attr_decoration);
4258 if (attr_wap_marquee_style) {
4259 W_L("-wap-marquee-style:");
4260 W_V(attr_wap_marquee_style);
4263 if (attr_wap_marquee_dir) {
4264 W_L("-wap-marquee-dir:");
4265 W_V(attr_wap_marquee_dir);
4268 if (attr_wap_marquee_loop) {
4269 W_L("-wap-marquee-loop:");
4270 W_V(attr_wap_marquee_loop);
4279 W_L("background-color:");
4283 if (attr_font_size) {
4285 W_V(attr_font_size);
4296 return ixhtml10->out;
4301 * It is a handler who processes the DIV tag.
4303 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4304 * destination is specified.
4305 * @param node [i] The DIV tag node is specified.
4306 * @return The conversion result is returned.
4309 s_ixhtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
4311 ixhtml10_t *ixhtml10;
4315 ixhtml10 = GET_IXHTML10(pdoc);
4316 doc = ixhtml10->doc;
4320 if (IS_CSS_ON(ixhtml10->entryp)) {
4321 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4323 return ixhtml10->out;
4328 s_ixhtml10_istyle_to_wap_input_format(apr_pool_t *p, const char *s)
4332 case '1': return apr_psprintf(p, ""*<ja:h>"");
4333 case '2': return apr_psprintf(p, ""*<ja:hk>"");
4334 case '3': return apr_psprintf(p, ""*<ja:en>"");
4335 case '4': return apr_psprintf(p, ""*<ja:n>"");
4337 return apr_pstrdup(p, "");
4341 return apr_pstrdup(p,"");
4346 s_ixhtml10_chxjif_tag(void *pdoc, Node *node)
4348 ixhtml10_t *ixhtml10;
4353 ixhtml10 = GET_IXHTML10(pdoc);
4354 doc = ixhtml10->doc;
4357 for (child = qs_get_child_node(doc, node);
4359 child = qs_get_next_node(doc, child)) {
4361 s_ixhtml10_chxjif_tag(ixhtml10, child);
4368 * It is a handler who processes the TEXTARE tag.
4370 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4371 * destination is specified.
4372 * @param node [i] The TEXTAREA tag node is specified.
4373 * @return The conversion result is returned.
4376 s_ixhtml10_start_textarea_tag(void *pdoc, Node *node)
4378 ixhtml10_t *ixhtml10;
4382 char *attr_accesskey = NULL;
4383 char *attr_name = NULL;
4384 char *attr_rows = NULL;
4385 char *attr_cols = NULL;
4386 char *attr_istyle = NULL;
4387 char *attr_style = NULL;
4390 ixhtml10 = GET_IXHTML10(pdoc);
4391 doc = ixhtml10->doc;
4394 ixhtml10->textarea_flag++;
4395 for (attr = qs_get_attr(doc,node);
4397 attr = qs_get_next_attr(doc,attr)) {
4398 char *name = qs_get_attr_name(doc,attr);
4399 char *value = qs_get_attr_value(doc,attr);
4400 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
4401 attr_accesskey = value;
4403 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
4404 attr_istyle = value;
4406 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
4409 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
4412 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
4415 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4419 if (IS_CSS_ON(ixhtml10->entryp)) {
4420 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4422 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
4423 css_property_t *cur;
4424 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
4425 if (strcasestr(cur->value, "<ja:n>")) {
4428 else if (strcasestr(cur->value, "<ja:en>")) {
4431 else if (strcasestr(cur->value, "<ja:hk>")) {
4434 else if (strcasestr(cur->value, "<ja:h>")) {
4441 if (attr_accesskey) {
4442 W_L(" accesskey=\"");
4443 W_V(attr_accesskey);
4462 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
4464 W_L("-wap-input-format:");
4470 return ixhtml10->out;
4475 * It is a handler who processes the TEXTAREA tag.
4477 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4478 * destination is specified.
4479 * @param node [i] The TEXTAREA tag node is specified.
4480 * @return The conversion result is returned.
4483 s_ixhtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
4485 ixhtml10_t *ixhtml10;
4489 ixhtml10 = GET_IXHTML10(pdoc);
4490 doc = ixhtml10->doc;
4494 ixhtml10->textarea_flag--;
4496 return ixhtml10->out;
4501 * It is a handler who processes the B tag.
4503 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4504 * destination is specified.
4505 * @param node [i] The B tag node is specified.
4506 * @return The conversion result is returned.
4509 s_ixhtml10_start_b_tag(void* pdoc, Node* UNUSED(node))
4511 ixhtml10_t* ixhtml10;
4515 ixhtml10 = GET_IXHTML10(pdoc);
4516 doc = ixhtml10->doc;
4519 return ixhtml10->out;
4524 * It is a handler who processes the B tag.
4526 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4527 * destination is specified.
4528 * @param node [i] The B tag node is specified.
4529 * @return The conversion result is returned.
4532 s_ixhtml10_end_b_tag(void* pdoc, Node* UNUSED(child))
4534 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4536 Doc *doc = ixhtml10->doc;
4539 return ixhtml10->out;
4543 s_ixhtml10_text_tag(void* pdoc, Node* child)
4545 ixhtml10_t* ixhtml10;
4554 apr_size_t z2h_input_len;
4556 ixhtml10 = GET_IXHTML10(pdoc);
4557 doc = ixhtml10->doc;
4560 textval = qs_get_node_value(doc,child);
4561 if (strlen(textval) == 0) {
4562 return ixhtml10->out;
4565 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
4566 memset(tmp, 0, qs_get_node_size(doc,child)+1);
4568 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
4569 memset(one_byte, 0, sizeof(one_byte));
4572 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
4574 int rtn = s_ixhtml10_search_emoji(ixhtml10, &textval[ii], &out,child);
4576 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
4581 if (is_sjis_kanji(textval[ii])) {
4582 one_byte[0] = textval[ii+0];
4583 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4584 one_byte[0] = textval[ii+1];
4585 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4589 if (ixhtml10->pre_flag) {
4590 one_byte[0] = textval[ii+0];
4591 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4594 if (ixhtml10->textarea_flag) {
4595 one_byte[0] = textval[ii+0];
4596 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4599 if (textval[ii] != '\r' && textval[ii] != '\n') {
4600 one_byte[0] = textval[ii+0];
4601 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4605 z2h_input_len = strlen(tdst);
4606 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, ixhtml10->entryp);
4609 return ixhtml10->out;
4614 * It is a handler who processes the BLOCKQUOTE tag.
4616 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4617 * destination is specified.
4618 * @param node [i] The BLOCKQUOTE tag node is specified.
4619 * @return The conversion result is returned.
4622 s_ixhtml10_start_blockquote_tag(void *pdoc, Node *node)
4624 ixhtml10_t *ixhtml10;
4627 char *attr_style = NULL;
4628 char *attr_color = NULL;
4629 char *attr_size = NULL;
4630 char *css_clear = NULL;
4632 ixhtml10 = GET_IXHTML10(pdoc);
4633 doc = ixhtml10->doc;
4634 for (attr = qs_get_attr(doc,node);
4636 attr = qs_get_next_attr(doc,attr)) {
4637 char *nm = qs_get_attr_name(doc,attr);
4638 char *val = qs_get_attr_value(doc,attr);
4639 if (val && STRCASEEQ('s','S',"style", nm)) {
4643 if (IS_CSS_ON(ixhtml10->entryp)) {
4644 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4646 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4647 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
4648 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4650 css_property_t *cur;
4651 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4652 if (cur->value && *cur->value) {
4653 attr_color = apr_pstrdup(doc->pool, cur->value);
4656 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
4657 if (cur->value && *cur->value) {
4658 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4659 attr_size = apr_pstrdup(doc->pool, cur->value);
4661 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4662 attr_size = apr_pstrdup(doc->pool, cur->value);
4664 else if (STRCASEEQ('s','S',"small",cur->value)) {
4665 attr_size = apr_pstrdup(doc->pool, cur->value);
4667 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4668 attr_size = apr_pstrdup(doc->pool, cur->value);
4670 else if (STRCASEEQ('l','L',"large",cur->value)) {
4671 attr_size = apr_pstrdup(doc->pool, cur->value);
4673 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4674 attr_size = apr_pstrdup(doc->pool, cur->value);
4676 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4677 attr_size = apr_pstrdup(doc->pool, cur->value);
4681 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4682 css_clear = apr_pstrdup(doc->pool, cur->value);
4687 if (attr_color || attr_size || css_clear) {
4690 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4708 return ixhtml10->out;
4713 * It is a handler who processes the BLOCKQUOTE tag.
4715 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4716 * destination is specified.
4717 * @param node [i] The BLOCKQUOTE tag node is specified.
4718 * @return The conversion result is returned.
4721 s_ixhtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
4723 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4724 Doc *doc = ixhtml10->doc;
4725 W_L("</blockquote>");
4726 if (IS_CSS_ON(ixhtml10->entryp)) {
4727 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4729 return ixhtml10->out;
4734 * It is a handler who processes the DIR tag.
4736 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4737 * destination is specified.
4738 * @param node [i] The DIR tag node is specified.
4739 * @return The conversion result is returned.
4742 s_ixhtml10_start_dir_tag(void *pdoc, Node *node)
4744 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4745 Doc *doc = ixhtml10->doc;
4747 char *attr_style = NULL;
4748 char *attr_color = NULL;
4749 char *attr_type = NULL;
4750 char *attr_size = NULL;
4751 for (attr = qs_get_attr(doc,node);
4753 attr = qs_get_next_attr(doc,attr)) {
4754 char *name = qs_get_attr_name(doc,attr);
4755 char *value = qs_get_attr_value(doc,attr);
4756 if (STRCASEEQ('t','T',"type",name)) {
4757 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
4761 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4765 if (IS_CSS_ON(ixhtml10->entryp)) {
4766 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4768 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4769 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4770 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
4771 css_property_t *cur;
4772 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4773 if (cur->value && *cur->value) {
4774 attr_color = apr_pstrdup(doc->pool, cur->value);
4777 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4778 if (cur->value && *cur->value) {
4779 attr_type = apr_pstrdup(doc->pool, cur->value);
4782 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4783 if (cur->value && *cur->value) {
4784 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4785 attr_size = apr_pstrdup(doc->pool, cur->value);
4787 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4788 attr_size = apr_pstrdup(doc->pool, cur->value);
4790 else if (STRCASEEQ('s','S',"small",cur->value)) {
4791 attr_size = apr_pstrdup(doc->pool, cur->value);
4793 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4794 attr_size = apr_pstrdup(doc->pool, cur->value);
4796 else if (STRCASEEQ('l','L',"large",cur->value)) {
4797 attr_size = apr_pstrdup(doc->pool, cur->value);
4799 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4800 attr_size = apr_pstrdup(doc->pool, cur->value);
4802 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4803 attr_size = apr_pstrdup(doc->pool, cur->value);
4810 if (attr_type || attr_color || attr_size) {
4813 W_L("list-style-type:");
4818 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4831 return ixhtml10->out;
4836 * It is a handler who processes the DIR tag.
4838 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4839 * destination is specified.
4840 * @param node [i] The DIR tag node is specified.
4841 * @return The conversion result is returned.
4844 s_ixhtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
4846 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4847 Doc *doc = ixhtml10->doc;
4849 if (IS_CSS_ON(ixhtml10->entryp)) {
4850 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4852 return ixhtml10->out;
4857 * It is a handler who processes the DL tag.
4859 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4860 * destination is specified.
4861 * @param node [i] The DL tag node is specified.
4862 * @return The conversion result is returned.
4865 s_ixhtml10_start_dl_tag(void *pdoc, Node *node)
4867 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4868 Doc *doc = ixhtml10->doc;
4870 char *attr_style = NULL;
4871 char *attr_color = NULL;
4872 char *attr_size = NULL;
4873 char *css_clear = NULL;
4875 for (attr = qs_get_attr(doc,node);
4877 attr = qs_get_next_attr(doc,attr)) {
4878 char *name = qs_get_attr_name(doc,attr);
4879 char *value = qs_get_attr_value(doc,attr);
4880 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4884 if (IS_CSS_ON(ixhtml10->entryp)) {
4885 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4887 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4888 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4889 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4891 css_property_t *cur;
4892 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4893 if (cur->value && *cur->value) {
4894 attr_color = apr_pstrdup(doc->pool, cur->value);
4897 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4898 if (cur->value && *cur->value) {
4899 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4900 attr_size = apr_pstrdup(doc->pool, cur->value);
4902 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4903 attr_size = apr_pstrdup(doc->pool, cur->value);
4905 else if (STRCASEEQ('s','S',"small",cur->value)) {
4906 attr_size = apr_pstrdup(doc->pool, cur->value);
4908 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4909 attr_size = apr_pstrdup(doc->pool, cur->value);
4911 else if (STRCASEEQ('l','L',"large",cur->value)) {
4912 attr_size = apr_pstrdup(doc->pool, cur->value);
4914 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4915 attr_size = apr_pstrdup(doc->pool, cur->value);
4917 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4918 attr_size = apr_pstrdup(doc->pool, cur->value);
4922 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4923 css_clear = apr_pstrdup(doc->pool, cur->value);
4928 if (attr_color || attr_size || css_clear) {
4931 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4949 return ixhtml10->out;
4954 * It is a handler who processes the DL tag.
4956 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4957 * destination is specified.
4958 * @param node [i] The DL tag node is specified.
4959 * @return The conversion result is returned.
4962 s_ixhtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
4964 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4965 Doc *doc = ixhtml10->doc;
4967 if (IS_CSS_ON(ixhtml10->entryp)) {
4968 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4970 return ixhtml10->out;
4975 * It is a handler who processes the DT tag.
4977 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4978 * destination is specified.
4979 * @param node [i] The DT tag node is specified.
4980 * @return The conversion result is returned.
4983 s_ixhtml10_start_dt_tag(void *pdoc, Node *node)
4985 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4986 Doc *doc = ixhtml10->doc;
4988 char *attr_style = NULL;
4989 char *attr_color = NULL;
4990 char *attr_size = NULL;
4991 for (attr = qs_get_attr(doc,node);
4993 attr = qs_get_next_attr(doc,attr)) {
4994 char *name = qs_get_attr_name(doc,attr);
4995 char *value = qs_get_attr_value(doc,attr);
4996 if (STRCASEEQ('s','S',"style", name) && value && *value) {
5000 if (IS_CSS_ON(ixhtml10->entryp)) {
5001 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5003 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5004 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5005 css_property_t *cur;
5006 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5007 if (cur->value && *cur->value) {
5008 attr_color = apr_pstrdup(doc->pool, cur->value);
5011 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5012 if (cur->value && *cur->value) {
5013 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5014 attr_size = apr_pstrdup(doc->pool, cur->value);
5016 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5017 attr_size = apr_pstrdup(doc->pool, cur->value);
5019 else if (STRCASEEQ('s','S',"small",cur->value)) {
5020 attr_size = apr_pstrdup(doc->pool, cur->value);
5022 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5023 attr_size = apr_pstrdup(doc->pool, cur->value);
5025 else if (STRCASEEQ('l','L',"large",cur->value)) {
5026 attr_size = apr_pstrdup(doc->pool, cur->value);
5028 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5029 attr_size = apr_pstrdup(doc->pool, cur->value);
5031 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5032 attr_size = apr_pstrdup(doc->pool, cur->value);
5039 if (attr_color || attr_size) {
5042 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5055 return ixhtml10->out;
5060 * It is a handler who processes the DT tag.
5062 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5063 * destination is specified.
5064 * @param node [i] The DT tag node is specified.
5065 * @return The conversion result is returned.
5068 s_ixhtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
5070 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5071 Doc *doc = ixhtml10->doc;
5073 if (IS_CSS_ON(ixhtml10->entryp)) {
5074 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5076 return ixhtml10->out;
5081 * It is a handler who processes the DD tag.
5083 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5084 * destination is specified.
5085 * @param node [i] The DD tag node is specified.
5086 * @return The conversion result is returned.
5089 s_ixhtml10_start_dd_tag(void *pdoc, Node *node)
5091 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5092 Doc *doc = ixhtml10->doc;
5094 char *attr_style = NULL;
5095 char *attr_color = NULL;
5096 char *attr_size = NULL;
5097 for (attr = qs_get_attr(doc,node);
5099 attr = qs_get_next_attr(doc,attr)) {
5100 char *name = qs_get_attr_name(doc,attr);
5101 char *value = qs_get_attr_value(doc,attr);
5102 if (STRCASEEQ('s','S',"style", name) && value && *value) {
5106 if (IS_CSS_ON(ixhtml10->entryp)) {
5107 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5109 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5110 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5111 css_property_t *cur;
5112 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5113 if (cur->value && *cur->value) {
5114 attr_color = apr_pstrdup(doc->pool, cur->value);
5117 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5118 if (cur->value && *cur->value) {
5119 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5120 attr_size = apr_pstrdup(doc->pool, cur->value);
5122 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5123 attr_size = apr_pstrdup(doc->pool, cur->value);
5125 else if (STRCASEEQ('s','S',"small",cur->value)) {
5126 attr_size = apr_pstrdup(doc->pool, cur->value);
5128 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5129 attr_size = apr_pstrdup(doc->pool, cur->value);
5131 else if (STRCASEEQ('l','L',"large",cur->value)) {
5132 attr_size = apr_pstrdup(doc->pool, cur->value);
5134 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5135 attr_size = apr_pstrdup(doc->pool, cur->value);
5137 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5138 attr_size = apr_pstrdup(doc->pool, cur->value);
5145 if (attr_color || attr_size) {
5148 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5161 return ixhtml10->out;
5166 * It is a handler who processes the DD tag.
5168 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5169 * destination is specified.
5170 * @param node [i] The DD tag node is specified.
5171 * @return The conversion result is returned.
5174 s_ixhtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
5176 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5177 Doc *doc = ixhtml10->doc;
5179 if (IS_CSS_ON(ixhtml10->entryp)) {
5180 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5182 return ixhtml10->out;
5187 * It is a handler who processes the H1 tag.
5189 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5190 * destination is specified.
5191 * @param node [i] The H1 tag node is specified.
5192 * @return The conversion result is returned.
5195 s_ixhtml10_start_h1_tag(void *pdoc, Node *node)
5197 ixhtml10_t *ixhtml10;
5201 char *attr_style = NULL;
5202 char *attr_align = NULL;
5203 char *css_clear = NULL;
5205 ixhtml10 = GET_IXHTML10(pdoc);
5206 doc = ixhtml10->doc;
5209 for (attr = qs_get_attr(doc,node);
5211 attr = qs_get_next_attr(doc,attr)) {
5212 char *name = qs_get_attr_name(doc,attr);
5213 char *value = qs_get_attr_value(doc,attr);
5214 if (STRCASEEQ('a','A',"align", name)) {
5215 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5219 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5223 if (IS_CSS_ON(ixhtml10->entryp)) {
5224 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5226 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5227 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5229 css_property_t *cur;
5230 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5231 if (STRCASEEQ('l','L',"left", cur->value)) {
5232 attr_align = apr_pstrdup(doc->pool, "left");
5234 else if (STRCASEEQ('c','C',"center",cur->value)) {
5235 attr_align = apr_pstrdup(doc->pool, "center");
5237 else if (STRCASEEQ('r','R',"right",cur->value)) {
5238 attr_align = apr_pstrdup(doc->pool, "right");
5242 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5243 if (STRCASEEQ('b','B',"both", cur->value)) {
5244 css_clear = apr_pstrdup(doc->pool, "both");
5246 else if (STRCASEEQ('r','R',"right", cur->value)) {
5247 css_clear = apr_pstrdup(doc->pool, "right");
5249 else if (STRCASEEQ('l','L',"left", cur->value)) {
5250 css_clear = apr_pstrdup(doc->pool, "left");
5256 if (attr_align || css_clear ) {
5272 return ixhtml10->out;
5277 * It is a handler who processes the H1 tag.
5279 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5280 * destination is specified.
5281 * @param node [i] The H1 tag node is specified.
5282 * @return The conversion result is returned.
5285 s_ixhtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
5287 ixhtml10_t* ixhtml10;
5291 ixhtml10 = GET_IXHTML10(pdoc);
5292 doc = ixhtml10->doc;
5296 if (IS_CSS_ON(ixhtml10->entryp)) {
5297 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5300 return ixhtml10->out;
5305 * It is a handler who processes the H2 tag.
5307 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5308 * destination is specified.
5309 * @param node [i] The H1 tag node is specified.
5310 * @return The conversion result is returned.
5313 s_ixhtml10_start_h2_tag(void *pdoc, Node *node)
5315 ixhtml10_t *ixhtml10;
5319 char *attr_style = NULL;
5320 char *attr_align = NULL;
5321 char *css_clear = NULL;
5323 ixhtml10 = GET_IXHTML10(pdoc);
5324 doc = ixhtml10->doc;
5327 for (attr = qs_get_attr(doc,node);
5329 attr = qs_get_next_attr(doc,attr)) {
5330 char *name = qs_get_attr_name(doc,attr);
5331 char *value = qs_get_attr_value(doc,attr);
5332 if (STRCASEEQ('a','A',"align", name)) {
5333 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5337 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5341 if (IS_CSS_ON(ixhtml10->entryp)) {
5342 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5344 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5345 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5346 css_property_t *cur;
5347 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5348 if (STRCASEEQ('l','L',"left", cur->value)) {
5349 attr_align = apr_pstrdup(doc->pool, "left");
5351 else if (STRCASEEQ('c','C',"center",cur->value)) {
5352 attr_align = apr_pstrdup(doc->pool, "center");
5354 else if (STRCASEEQ('r','R',"right",cur->value)) {
5355 attr_align = apr_pstrdup(doc->pool, "right");
5358 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5359 if (STRCASEEQ('b','B',"both", cur->value)) {
5360 css_clear = apr_pstrdup(doc->pool, "both");
5362 else if (STRCASEEQ('r','R',"right", cur->value)) {
5363 css_clear = apr_pstrdup(doc->pool, "right");
5365 else if (STRCASEEQ('l','L',"left", cur->value)) {
5366 css_clear = apr_pstrdup(doc->pool, "left");
5372 if (attr_align || css_clear ) {
5388 return ixhtml10->out;
5393 * It is a handler who processes the H2 tag.
5395 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5396 * destination is specified.
5397 * @param node [i] The H1 tag node is specified.
5398 * @return The conversion result is returned.
5401 s_ixhtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
5403 ixhtml10_t* ixhtml10;
5407 ixhtml10 = GET_IXHTML10(pdoc);
5408 doc = ixhtml10->doc;
5412 if (IS_CSS_ON(ixhtml10->entryp)) {
5413 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5415 return ixhtml10->out;
5420 * It is a handler who processes the H3 tag.
5422 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5423 * destination is specified.
5424 * @param node [i] The H1 tag node is specified.
5425 * @return The conversion result is returned.
5428 s_ixhtml10_start_h3_tag(void *pdoc, Node *node)
5430 ixhtml10_t *ixhtml10;
5434 char *attr_style = NULL;
5435 char *attr_align = NULL;
5436 char *css_clear = NULL;
5438 ixhtml10 = GET_IXHTML10(pdoc);
5439 doc = ixhtml10->doc;
5442 for (attr = qs_get_attr(doc,node);
5444 attr = qs_get_next_attr(doc,attr)) {
5445 char *name = qs_get_attr_name(doc,attr);
5446 char *value = qs_get_attr_value(doc,attr);
5447 if (STRCASEEQ('a','A',"align", name)) {
5448 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5452 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5456 if (IS_CSS_ON(ixhtml10->entryp)) {
5457 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5459 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5460 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5461 css_property_t *cur;
5462 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5463 if (STRCASEEQ('l','L',"left", cur->value)) {
5464 attr_align = apr_pstrdup(doc->pool, "left");
5466 else if (STRCASEEQ('c','C',"center",cur->value)) {
5467 attr_align = apr_pstrdup(doc->pool, "center");
5469 else if (STRCASEEQ('r','R',"right",cur->value)) {
5470 attr_align = apr_pstrdup(doc->pool, "right");
5473 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5474 if (STRCASEEQ('b','B',"both", cur->value)) {
5475 css_clear = apr_pstrdup(doc->pool, "both");
5477 else if (STRCASEEQ('r','R',"right", cur->value)) {
5478 css_clear = apr_pstrdup(doc->pool, "right");
5480 else if (STRCASEEQ('l','L',"left", cur->value)) {
5481 css_clear = apr_pstrdup(doc->pool, "left");
5487 if (attr_align || css_clear ) {
5503 return ixhtml10->out;
5508 * It is a handler who processes the H3 tag.
5510 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5511 * destination is specified.
5512 * @param node [i] The H1 tag node is specified.
5513 * @return The conversion result is returned.
5516 s_ixhtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
5518 ixhtml10_t* ixhtml10;
5522 ixhtml10 = GET_IXHTML10(pdoc);
5523 doc = ixhtml10->doc;
5527 if (IS_CSS_ON(ixhtml10->entryp)) {
5528 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5530 return ixhtml10->out;
5535 * It is a handler who processes the H4 tag.
5537 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5538 * destination is specified.
5539 * @param node [i] The H1 tag node is specified.
5540 * @return The conversion result is returned.
5543 s_ixhtml10_start_h4_tag(void *pdoc, Node *node)
5545 ixhtml10_t *ixhtml10;
5549 char *attr_style = NULL;
5550 char *attr_align = NULL;
5551 char *css_clear = NULL;
5553 ixhtml10 = GET_IXHTML10(pdoc);
5554 doc = ixhtml10->doc;
5557 for (attr = qs_get_attr(doc,node);
5559 attr = qs_get_next_attr(doc,attr)) {
5560 char *name = qs_get_attr_name(doc,attr);
5561 char *value = qs_get_attr_value(doc,attr);
5562 if (STRCASEEQ('a','A',"align", name)) {
5563 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5567 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5571 if (IS_CSS_ON(ixhtml10->entryp)) {
5572 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5574 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5575 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5576 css_property_t *cur;
5577 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5578 if (STRCASEEQ('l','L',"left", cur->value)) {
5579 attr_align = apr_pstrdup(doc->pool, "left");
5581 else if (STRCASEEQ('c','C',"center",cur->value)) {
5582 attr_align = apr_pstrdup(doc->pool, "center");
5584 else if (STRCASEEQ('r','R',"right",cur->value)) {
5585 attr_align = apr_pstrdup(doc->pool, "right");
5588 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5589 if (STRCASEEQ('b','B',"both", cur->value)) {
5590 css_clear = apr_pstrdup(doc->pool, "both");
5592 else if (STRCASEEQ('r','R',"right", cur->value)) {
5593 css_clear = apr_pstrdup(doc->pool, "right");
5595 else if (STRCASEEQ('l','L',"left", cur->value)) {
5596 css_clear = apr_pstrdup(doc->pool, "left");
5602 if (attr_align || css_clear ) {
5618 return ixhtml10->out;
5623 * It is a handler who processes the H4 tag.
5625 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5626 * destination is specified.
5627 * @param node [i] The H1 tag node is specified.
5628 * @return The conversion result is returned.
5631 s_ixhtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
5633 ixhtml10_t *ixhtml10;
5637 ixhtml10 = GET_IXHTML10(pdoc);
5638 doc = ixhtml10->doc;
5642 if (IS_CSS_ON(ixhtml10->entryp)) {
5643 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5646 return ixhtml10->out;
5651 * It is a handler who processes the H5 tag.
5653 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5654 * destination is specified.
5655 * @param node [i] The H1 tag node is specified.
5656 * @return The conversion result is returned.
5659 s_ixhtml10_start_h5_tag(void *pdoc, Node *node)
5661 ixhtml10_t *ixhtml10;
5665 char *attr_style = NULL;
5666 char *attr_align = NULL;
5667 char *css_clear = NULL;
5669 ixhtml10 = GET_IXHTML10(pdoc);
5670 doc = ixhtml10->doc;
5673 for (attr = qs_get_attr(doc,node);
5675 attr = qs_get_next_attr(doc,attr)) {
5676 char *name = qs_get_attr_name(doc,attr);
5677 char *value = qs_get_attr_value(doc,attr);
5678 if (STRCASEEQ('a','A',"align", name)) {
5679 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5683 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5687 if (IS_CSS_ON(ixhtml10->entryp)) {
5688 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5690 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5691 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5692 css_property_t *cur;
5693 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5694 if (STRCASEEQ('l','L',"left", cur->value)) {
5695 attr_align = apr_pstrdup(doc->pool, "left");
5697 else if (STRCASEEQ('c','C',"center",cur->value)) {
5698 attr_align = apr_pstrdup(doc->pool, "center");
5700 else if (STRCASEEQ('r','R',"right",cur->value)) {
5701 attr_align = apr_pstrdup(doc->pool, "right");
5704 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5705 if (STRCASEEQ('b','B',"both", cur->value)) {
5706 css_clear = apr_pstrdup(doc->pool, "both");
5708 else if (STRCASEEQ('r','R',"right", cur->value)) {
5709 css_clear = apr_pstrdup(doc->pool, "right");
5711 else if (STRCASEEQ('l','L',"left", cur->value)) {
5712 css_clear = apr_pstrdup(doc->pool, "left");
5718 if (attr_align || css_clear ) {
5734 return ixhtml10->out;
5739 * It is a handler who processes the H5 tag.
5741 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5742 * destination is specified.
5743 * @param node [i] The H1 tag node is specified.
5744 * @return The conversion result is returned.
5747 s_ixhtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
5749 ixhtml10_t *ixhtml10;
5753 ixhtml10 = GET_IXHTML10(pdoc);
5754 doc = ixhtml10->doc;
5758 if (IS_CSS_ON(ixhtml10->entryp)) {
5759 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5762 return ixhtml10->out;
5767 * It is a handler who processes the H6 tag.
5769 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5770 * destination is specified.
5771 * @param node [i] The H1 tag node is specified.
5772 * @return The conversion result is returned.
5775 s_ixhtml10_start_h6_tag(void *pdoc, Node *node)
5777 ixhtml10_t *ixhtml10;
5781 char *attr_style = NULL;
5782 char *attr_align = NULL;
5783 char *css_clear = NULL;
5785 ixhtml10 = GET_IXHTML10(pdoc);
5786 doc = ixhtml10->doc;
5789 for (attr = qs_get_attr(doc,node);
5791 attr = qs_get_next_attr(doc,attr)) {
5792 char *name = qs_get_attr_name(doc,attr);
5793 char *value = qs_get_attr_value(doc,attr);
5794 if (STRCASEEQ('a','A',"align", name)) {
5795 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5799 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5803 if (IS_CSS_ON(ixhtml10->entryp)) {
5804 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5806 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5807 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5808 css_property_t *cur;
5809 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5810 if (STRCASEEQ('l','L',"left", cur->value)) {
5811 attr_align = apr_pstrdup(doc->pool, "left");
5813 else if (STRCASEEQ('c','C',"center",cur->value)) {
5814 attr_align = apr_pstrdup(doc->pool, "center");
5816 else if (STRCASEEQ('r','R',"right",cur->value)) {
5817 attr_align = apr_pstrdup(doc->pool, "right");
5820 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5821 if (STRCASEEQ('b','B',"both", cur->value)) {
5822 css_clear = apr_pstrdup(doc->pool, "both");
5824 else if (STRCASEEQ('r','R',"right", cur->value)) {
5825 css_clear = apr_pstrdup(doc->pool, "right");
5827 else if (STRCASEEQ('l','L',"left", cur->value)) {
5828 css_clear = apr_pstrdup(doc->pool, "left");
5834 if (attr_align || css_clear ) {
5850 return ixhtml10->out;
5855 * It is a handler who processes the H6 tag.
5857 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5858 * destination is specified.
5859 * @param node [i] The H1 tag node is specified.
5860 * @return The conversion result is returned.
5863 s_ixhtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
5865 ixhtml10_t *ixhtml10;
5869 ixhtml10 = GET_IXHTML10(pdoc);
5870 doc = ixhtml10->doc;
5874 if (IS_CSS_ON(ixhtml10->entryp)) {
5875 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5878 return ixhtml10->out;
5883 * It is a handler who processes the MENU tag.
5885 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5886 * destination is specified.
5887 * @param node [i] The MENU tag node is specified.
5888 * @return The conversion result is returned.
5891 s_ixhtml10_start_menu_tag(void *pdoc, Node *node)
5893 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5894 Doc *doc = ixhtml10->doc;
5896 char *attr_style = NULL;
5897 char *attr_color = NULL;
5898 char *attr_type = NULL;
5899 char *attr_size = NULL;
5900 for (attr = qs_get_attr(doc,node);
5902 attr = qs_get_next_attr(doc,attr)) {
5903 char *name = qs_get_attr_name(doc,attr);
5904 char *value = qs_get_attr_value(doc,attr);
5905 if (STRCASEEQ('t','T',"type",name)) {
5906 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
5910 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
5914 if (IS_CSS_ON(ixhtml10->entryp)) {
5915 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5917 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5918 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5919 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
5920 css_property_t *cur;
5921 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5922 if (cur->value && *cur->value) {
5923 attr_color = apr_pstrdup(doc->pool, cur->value);
5926 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5927 if (cur->value && *cur->value) {
5928 attr_type = apr_pstrdup(doc->pool, cur->value);
5931 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5932 if (cur->value && *cur->value) {
5933 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5934 attr_size = apr_pstrdup(doc->pool, cur->value);
5936 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5937 attr_size = apr_pstrdup(doc->pool, cur->value);
5939 else if (STRCASEEQ('s','S',"small",cur->value)) {
5940 attr_size = apr_pstrdup(doc->pool, cur->value);
5942 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5943 attr_size = apr_pstrdup(doc->pool, cur->value);
5945 else if (STRCASEEQ('l','L',"large",cur->value)) {
5946 attr_size = apr_pstrdup(doc->pool, cur->value);
5948 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5949 attr_size = apr_pstrdup(doc->pool, cur->value);
5951 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5952 attr_size = apr_pstrdup(doc->pool, cur->value);
5959 if (attr_type || attr_color || attr_size) {
5962 W_L("list-style-type:");
5967 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5980 return ixhtml10->out;
5985 * It is a handler who processes the MENU tag.
5987 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5988 * destination is specified.
5989 * @param node [i] The MENU tag node is specified.
5990 * @return The conversion result is returned.
5993 s_ixhtml10_end_menu_tag(void *pdoc, Node *UNUSED(child))
5995 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5996 Doc *doc = ixhtml10->doc;
5998 if (IS_CSS_ON(ixhtml10->entryp)) {
5999 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6001 return ixhtml10->out;
6006 * It is a handler who processes the PLAINTEXT tag.
6008 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6009 * destination is specified.
6010 * @param node [i] The PLAINTEXT tag node is specified.
6011 * @return The conversion result is returned.
6014 s_ixhtml10_start_plaintext_tag(void *pdoc, Node *node)
6016 ixhtml10_t *ixhtml10;
6019 ixhtml10 = GET_IXHTML10(pdoc);
6020 doc = ixhtml10->doc;
6022 s_ixhtml10_start_plaintext_tag_inner(pdoc,node);
6023 return ixhtml10->out;
6027 s_ixhtml10_start_plaintext_tag_inner(void *pdoc, Node *node)
6029 ixhtml10_t *ixhtml10;
6032 ixhtml10 = GET_IXHTML10(pdoc);
6033 doc = ixhtml10->doc;
6034 for (child = qs_get_child_node(doc, node);
6036 child = qs_get_next_node(doc, child)) {
6038 s_ixhtml10_start_plaintext_tag_inner(pdoc, child);
6040 return ixhtml10->out;
6045 * It is a handler who processes the PLAINTEXT tag.
6047 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6048 * destination is specified.
6049 * @param node [i] The PLAINTEXT tag node is specified.
6050 * @return The conversion result is returned.
6053 s_ixhtml10_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
6055 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6056 return ixhtml10->out;
6061 * It is a handler who processes the BLINK tag.
6063 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6064 * destination is specified.
6065 * @param node [i] The BLINK tag node is specified.
6066 * @return The conversion result is returned.
6069 s_ixhtml10_start_blink_tag(void *pdoc, Node *node)
6071 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6072 Doc *doc = ixhtml10->doc;
6074 char *attr_style = NULL;
6075 char *attr_color = NULL;
6076 char *attr_size = NULL;
6077 for (attr = qs_get_attr(doc,node);
6079 attr = qs_get_next_attr(doc,attr)) {
6080 char *name = qs_get_attr_name(doc,attr);
6081 char *value = qs_get_attr_value(doc,attr);
6082 if (STRCASEEQ('s','S',"style", name) && value && *value) {
6086 if (IS_CSS_ON(ixhtml10->entryp)) {
6087 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6089 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6090 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6091 css_property_t *cur;
6092 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6093 if (cur->value && *cur->value) {
6094 attr_color = apr_pstrdup(doc->pool, cur->value);
6097 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6098 if (cur->value && *cur->value) {
6099 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
6100 attr_size = apr_pstrdup(doc->pool, cur->value);
6102 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
6103 attr_size = apr_pstrdup(doc->pool, cur->value);
6105 else if (STRCASEEQ('s','S',"small",cur->value)) {
6106 attr_size = apr_pstrdup(doc->pool, cur->value);
6108 else if (STRCASEEQ('m','M',"medium",cur->value)) {
6109 attr_size = apr_pstrdup(doc->pool, cur->value);
6111 else if (STRCASEEQ('l','L',"large",cur->value)) {
6112 attr_size = apr_pstrdup(doc->pool, cur->value);
6114 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
6115 attr_size = apr_pstrdup(doc->pool, cur->value);
6117 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
6118 attr_size = apr_pstrdup(doc->pool, cur->value);
6125 W_L(" style=\"text-decoration:blink;");
6126 if (attr_color || attr_size) {
6128 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6141 return ixhtml10->out;
6146 * It is a handler who processes the BLINK tag.
6148 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6149 * destination is specified.
6150 * @param node [i] The BLINK tag node is specified.
6151 * @return The conversion result is returned.
6154 s_ixhtml10_end_blink_tag(void *pdoc, Node *UNUSED(child))
6156 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6157 Doc *doc = ixhtml10->doc;
6159 if (IS_CSS_ON(ixhtml10->entryp)) {
6160 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6162 return ixhtml10->out;
6167 * It is a handler who processes the MARQUEE tag.
6169 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6170 * destination is specified.
6171 * @param node [i] The MARQUEE tag node is specified.
6172 * @return The conversion result is returned.
6175 s_ixhtml10_start_marquee_tag(void *pdoc, Node *node)
6177 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6178 Doc *doc = ixhtml10->doc;
6180 char *attr_direction = NULL;
6181 char *attr_style = NULL;
6182 char *attr_color = NULL;
6183 char *attr_size = NULL;
6184 char *attr_bgcolor = NULL;
6185 /*--------------------------------------------------------------------------*/
6186 /* Get Attributes */
6187 /*--------------------------------------------------------------------------*/
6188 for (attr = qs_get_attr(doc,node);
6190 attr = qs_get_next_attr(doc,attr)) {
6191 char *name = qs_get_attr_name(doc,attr);
6192 char *value = qs_get_attr_value(doc,attr);
6193 if (STRCASEEQ('d','D',"direction", name)) {
6195 if (STRCASEEQ('l','L',"left",value)) {
6196 attr_direction = "rtl";
6198 else if (STRCASEEQ('r','R',"right",value)) {
6199 attr_direction = "ltr";
6203 else if (STRCASEEQ('b','B',"behavior",name)) {
6206 else if (STRCASEEQ('l','L',"loop",name)) {
6209 else if (STRCASEEQ('b','B',"bgcolor",name)) {
6210 if (value && *value) {
6211 attr_bgcolor = value;
6214 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
6218 if (IS_CSS_ON(ixhtml10->entryp)) {
6219 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6221 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6222 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6223 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
6224 css_property_t *direction_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
6225 css_property_t *cur;
6226 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6227 if (cur->value && *cur->value) {
6228 attr_color = apr_pstrdup(doc->pool, cur->value);
6231 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
6232 if (cur->value && *cur->value) {
6233 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
6236 for (cur = direction_prop->next; cur != direction_prop; cur = cur->next) {
6237 if (cur->value && *cur->value) {
6238 attr_direction = apr_pstrdup(doc->pool, cur->value);
6241 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6242 if (cur->value && *cur->value) {
6243 if ( STRCASEEQ('x','X',"xx-small",cur->value)
6244 || STRCASEEQ('x','X',"x-small", cur->value)
6245 || STRCASEEQ('s','S',"small", cur->value)
6246 || STRCASEEQ('m','M',"medium", cur->value)
6247 || STRCASEEQ('l','L',"large", cur->value)
6248 || STRCASEEQ('x','X',"x-large", cur->value)
6249 || STRCASEEQ('x','X',"xx-large",cur->value)) {
6250 attr_size = apr_pstrdup(doc->pool, cur->value);
6257 W_L(" style=\"display:-wap-marquee;");
6258 if (attr_color || attr_size || attr_direction || attr_bgcolor) {
6259 if (attr_direction) {
6260 W_L("-wap-marquee-dir:");
6261 W_V(attr_direction);
6265 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
6266 W_L("background-color:");
6271 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6285 return ixhtml10->out;
6290 * It is a handler who processes the MARQUEE tag.
6292 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6293 * destination is specified.
6294 * @param node [i] The MARQUEE tag node is specified.
6295 * @return The conversion result is returned.
6298 s_ixhtml10_end_marquee_tag(void *pdoc, Node *UNUSED(node))
6300 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6301 Doc *doc = ixhtml10->doc;
6303 if (IS_CSS_ON(ixhtml10->entryp)) {
6304 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6306 return ixhtml10->out;
6311 * It is handler who processes the New Line Code.
6314 s_ixhtml10_newline_mark(void *pdoc, Node *UNUSED(node))
6316 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6317 Doc *doc = ixhtml10->doc;
6318 if (ixhtml10->start_html_flag) {
6321 return ixhtml10->out;
6326 * It is a handler who processes the LINK tag.
6328 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6329 * destination is specified.
6330 * @param node [i] The LINK tag node is specified.
6331 * @return The conversion result is returned.
6334 s_ixhtml10_link_tag(void *pdoc, Node *node)
6336 ixhtml10_t *ixhtml10;
6343 ixhtml10 = GET_IXHTML10(pdoc);
6344 doc = ixhtml10->doc;
6346 if (! IS_CSS_ON(ixhtml10->entryp)) {
6347 return ixhtml10->out;
6350 for (attr = qs_get_attr(doc,node);
6352 attr = qs_get_next_attr(doc,attr)) {
6353 char *name = qs_get_attr_name(doc,attr);
6354 char *value = qs_get_attr_value(doc,attr);
6355 if (STRCASEEQ('r','R',"rel", name)) {
6356 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
6360 else if (STRCASEEQ('h','H',"href", name)) {
6361 if (value && *value) {
6365 else if (STRCASEEQ('t','T',"type", name)) {
6366 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6372 if (rel && href && type) {
6373 DBG(doc->r,"REQ[%X] start load CSS. url:[%s]", TO_ADDR(doc->r),href);
6374 ixhtml10->style = chxj_css_parse_from_uri(doc->r, doc->pool, ixhtml10->style, href);
6375 DBG(doc->r,"REQ[%X] end load CSS. url:[%s]", TO_ADDR(doc->r),href);
6378 return ixhtml10->out;
6382 static css_prop_list_t *
6383 s_ixhtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6385 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6386 Doc *doc = ixhtml10->doc;
6387 css_prop_list_t *last_css = NULL;
6388 if (IS_CSS_ON(ixhtml10->entryp)) {
6389 css_prop_list_t *dup_css;
6390 css_selector_t *selector;
6392 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6393 dup_css = chxj_dup_css_prop_list(doc, last_css);
6394 selector = chxj_css_find_selector(doc, ixhtml10->style, node);
6396 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6398 chxj_css_push_prop_list(ixhtml10->css_prop_stack, dup_css);
6399 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6401 if (style_attr_value) {
6402 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
6404 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6412 static css_prop_list_t *
6413 s_ixhtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6415 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6416 Doc *doc = ixhtml10->doc;
6417 css_prop_list_t *last_css = NULL;
6418 if (IS_CSS_ON(ixhtml10->entryp)) {
6419 css_prop_list_t *dup_css;
6420 css_selector_t *selector;
6422 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6423 dup_css = chxj_dup_css_prop_list(doc, last_css);
6424 selector = chxj_css_find_selector(doc, ixhtml10->style, node);
6426 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6430 if (style_attr_value) {
6431 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
6433 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6442 * It is a handler who processes the SPAN tag.
6444 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6445 * destination is specified.
6446 * @param node [i] The SPAN tag node is specified.
6447 * @return The conversion result is returned.
6450 s_ixhtml10_start_span_tag(void *pdoc, Node *node)
6452 ixhtml10_t *ixhtml10;
6455 char *attr_style = NULL;
6456 char *attr_color = NULL;
6457 char *attr_size = NULL;
6458 char *attr_align = NULL;
6459 char *attr_blink = NULL;
6460 char *attr_marquee = NULL;
6461 char *attr_marquee_dir = NULL;
6462 char *attr_marquee_style = NULL;
6463 char *attr_marquee_loop = NULL;
6464 char *css_bgcolor = NULL;
6466 ixhtml10 = GET_IXHTML10(pdoc);
6467 doc = ixhtml10->doc;
6469 for (attr = qs_get_attr(doc,node);
6471 attr = qs_get_next_attr(doc,attr)) {
6472 char *nm = qs_get_attr_name(doc,attr);
6473 char *val = qs_get_attr_value(doc,attr);
6474 if (val && STRCASEEQ('s','S',"style", nm)) {
6478 if (IS_CSS_ON(ixhtml10->entryp)) {
6479 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6481 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6482 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6483 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
6484 css_property_t *decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
6485 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
6486 css_property_t *marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
6487 css_property_t *marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
6488 css_property_t *marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
6489 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
6491 css_property_t *cur;
6492 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6493 attr_color = apr_pstrdup(doc->pool, cur->value);
6495 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6496 if (cur->value && *cur->value) {
6497 if ( STRCASEEQ('x','X',"xx-small",cur->value)
6498 || STRCASEEQ('x','X',"x-small", cur->value)
6499 || STRCASEEQ('s','S',"small", cur->value)
6500 || STRCASEEQ('m','M',"medium", cur->value)
6501 || STRCASEEQ('l','L',"large", cur->value)
6502 || STRCASEEQ('x','X',"x-large", cur->value)
6503 || STRCASEEQ('x','X',"xx-large",cur->value)) {
6504 attr_size = apr_pstrdup(doc->pool, cur->value);
6508 for (cur = decoration_prop->next; cur != decoration_prop; cur = cur->next) {
6509 if (cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
6510 attr_blink = apr_pstrdup(doc->pool, cur->value);
6513 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
6514 if (cur->value && strcasecmp("-wap-marquee",cur->value) == 0) {
6515 attr_marquee = apr_pstrdup(doc->pool, cur->value);
6518 for (cur = marquee_dir_prop->next; cur != marquee_dir_prop; cur = cur->next) {
6519 if (cur->value && *cur->value) {
6520 if ( STRCASEEQ('l','L',"ltr",cur->value)
6521 || STRCASEEQ('r','R',"rtl",cur->value)) {
6522 attr_marquee_dir = apr_pstrdup(doc->pool, cur->value);
6526 for (cur = marquee_style_prop->next; cur != marquee_style_prop; cur = cur->next) {
6527 if (cur->value && *cur->value) {
6528 if ( STRCASEEQ('s','S',"scroll",cur->value)
6529 || STRCASEEQ('s','S',"slide",cur->value)
6530 || STRCASEEQ('a','A',"alternate",cur->value)) {
6531 attr_marquee_style = apr_pstrdup(doc->pool, cur->value);
6535 for (cur = marquee_loop_prop->next; cur != marquee_loop_prop; cur = cur->next) {
6536 if (cur->value && *cur->value) {
6537 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
6538 attr_marquee_loop = "infinite";
6541 attr_marquee_loop = apr_pstrdup(doc->pool, cur->value);
6545 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
6546 if (STRCASEEQ('l','L',"left", cur->value)) {
6547 attr_align = apr_pstrdup(doc->pool, "left");
6549 else if (STRCASEEQ('c','C',"center",cur->value)) {
6550 attr_align = apr_pstrdup(doc->pool, "center");
6552 else if (STRCASEEQ('r','R',"right",cur->value)) {
6553 attr_align = apr_pstrdup(doc->pool, "right");
6556 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
6557 if (cur->value && *cur->value) {
6558 css_bgcolor = apr_pstrdup(doc->pool, cur->value);
6565 if (attr_color || attr_size || attr_align || attr_blink || attr_marquee || css_bgcolor) {
6568 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6584 W_L("text-decoration:");
6589 W_L("display:-wap-marquee;");
6590 if (attr_marquee_dir) {
6591 W_L("-wap-marquee-dir:");
6592 W_V(attr_marquee_dir);
6595 if (attr_marquee_style) {
6596 W_L("-wap-marquee-style:");
6597 W_V(attr_marquee_style);
6600 if (attr_marquee_loop) {
6601 W_L("-wap-marquee-loop:");
6602 W_V(attr_marquee_loop);
6607 W_L("background-color:");
6614 return ixhtml10->out;
6619 * It is a handler who processes the SPAN tag.
6621 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6622 * destination is specified.
6623 * @param node [i] The SPAN tag node is specified.
6624 * @return The conversion result is returned.
6627 s_ixhtml10_end_span_tag(void *pdoc, Node *UNUSED(node))
6629 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6630 Doc *doc = ixhtml10->doc;
6634 if (IS_CSS_ON(ixhtml10->entryp)) {
6635 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6638 return ixhtml10->out;
6643 * It is a handler who processes the STYLE tag.
6645 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6646 * destination is specified.
6647 * @param node [i] The STYLE tag node is specified.
6648 * @return The conversion result is returned.
6651 s_ixhtml10_style_tag(void *pdoc, Node *node)
6653 ixhtml10_t *ixhtml10;
6660 ixhtml10 = GET_IXHTML10(pdoc);
6661 doc = ixhtml10->doc;
6663 if (! IS_CSS_ON(ixhtml10->entryp)) {
6664 return ixhtml10->out;
6667 for (attr = qs_get_attr(doc,node);
6669 attr = qs_get_next_attr(doc,attr)) {
6670 char *name = qs_get_attr_name(doc,attr);
6671 char *value = qs_get_attr_value(doc,attr);
6672 if (STRCASEEQ('t','T',"type", name)) {
6673 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6681 for (child = qs_get_child_node(doc, node);
6683 child = qs_get_next_node(doc, child)) {
6684 char *name = qs_get_node_name(doc, child);
6685 if (STRCASEEQ('t','T',"text", name)) {
6686 char *value = qs_get_node_value(doc, child);
6687 if (value && *value) {
6688 style = apr_pstrcat(doc->r->pool, style, value, NULL);
6692 if (strlen(style) > 0) {
6693 DBG(doc->r,"REQ[%X] start load CSS. buf:[%s]", TO_ADDR(doc->r),style);
6694 ixhtml10->style = chxj_css_parse_style_value(doc, ixhtml10->style, style);
6695 DBG(doc->r,"REQ[%X] end load CSS. value:[%s]", TO_ADDR(doc->r),style);
6698 return ixhtml10->out;
6703 s_ixhtml10_create_style_data(apr_pool_t *pool, const char *style_data)
6708 return apr_pstrcat(pool, "<style type=\"text/css\"><![CDATA[",style_data, "]]></style>", NULL);
6713 * It is a handler who processes the NOBR tag.
6715 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6716 * destination is specified.
6717 * @param node [i] The NOBR tag node is specified.
6718 * @return The conversion result is returned.
6721 s_ixhtml10_start_nobr_tag(void *pdoc, Node *UNUSED(node))
6723 ixhtml10_t *ixhtml10;
6726 ixhtml10 = GET_IXHTML10(pdoc);
6727 doc = ixhtml10->doc;
6730 return ixhtml10->out;
6735 * It is a handler who processes the NOBR tag.
6737 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6738 * destination is specified.
6739 * @param node [i] The NOBR tag node is specified.
6740 * @return The conversion result is returned.
6743 s_ixhtml10_end_nobr_tag(void *pdoc, Node *UNUSED(node))
6745 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6746 Doc *doc = ixhtml10->doc;
6749 return ixhtml10->out;
6755 * It is a handler who processes the SMALL tag.
6757 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6758 * destination is specified.
6759 * @param node [i] The SMALL tag node is specified.
6760 * @return The conversion result is returned.
6763 s_ixhtml10_start_small_tag(void *pdoc, Node *UNUSED(node))
6765 ixhtml10_t *ixhtml10;
6768 ixhtml10 = GET_IXHTML10(pdoc);
6769 doc = ixhtml10->doc;
6772 return ixhtml10->out;
6777 * It is a handler who processes the SMALL tag.
6779 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6780 * destination is specified.
6781 * @param node [i] The SMALL tag node is specified.
6782 * @return The conversion result is returned.
6785 s_ixhtml10_end_small_tag(void *pdoc, Node *UNUSED(node))
6787 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6788 Doc *doc = ixhtml10->doc;
6791 return ixhtml10->out;
6795 * It is a handler who processes the OBJECT tag.
6797 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6798 * destination is specified.
6799 * @param node [i] The OBJECT tag node is specified.
6800 * @return The conversion result is returned.
6803 s_ixhtml10_start_object_tag(void *pdoc, Node *node)
6805 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6806 Doc *doc = ixhtml10->doc;
6808 char *attr_id = NULL;
6809 char *attr_width = NULL;
6810 char *attr_height = NULL;
6811 char *attr_data = NULL;
6812 char *attr_type = NULL;
6813 char *attr_declare = NULL;
6815 /*--------------------------------------------------------------------------*/
6816 /* Get Attributes */
6817 /*--------------------------------------------------------------------------*/
6818 for (attr = qs_get_attr(doc,node);
6820 attr = qs_get_next_attr(doc,attr)) {
6821 char *name = qs_get_attr_name(doc,attr);
6822 char *value = qs_get_attr_value(doc,attr);
6823 if (STRCASEEQ('i','I',"id",name)) {
6824 attr_id = apr_pstrdup(doc->pool, value);
6826 else if (STRCASEEQ('w','W',"width",name)) {
6827 attr_width = apr_pstrdup(doc->pool, value);
6829 else if (STRCASEEQ('h','H',"height",name)) {
6830 attr_height = apr_pstrdup(doc->pool, value);
6832 else if (STRCASEEQ('d','D',"data",name)) {
6833 attr_data = apr_pstrdup(doc->pool, value);
6835 else if (STRCASEEQ('t','T',"type",name)) {
6836 attr_type = apr_pstrdup(doc->pool, value);
6838 else if (STRCASEEQ('d','D',"declare",name)) {
6839 attr_declare = apr_pstrdup(doc->pool, value);
6870 W_L(" declare=\"declare\"");
6874 return ixhtml10->out;
6879 * It is a handler who processes the OBJECT tag.
6881 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6882 * destination is specified.
6883 * @param node [i] The OBJECT tag node is specified.
6884 * @return The conversion result is returned.
6887 s_ixhtml10_end_object_tag(void *pdoc, Node *UNUSED(node))
6889 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6890 Doc *doc = ixhtml10->doc;
6893 return ixhtml10->out;
6897 * It is a handler who processes the PARAM tag.
6899 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6900 * destination is specified.
6901 * @param node [i] The PARAM tag node is specified.
6902 * @return The conversion result is returned.
6905 s_ixhtml10_start_param_tag(void *pdoc, Node *node)
6907 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6908 Doc *doc = ixhtml10->doc;
6910 char *attr_name = NULL;
6911 char *attr_value = NULL;
6912 char *attr_valuetype = NULL;
6914 /*--------------------------------------------------------------------------*/
6915 /* Get Attributes */
6916 /*--------------------------------------------------------------------------*/
6917 for (attr = qs_get_attr(doc,node);
6919 attr = qs_get_next_attr(doc,attr)) {
6920 char *name = qs_get_attr_name(doc,attr);
6921 char *value = qs_get_attr_value(doc,attr);
6922 if (STRCASEEQ('n','N',"name",name)) {
6923 attr_name = apr_pstrdup(doc->pool, value);
6925 else if (STRCASEEQ('v','V',"value",name)) {
6926 attr_value = apr_pstrdup(doc->pool, value);
6928 else if (STRCASEEQ('v','V',"valuetype",name)) {
6929 attr_valuetype = apr_pstrdup(doc->pool, value);
6945 W_L(" valuetype=\"");
6946 W_V(attr_valuetype);
6950 return ixhtml10->out;
6954 * It is a handler who processes the CAPTION tag.
6956 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6957 * destination is specified.
6958 * @param node [i] The CAPTION tag node is specified.
6959 * @return The conversion result is returned.
6962 s_ixhtml10_start_caption_tag(void *pdoc, Node *node)
6964 ixhtml10_t *ixhtml10;
6968 char *attr_style = NULL;
6969 char *attr_align = NULL;
6971 ixhtml10 = GET_IXHTML10(pdoc);
6972 doc = ixhtml10->doc;
6975 for (attr = qs_get_attr(doc,node);
6977 attr = qs_get_next_attr(doc,attr)) {
6978 char *name = qs_get_attr_name(doc,attr);
6979 char *value = qs_get_attr_value(doc,attr);
6980 if (STRCASEEQ('a','A',"align", name)) {
6982 (STRCASEEQ('l','L',"left",value)
6983 || STRCASEEQ('r','R',"right",value)
6984 || STRCASEEQ('t','T',"top",value)
6985 || STRCASEEQ('b','B',"bottom",value)
6990 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
7001 return ixhtml10->out;
7006 * It is a handler who processes the CAPTION tag.
7008 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
7009 * destination is specified.
7010 * @param node [i] The CAPTION tag node is specified.
7011 * @return The conversion result is returned.
7014 s_ixhtml10_end_caption_tag(void *pdoc, Node *UNUSED(node))
7016 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
7017 Doc *doc = ixhtml10->doc;
7020 return ixhtml10->out;