2 * Copyright (C) 2005-2009 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"
29 #define GET_IXHTML10(X) ((ixhtml10_t *)(X))
32 #define W_L(X) do { ixhtml10->out = BUFFERED_WRITE_LITERAL(ixhtml10->out, &doc->buf, (X)); } while(0)
33 #define W_V(X) do { ixhtml10->out = (X) ? BUFFERED_WRITE_VALUE(ixhtml10->out, &doc->buf, (X)) \
34 : BUFFERED_WRITE_LITERAL(ixhtml10->out, &doc->buf, ""); } while(0)
36 #define W_NLCODE() do { char *nlcode = TO_NLCODE(ixhtml10->conf); W_V(nlcode); } while (0)
38 static char *s_ixhtml10_start_html_tag (void *pdoc, Node *node);
39 static char *s_ixhtml10_end_html_tag (void *pdoc, Node *node);
40 static char *s_ixhtml10_start_meta_tag (void *pdoc, Node *node);
41 static char *s_ixhtml10_end_meta_tag (void *pdoc, Node *node);
42 static char *s_ixhtml10_start_head_tag (void *pdoc, Node *node);
43 static char *s_ixhtml10_end_head_tag (void *pdoc, Node *node);
44 static char *s_ixhtml10_start_title_tag (void *pdoc, Node *node);
45 static char *s_ixhtml10_end_title_tag (void *pdoc, Node *node);
46 static char *s_ixhtml10_start_base_tag (void *pdoc, Node *node);
47 static char *s_ixhtml10_end_base_tag (void *pdoc, Node *node);
48 static char *s_ixhtml10_start_body_tag (void *pdoc, Node *node);
49 static char *s_ixhtml10_end_body_tag (void *pdoc, Node *node);
50 static char *s_ixhtml10_start_a_tag (void *pdoc, Node *node);
51 static char *s_ixhtml10_end_a_tag (void *pdoc, Node *node);
52 static char *s_ixhtml10_start_pre_tag (void *pdoc, Node *node);
53 static char *s_ixhtml10_end_pre_tag (void *pdoc, Node *node);
54 static char *s_ixhtml10_start_p_tag (void *pdoc, Node *node);
55 static char *s_ixhtml10_end_p_tag (void *pdoc, Node *node);
56 static char *s_ixhtml10_start_ul_tag (void *pdoc, Node *node);
57 static char *s_ixhtml10_end_ul_tag (void *pdoc, Node *node);
58 static char *s_ixhtml10_start_ol_tag (void *pdoc, Node *node);
59 static char *s_ixhtml10_end_ol_tag (void *pdoc, Node *node);
60 static char *s_ixhtml10_start_li_tag (void *pdoc, Node *node);
61 static char *s_ixhtml10_end_li_tag (void *pdoc, Node *node);
62 static char *s_ixhtml10_start_br_tag (void *pdoc, Node *node);
63 static char *s_ixhtml10_end_br_tag (void *pdoc, Node *node);
64 static char *s_ixhtml10_start_table_tag (void *pdoc, Node *node);
65 static char *s_ixhtml10_end_table_tag (void *pdoc, Node *node);
66 static char *s_ixhtml10_start_tr_tag (void *pdoc, Node *node);
67 static char *s_ixhtml10_end_tr_tag (void *pdoc, Node *node);
68 static char *s_ixhtml10_start_th_tag (void *pdoc, Node *node);
69 static char *s_ixhtml10_end_th_tag (void *pdoc, Node *node);
70 static char *s_ixhtml10_start_td_tag (void *pdoc, Node *node);
71 static char *s_ixhtml10_end_td_tag (void *pdoc, Node *node);
72 static char *s_ixhtml10_start_td_or_th_tag (void *pdoc, Node *node,char *tagName);
73 static char *s_ixhtml10_end_td_or_th_tag (void *pdoc, Node *node,char *tagName);
74 static char *s_ixhtml10_start_font_tag (void *pdoc, Node *node);
75 static char *s_ixhtml10_end_font_tag (void *pdoc, Node *node);
76 static char *s_ixhtml10_start_form_tag (void *pdoc, Node *node);
77 static char *s_ixhtml10_end_form_tag (void *pdoc, Node *node);
78 static char *s_ixhtml10_start_input_tag (void *pdoc, Node *node);
79 static char *s_ixhtml10_end_input_tag (void *pdoc, Node *node);
80 static char *s_ixhtml10_start_center_tag (void *pdoc, Node *node);
81 static char *s_ixhtml10_end_center_tag (void *pdoc, Node *node);
82 static char *s_ixhtml10_start_hr_tag (void *pdoc, Node *node);
83 static char *s_ixhtml10_end_hr_tag (void *pdoc, Node *node);
84 static char *s_ixhtml10_start_img_tag (void *pdoc, Node *node);
85 static char *s_ixhtml10_end_img_tag (void *pdoc, Node *node);
86 static char *s_ixhtml10_start_select_tag (void *pdoc, Node *node);
87 static char *s_ixhtml10_end_select_tag (void *pdoc, Node *node);
88 static char *s_ixhtml10_start_option_tag (void *pdoc, Node *node);
89 static char *s_ixhtml10_end_option_tag (void *pdoc, Node *node);
90 static char *s_ixhtml10_start_div_tag (void *pdoc, Node *node);
91 static char *s_ixhtml10_end_div_tag (void *pdoc, Node *node);
92 static char *s_ixhtml10_start_textarea_tag (void *pdoc, Node *node);
93 static char *s_ixhtml10_end_textarea_tag (void *pdoc, Node *node);
94 static char *s_ixhtml10_start_b_tag (void *pdoc, Node *node);
95 static char *s_ixhtml10_end_b_tag (void *pdoc, Node *node);
96 static char *s_ixhtml10_chxjif_tag (void *pdoc, Node *node);
97 static char *s_ixhtml10_text_tag (void *pdoc, Node *node);
98 static char *s_ixhtml10_start_blockquote_tag (void *pdoc, Node *node);
99 static char *s_ixhtml10_end_blockquote_tag (void *pdoc, Node *node);
100 static char *s_ixhtml10_start_dir_tag (void *pdoc, Node *node);
101 static char *s_ixhtml10_end_dir_tag (void *pdoc, Node *node);
102 static char *s_ixhtml10_start_dl_tag (void *pdoc, Node *node);
103 static char *s_ixhtml10_end_dl_tag (void *pdoc, Node *node);
104 static char *s_ixhtml10_start_dt_tag (void *pdoc, Node *node);
105 static char *s_ixhtml10_end_dt_tag (void *pdoc, Node *node);
106 static char *s_ixhtml10_start_dd_tag (void *pdoc, Node *node);
107 static char *s_ixhtml10_end_dd_tag (void *pdoc, Node *node);
108 static char *s_ixhtml10_start_h1_tag (void *pdoc, Node *node);
109 static char *s_ixhtml10_end_h1_tag (void *pdoc, Node *node);
110 static char *s_ixhtml10_start_h2_tag (void *pdoc, Node *node);
111 static char *s_ixhtml10_end_h2_tag (void *pdoc, Node *node);
112 static char *s_ixhtml10_start_h3_tag (void *pdoc, Node *node);
113 static char *s_ixhtml10_end_h3_tag (void *pdoc, Node *node);
114 static char *s_ixhtml10_start_h4_tag (void *pdoc, Node *node);
115 static char *s_ixhtml10_end_h4_tag (void *pdoc, Node *node);
116 static char *s_ixhtml10_start_h5_tag (void *pdoc, Node *node);
117 static char *s_ixhtml10_end_h5_tag (void *pdoc, Node *node);
118 static char *s_ixhtml10_start_h6_tag (void *pdoc, Node *node);
119 static char *s_ixhtml10_end_h6_tag (void *pdoc, Node *node);
120 static char *s_ixhtml10_start_menu_tag (void *pdoc, Node *node);
121 static char *s_ixhtml10_end_menu_tag (void *pdoc, Node *node);
122 static char *s_ixhtml10_start_plaintext_tag (void *pdoc, Node *node);
123 static char *s_ixhtml10_start_plaintext_tag_inner (void *pdoc, Node *node);
124 static char *s_ixhtml10_end_plaintext_tag (void *pdoc, Node *node);
125 static char *s_ixhtml10_start_blink_tag (void *pdoc, Node *node);
126 static char *s_ixhtml10_end_blink_tag (void *pdoc, Node *node);
127 static char *s_ixhtml10_start_marquee_tag (void *pdoc, Node *node);
128 static char *s_ixhtml10_end_marquee_tag (void *pdoc, Node *node);
129 static char *s_ixhtml10_newline_mark (void *pdoc, Node *node);
130 static char *s_ixhtml10_link_tag (void *pdoc, Node *node);
131 static char *s_ixhtml10_start_span_tag (void *pdoc, Node *node);
132 static char *s_ixhtml10_end_span_tag (void *pdoc, Node *node);
133 static char *s_ixhtml10_style_tag (void *pdoc, Node *node);
134 static char *s_ixhtml10_create_style_data(apr_pool_t *pool, const char *style_data);
135 static char *s_ixhtml10_start_nobr_tag (void *pdoc, Node *node);
136 static char *s_ixhtml10_end_nobr_tag (void *pdoc, Node *node);
137 static char *s_ixhtml10_start_small_tag (void *pdoc, Node *node);
138 static char *s_ixhtml10_end_small_tag (void *pdoc, Node *node);
139 static char *s_ixhtml10_start_object_tag (void *pdoc, Node *node);
140 static char *s_ixhtml10_end_object_tag (void *pdoc, Node *node);
141 static char *s_ixhtml10_start_param_tag (void *pdoc, Node *node);
142 static char *s_ixhtml10_start_caption_tag (void *pdoc, Node *node);
143 static char *s_ixhtml10_end_caption_tag (void *pdoc, Node *node);
145 static void s_init_ixhtml10(ixhtml10_t *ixhtml10, Doc *doc, request_rec *r, device_table *spec);
147 static int s_ixhtml10_search_emoji(ixhtml10_t *ixhtml10, char *txt, char **rslt,Node *node);
149 static char *s_ixhtml10_istyle_to_wap_input_format(apr_pool_t *p, const char *s);
150 static css_prop_list_t *s_ixhtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
151 static css_prop_list_t *s_ixhtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
156 tag_handler ixhtml10_handler[] = {
159 s_ixhtml10_start_html_tag,
160 s_ixhtml10_end_html_tag,
164 s_ixhtml10_start_meta_tag,
165 s_ixhtml10_end_meta_tag,
169 s_ixhtml10_start_textarea_tag,
170 s_ixhtml10_end_textarea_tag,
174 s_ixhtml10_start_p_tag,
175 s_ixhtml10_end_p_tag,
179 s_ixhtml10_start_pre_tag,
180 s_ixhtml10_end_pre_tag,
184 s_ixhtml10_start_ul_tag,
185 s_ixhtml10_end_ul_tag,
189 s_ixhtml10_start_li_tag,
190 s_ixhtml10_end_li_tag,
194 s_ixhtml10_start_ol_tag,
195 s_ixhtml10_end_ol_tag,
199 s_ixhtml10_start_h1_tag,
200 s_ixhtml10_end_h1_tag,
204 s_ixhtml10_start_h2_tag,
205 s_ixhtml10_end_h2_tag,
209 s_ixhtml10_start_h3_tag,
210 s_ixhtml10_end_h3_tag,
214 s_ixhtml10_start_h4_tag,
215 s_ixhtml10_end_h4_tag,
219 s_ixhtml10_start_h5_tag,
220 s_ixhtml10_end_h5_tag,
224 s_ixhtml10_start_h6_tag,
225 s_ixhtml10_end_h6_tag,
229 s_ixhtml10_start_head_tag,
230 s_ixhtml10_end_head_tag,
234 s_ixhtml10_start_title_tag,
235 s_ixhtml10_end_title_tag,
239 s_ixhtml10_start_base_tag,
240 s_ixhtml10_end_base_tag,
244 s_ixhtml10_start_body_tag,
245 s_ixhtml10_end_body_tag,
249 s_ixhtml10_start_a_tag,
250 s_ixhtml10_end_a_tag,
254 s_ixhtml10_start_br_tag,
255 s_ixhtml10_end_br_tag,
259 s_ixhtml10_start_table_tag,
260 s_ixhtml10_end_table_tag,
264 s_ixhtml10_start_tr_tag,
265 s_ixhtml10_end_tr_tag,
269 s_ixhtml10_start_td_tag,
270 s_ixhtml10_end_td_tag,
279 s_ixhtml10_start_font_tag,
280 s_ixhtml10_end_font_tag,
284 s_ixhtml10_start_form_tag,
285 s_ixhtml10_end_form_tag,
289 s_ixhtml10_start_input_tag,
290 s_ixhtml10_end_input_tag,
294 s_ixhtml10_start_center_tag,
295 s_ixhtml10_end_center_tag,
299 s_ixhtml10_start_hr_tag,
300 s_ixhtml10_end_hr_tag,
304 s_ixhtml10_start_img_tag,
305 s_ixhtml10_end_img_tag,
309 s_ixhtml10_start_select_tag,
310 s_ixhtml10_end_select_tag,
314 s_ixhtml10_start_option_tag,
315 s_ixhtml10_end_option_tag,
319 s_ixhtml10_start_div_tag,
320 s_ixhtml10_end_div_tag,
324 s_ixhtml10_chxjif_tag,
329 s_ixhtml10_chxjif_tag,
334 s_ixhtml10_start_nobr_tag,
335 s_ixhtml10_end_nobr_tag,
339 s_ixhtml10_start_small_tag,
340 s_ixhtml10_end_small_tag,
344 s_ixhtml10_style_tag,
349 s_ixhtml10_start_span_tag,
350 s_ixhtml10_end_span_tag,
359 s_ixhtml10_start_th_tag,
360 s_ixhtml10_end_th_tag,
364 s_ixhtml10_start_b_tag,
365 s_ixhtml10_end_b_tag,
374 s_ixhtml10_start_dt_tag,
375 s_ixhtml10_end_dt_tag,
389 s_ixhtml10_start_blockquote_tag,
390 s_ixhtml10_end_blockquote_tag,
394 s_ixhtml10_start_dir_tag,
395 s_ixhtml10_end_dir_tag,
399 s_ixhtml10_start_dl_tag,
400 s_ixhtml10_end_dl_tag,
404 s_ixhtml10_start_dd_tag,
405 s_ixhtml10_end_dd_tag,
409 s_ixhtml10_start_menu_tag,
410 s_ixhtml10_end_menu_tag,
414 s_ixhtml10_start_plaintext_tag,
415 s_ixhtml10_end_plaintext_tag,
419 s_ixhtml10_start_blink_tag,
420 s_ixhtml10_end_blink_tag,
424 s_ixhtml10_start_marquee_tag,
425 s_ixhtml10_end_marquee_tag,
434 s_ixhtml10_newline_mark,
439 s_ixhtml10_start_object_tag,
440 s_ixhtml10_end_object_tag,
444 s_ixhtml10_start_param_tag,
449 s_ixhtml10_start_caption_tag,
450 s_ixhtml10_end_caption_tag,
456 * converts from CHTML5.0 to IXHTML10.
458 * @param r [i] Requet_rec is appointed.
459 * @param spec [i] The result of the device specification processing which
460 * was done in advance is appointed.
461 * @param src [i] The character string before the converting is appointed.
462 * @return The character string after the converting is returned.
465 chxj_convert_ixhtml10(
471 chxjconvrule_entry *entryp,
482 /*--------------------------------------------------------------------------*/
484 /*--------------------------------------------------------------------------*/
486 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
488 DBG(r,"I found qrcode xml");
491 DBG(r,"not found qrcode xml");
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,"spec is NULL");
614 for (ee = ixhtml10->conf->emoji;
617 if (ee->imode == NULL) {
618 DBG(r, "emoji->imode is NULL");
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_ixhtml10_start_html_tag()", (unsigned int)(apr_size_t)r);
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_ixhtml10_start_html_tag()", (unsigned int)(apr_size_t)r);
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 *UNUSED(node))
909 ixhtml10_t *ixhtml10;
913 ixhtml10 = GET_IXHTML10(pdoc);
918 return ixhtml10->out;
923 * It is a handler who processes the TITLE tag.
925 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
926 * destination is specified.
927 * @param node [i] The TITLE tag node is specified.
928 * @return The conversion result is returned.
931 s_ixhtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
933 ixhtml10_t *ixhtml10;
937 ixhtml10 = GET_IXHTML10(pdoc);
942 return ixhtml10->out;
947 * It is a handler who processes the BASE tag.
949 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
950 * destination is specified.
951 * @param node [i] The BASE tag node is specified.
952 * @return The conversion result is returned.
955 s_ixhtml10_start_base_tag(void *pdoc, Node *node)
957 ixhtml10_t *ixhtml10;
962 ixhtml10 = GET_IXHTML10(pdoc);
967 /*--------------------------------------------------------------------------*/
969 /*--------------------------------------------------------------------------*/
970 for (attr = qs_get_attr(doc,node);
972 attr = qs_get_next_attr(doc,attr)) {
973 char *name = qs_get_attr_name(doc,attr);
974 char *value = qs_get_attr_value(doc,attr);
975 if (STRCASEEQ('h','H',"href",name)) {
982 return ixhtml10->out;
987 * It is a handler who processes the BASE tag.
989 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
990 * destination is specified.
991 * @param node [i] The BASE tag node is specified.
992 * @return The conversion result is returned.
995 s_ixhtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
997 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
998 return ixhtml10->out;
1003 * It is a handler who processes the BODY tag.
1005 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1006 * destination is specified.
1007 * @param node [i] The BODY tag node is specified.
1008 * @return The conversion result is returned.
1011 s_ixhtml10_start_body_tag(void *pdoc, Node *node)
1013 ixhtml10_t *ixhtml10;
1017 char *attr_bgcolor = NULL;
1018 char *attr_text = NULL;
1019 char *attr_link = NULL;
1020 char *attr_vlink = NULL;
1021 char *attr_alink = NULL;
1022 char *attr_style = NULL;
1023 char *attr_background = NULL;
1025 ixhtml10 = GET_IXHTML10(pdoc);
1026 doc = ixhtml10->doc;
1029 /*--------------------------------------------------------------------------*/
1030 /* Get Attributes */
1031 /*--------------------------------------------------------------------------*/
1032 for (attr = qs_get_attr(doc,node);
1034 attr = qs_get_next_attr(doc,attr)) {
1035 char *name = qs_get_attr_name(doc,attr);
1036 char *value = qs_get_attr_value(doc,attr);
1037 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1038 /*----------------------------------------------------------------------*/
1040 /*----------------------------------------------------------------------*/
1041 attr_bgcolor = value;
1043 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1044 /*----------------------------------------------------------------------*/
1046 /*----------------------------------------------------------------------*/
1049 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1050 /*----------------------------------------------------------------------*/
1052 /*----------------------------------------------------------------------*/
1055 else if (STRCASEEQ('a','A',"alink",name) && value && *value) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1061 else if (STRCASEEQ('v','V',"vlink",name) && value && *value) {
1062 /*----------------------------------------------------------------------*/
1064 /*----------------------------------------------------------------------*/
1067 else if (STRCASEEQ('b','B',"background",name) && value && *value) {
1068 /*----------------------------------------------------------------------*/
1070 /*----------------------------------------------------------------------*/
1071 attr_background = value;
1073 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1078 if (IS_CSS_ON(ixhtml10->entryp)) {
1079 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1081 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1082 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1083 css_property_t *bgimage_prop = chxj_css_get_property_value(doc, style, "background-image");
1084 css_property_t *cur;
1085 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1086 if (cur->value && *cur->value) {
1087 attr_text = apr_pstrdup(doc->pool, cur->value);
1090 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1091 if (cur->value && *cur->value) {
1092 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1095 for (cur = bgimage_prop->next; cur != bgimage_prop; cur = cur->next) {
1096 if (cur->value && *cur->value) {
1097 char *tmp = apr_pstrdup(doc->pool, cur->value);
1098 char *tmps = strstr(tmp,"(");
1100 char *tmpe = strstr(tmp,")");
1101 size_t len = strlen(tmps) - strlen(tmpe) -1 ;
1103 attr_background = apr_pstrndup(doc->pool, tmps,len);
1108 if (ixhtml10->style) {
1109 css_stylesheet_t *pseudos = chxj_find_pseudo_selectors(doc, ixhtml10->style);
1110 css_selector_t *cur_sel;
1111 for (cur_sel = pseudos->selector_head.next; cur_sel != &pseudos->selector_head; cur_sel = cur_sel->next) {
1112 if (cur_sel->name && strcasecmp(cur_sel->name, "a:link") == 0) {
1113 css_property_t *cur;
1114 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1115 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1116 attr_link = apr_pstrdup(doc->pool, cur->value);
1120 else if (cur_sel->name && strcasecmp(cur_sel->name, "a:visited") == 0) {
1121 css_property_t *cur;
1122 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1123 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1124 attr_vlink = apr_pstrdup(doc->pool, cur->value);
1128 else if (cur_sel->name && strcasecmp(cur_sel->name, "a:focus") == 0) {
1129 css_property_t *cur;
1130 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1131 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1132 attr_alink = apr_pstrdup(doc->pool, cur->value);
1142 if (attr_bgcolor || attr_text) {
1145 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1146 W_L("background-color:");
1151 attr_text = chxj_css_rgb_func_to_value(doc->pool, attr_text);
1156 if( attr_background) {
1157 W_L("background-image:url(");
1158 W_V(attr_background);
1164 char *style_data = NULL;
1166 attr_link = chxj_css_rgb_func_to_value(doc->pool, attr_link);
1167 style_data = apr_psprintf(doc->pool, "a:link { color:%s; }", attr_link);
1170 attr_vlink = chxj_css_rgb_func_to_value(doc->pool, attr_vlink);
1171 style_data = apr_pstrcat(doc->pool, (style_data) ? style_data : "",
1172 apr_psprintf(doc->pool, "a:visited { color:%s; }", attr_vlink), NULL);
1175 attr_alink = chxj_css_rgb_func_to_value(doc->pool, attr_alink);
1176 style_data = apr_pstrcat(doc->pool, (style_data) ? style_data : "",
1177 apr_psprintf(doc->pool, "a:focus { color:%s; }", attr_alink), NULL);
1180 ixhtml10->style_data = apr_pstrcat(doc->pool, (ixhtml10->style_data) ? ixhtml10->style_data : "",
1184 return ixhtml10->out;
1189 * It is a handler who processes the BODY tag.
1191 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1192 * destination is specified.
1193 * @param node [i] The BODY tag node is specified.
1194 * @return The conversion result is returned.
1197 s_ixhtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1199 ixhtml10_t *ixhtml10;
1203 ixhtml10 = GET_IXHTML10(pdoc);
1204 doc = ixhtml10->doc;
1208 if (IS_CSS_ON(ixhtml10->entryp)) {
1209 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1211 return ixhtml10->out;
1216 * It is a handler who processes the A tag.
1218 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1219 * destination is specified.
1220 * @param node [i] The A tag node is specified.
1221 * @return The conversion result is returned.
1224 s_ixhtml10_start_a_tag(void *pdoc, Node *node)
1226 ixhtml10_t *ixhtml10;
1230 char *attr_style = NULL;
1231 char *attr_id = NULL;
1232 char *attr_lcs = NULL;
1234 ixhtml10 = GET_IXHTML10(pdoc);
1235 doc = ixhtml10->doc;
1239 /*--------------------------------------------------------------------------*/
1240 /* Get Attributes */
1241 /*--------------------------------------------------------------------------*/
1242 for (attr = qs_get_attr(doc,node);
1244 attr = qs_get_next_attr(doc,attr)) {
1245 char *name = qs_get_attr_name(doc,attr);
1246 char *value = qs_get_attr_value(doc,attr);
1247 if (STRCASEEQ('i','I',"id",name)){
1248 attr_id = apr_pstrdup(doc->buf.pool, value);
1250 if (STRCASEEQ('n','N',"name",name)) {
1251 /*----------------------------------------------------------------------*/
1253 /*----------------------------------------------------------------------*/
1254 attr_id = apr_pstrdup(doc->buf.pool, value);
1256 else if (STRCASEEQ('h','H',"href",name)) {
1257 /*----------------------------------------------------------------------*/
1259 /*----------------------------------------------------------------------*/
1260 value = chxj_encoding_parameter(r, value, 1);
1261 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1262 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
1268 else if (STRCASEEQ('a','A',"accesskey",name)) {
1269 /*----------------------------------------------------------------------*/
1271 /*----------------------------------------------------------------------*/
1272 W_L(" accesskey=\"");
1276 else if (STRCASEEQ('c','C',"cti",name)) {
1277 /*----------------------------------------------------------------------*/
1279 /*----------------------------------------------------------------------*/
1284 else if (STRCASEEQ('i','I',"ijam",name)) {
1285 /*----------------------------------------------------------------------*/
1287 /*----------------------------------------------------------------------*/
1290 else if (STRCASEEQ('u','U',"utn",name)) {
1291 /*----------------------------------------------------------------------*/
1293 /* It is special only for CHTML. */
1294 /*----------------------------------------------------------------------*/
1295 W_L(" utn=\"utn\"");
1297 else if (STRCASEEQ('t','T',"telbook",name)) {
1298 /*----------------------------------------------------------------------*/
1300 /*----------------------------------------------------------------------*/
1303 else if (STRCASEEQ('k','K',"kana",name)) {
1304 /*----------------------------------------------------------------------*/
1306 /*----------------------------------------------------------------------*/
1309 else if (STRCASEEQ('e','E',"email",name)) {
1310 /*----------------------------------------------------------------------*/
1312 /*----------------------------------------------------------------------*/
1315 else if (STRCASEEQ('i','I',"ista",name)) {
1316 /*----------------------------------------------------------------------*/
1318 /*----------------------------------------------------------------------*/
1321 else if (STRCASEEQ('i','I',"ilet",name)) {
1322 /*----------------------------------------------------------------------*/
1324 /*----------------------------------------------------------------------*/
1327 else if (STRCASEEQ('i','I',"iswf",name)) {
1328 /*----------------------------------------------------------------------*/
1330 /*----------------------------------------------------------------------*/
1333 else if (STRCASEEQ('i','I',"irst",name)) {
1334 /*----------------------------------------------------------------------*/
1336 /*----------------------------------------------------------------------*/
1339 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1340 /*----------------------------------------------------------------------*/
1342 /*----------------------------------------------------------------------*/
1345 if (STRCASEEQ('l','L',"lcs",name)) {
1361 if (IS_CSS_ON(ixhtml10->entryp)) {
1362 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1365 return ixhtml10->out;
1370 * It is a handler who processes the A tag.
1372 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1373 * destination is specified.
1374 * @param node [i] The A tag node is specified.
1375 * @return The conversion result is returned.
1378 s_ixhtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1380 ixhtml10_t *ixhtml10;
1384 ixhtml10 = GET_IXHTML10(pdoc);
1385 doc = ixhtml10->doc;
1390 if (IS_CSS_ON(ixhtml10->entryp)) {
1391 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1394 return ixhtml10->out;
1399 * It is a handler who processes the BR tag.
1401 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1402 * destination is specified.
1403 * @param node [i] The BR tag node is specified.
1404 * @return The conversion result is returned.
1407 s_ixhtml10_start_br_tag(void *pdoc, Node *node)
1409 ixhtml10_t *ixhtml10;
1413 char *attr_style = NULL;
1414 char *attr_clear = NULL;
1416 ixhtml10 = GET_IXHTML10(pdoc);
1417 doc = ixhtml10->doc;
1420 /*--------------------------------------------------------------------------*/
1421 /* Get Attributes */
1422 /*--------------------------------------------------------------------------*/
1423 for (attr = qs_get_attr(doc,node);
1425 attr = qs_get_next_attr(doc,attr)) {
1426 char *name = qs_get_attr_name(doc,attr);
1427 char *value = qs_get_attr_value(doc,attr);
1428 if (STRCASEEQ('c','C',"clear",name)) {
1429 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1433 else if (STRCASEEQ('s','S',"style",name)) {
1437 if (IS_CSS_ON(ixhtml10->entryp)) {
1438 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1440 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
1441 css_property_t *cur;
1442 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
1443 if (cur->value && *cur->value) {
1444 if ( STRCASEEQ('l','L',"left", cur->value)
1445 || STRCASEEQ('r','R',"right", cur->value)
1446 || STRCASEEQ('b','B',"both" ,cur->value)) {
1447 attr_clear = apr_pstrdup(doc->pool, cur->value);
1458 if (STRCASEEQ('a','A',"all",attr_clear)) {
1472 return ixhtml10->out;
1477 * It is a handler who processes the BR tag.
1479 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1480 * destination is specified.
1481 * @param node [i] The BR tag node is specified.
1482 * @return The conversion result is returned.
1485 s_ixhtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1487 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
1488 return ixhtml10->out;
1493 * It is a handler who processes the TABLE tag.
1495 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1496 * destination is specified.
1497 * @param node [i] The TR tag node is specified.
1498 * @return The conversion result is returned.
1501 s_ixhtml10_start_table_tag(void *pdoc, Node *node)
1503 ixhtml10_t *ixhtml10;
1508 ixhtml10 = GET_IXHTML10(pdoc);
1509 doc = ixhtml10->doc;
1512 char *attr_style = NULL;
1513 char *attr_align = NULL;
1514 char *attr_width = NULL;
1515 char *attr_height = NULL;
1516 char *attr_bgcolor = NULL;
1517 char *attr_border_width = NULL;
1518 char *attr_border_color = NULL;
1520 /*--------------------------------------------------------------------------*/
1521 /* Get Attributes */
1522 /*--------------------------------------------------------------------------*/
1523 for (attr = qs_get_attr(doc,node);
1525 attr = qs_get_next_attr(doc,attr)) {
1526 char *name = qs_get_attr_name(doc,attr);
1527 char *val = qs_get_attr_value(doc,attr);
1528 if (STRCASEEQ('a','A',"align",name)) {
1529 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1530 attr_align = apr_pstrdup(doc->buf.pool, val);
1533 else if (STRCASEEQ('h','H',"height",name) && val && *val) {
1534 attr_height = apr_pstrdup(doc->buf.pool, val);
1536 else if (STRCASEEQ('w','W',"width",name) && val && *val) {
1537 attr_width = apr_pstrdup(doc->buf.pool, val);
1539 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1540 attr_style = apr_pstrdup(doc->buf.pool, val);
1542 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1543 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1544 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1546 else if (STRCASEEQ('b','B',"border",name) && val && *val) {
1547 attr_border_width = apr_pstrdup(doc->buf.pool, val);
1549 else if (STRCASEEQ('b','B',"bordercolor",name) && val && *val) {
1550 attr_border_color = apr_pstrdup(doc->buf.pool, val);
1551 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1555 if (IS_CSS_ON(ixhtml10->entryp)) {
1556 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1558 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
1559 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
1560 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1561 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1562 css_property_t *border_width_prop = chxj_css_get_property_value(doc, style, "border-width");
1563 css_property_t *border_color_prop = chxj_css_get_property_value(doc, style, "border-color");
1565 css_property_t *cur;
1566 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
1567 char *tmp = apr_pstrdup(doc->pool, cur->value);
1568 char *tmpp = strstr(tmp, "px");
1570 size_t len = strlen(tmp) - strlen(tmpp);
1571 attr_width = apr_pstrndup(doc->pool, tmp,len);
1574 attr_width = apr_pstrdup(doc->pool, tmp);
1577 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
1578 char *tmp = apr_pstrdup(doc->pool, cur->value);
1579 char *tmpp = strstr(tmp, "px");
1581 size_t len = strlen(tmp) - strlen(tmpp);
1582 attr_height = apr_pstrndup(doc->pool, tmp,len);
1585 attr_height = apr_pstrdup(doc->pool, tmp);
1588 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1589 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1590 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1593 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1594 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1595 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1597 for (cur = border_width_prop->next; cur != border_width_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_border_width = apr_pstrndup(doc->pool, tmp,len);
1605 attr_border_width = apr_pstrdup(doc->pool, tmp);
1608 for (cur = border_color_prop->next; cur != border_color_prop; cur = cur->next) {
1609 attr_border_color = apr_pstrdup(doc->pool, cur->value);
1610 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1631 if (attr_border_width){
1633 W_V(attr_border_width);
1636 if (attr_border_color && *attr_border_color){
1637 W_L(" bordercolor=\"");
1638 W_V(attr_border_color);
1641 if (attr_bgcolor && *attr_bgcolor){
1648 return ixhtml10->out;
1653 * It is a handler who processes the TABLE tag.
1655 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1656 * destination is specified.
1657 * @param node [i] The TR tag node is specified.
1658 * @return The conversion result is returned.
1661 s_ixhtml10_end_table_tag(void *pdoc, Node *UNUSED(child))
1663 ixhtml10_t *ixhtml10;
1667 ixhtml10 = GET_IXHTML10(pdoc);
1668 doc = ixhtml10->doc;
1673 if (IS_CSS_ON(ixhtml10->entryp)) {
1674 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
1677 return ixhtml10->out;
1682 * It is a handler who processes the TR tag.
1684 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1685 * destination is specified.
1686 * @param node [i] The TR tag node is specified.
1687 * @return The conversion result is returned.
1690 s_ixhtml10_start_tr_tag(void *pdoc, Node *node)
1692 ixhtml10_t *ixhtml10;
1697 ixhtml10 = GET_IXHTML10(pdoc);
1698 doc = ixhtml10->doc;
1701 char *attr_style = NULL;
1702 char *attr_align = NULL;
1703 char *attr_valign = NULL;
1704 char *attr_bgcolor = NULL;
1706 /*--------------------------------------------------------------------------*/
1707 /* Get Attributes */
1708 /*--------------------------------------------------------------------------*/
1709 for (attr = qs_get_attr(doc,node);
1711 attr = qs_get_next_attr(doc,attr)) {
1712 char *name = qs_get_attr_name(doc,attr);
1713 char *val = qs_get_attr_value(doc,attr);
1714 if (STRCASEEQ('a','A',"align",name)) {
1715 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1716 attr_align = apr_pstrdup(doc->buf.pool, val);
1719 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1720 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1721 attr_valign = apr_pstrdup(doc->buf.pool, val);
1724 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1725 attr_style = apr_pstrdup(doc->buf.pool, val);
1727 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1728 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1729 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1733 if (IS_CSS_ON(ixhtml10->entryp)) {
1734 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1736 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1737 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1738 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1740 css_property_t *cur;
1741 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1742 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1743 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1746 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1747 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1748 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1751 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1752 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1753 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1769 if (attr_bgcolor && *attr_bgcolor){
1775 return ixhtml10->out;
1780 * It is a handler who processes the TR tag.
1782 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1783 * destination is specified.
1784 * @param node [i] The TR tag node is specified.
1785 * @return The conversion result is returned.
1788 s_ixhtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1790 ixhtml10_t *ixhtml10;
1794 ixhtml10 = GET_IXHTML10(pdoc);
1795 doc = ixhtml10->doc;
1799 return ixhtml10->out;
1803 * It is a handler who processes the TABLE tag.
1805 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1806 * destination is specified.
1807 * @param node [i] The TR tag node is specified.
1808 * @return The conversion result is returned.
1811 s_ixhtml10_start_td_or_th_tag(void *pdoc, Node *node,char *tagName)
1813 ixhtml10_t *ixhtml10;
1818 ixhtml10 = GET_IXHTML10(pdoc);
1819 doc = ixhtml10->doc;
1822 char *attr_style = NULL;
1823 char *attr_align = NULL;
1824 char *attr_valign = NULL;
1825 char *attr_bgcolor = NULL;
1826 char *attr_colspan = NULL;
1827 char *attr_rowspan = NULL;
1828 char *attr_width = NULL;
1829 char *attr_height = NULL;
1831 /*--------------------------------------------------------------------------*/
1832 /* Get Attributes */
1833 /*--------------------------------------------------------------------------*/
1834 for (attr = qs_get_attr(doc,node);
1836 attr = qs_get_next_attr(doc,attr)) {
1837 char *name = qs_get_attr_name(doc,attr);
1838 char *val = qs_get_attr_value(doc,attr);
1839 if (STRCASEEQ('a','A',"align",name)) {
1840 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1841 attr_align = apr_pstrdup(doc->buf.pool, val);
1844 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1845 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1846 attr_valign = apr_pstrdup(doc->buf.pool, val);
1849 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1850 attr_style = apr_pstrdup(doc->buf.pool, val);
1852 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1853 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1854 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1856 else if (STRCASEEQ('c','C',"colspan",name) && val && *val) {
1857 attr_colspan = apr_pstrdup(doc->buf.pool, val);
1859 else if (STRCASEEQ('r','R',"rowspan",name) && val && *val) {
1860 attr_rowspan = apr_pstrdup(doc->buf.pool, val);
1862 else if (STRCASEEQ('w','W',"width",name) && val && *val) {
1863 attr_width = apr_pstrdup(doc->buf.pool, val);
1865 else if (STRCASEEQ('h','H',"height",name) && val && *val) {
1866 attr_height = apr_pstrdup(doc->buf.pool, val);
1870 if (IS_CSS_ON(ixhtml10->entryp)) {
1871 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
1873 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1874 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1875 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1876 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
1877 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
1879 css_property_t *cur;
1880 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1881 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1882 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1885 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1886 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1887 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1890 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1891 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1892 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1894 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
1895 char *tmp = apr_pstrdup(doc->pool, cur->value);
1896 char *tmpp = strstr(tmp, "px");
1898 size_t len = strlen(tmp) - strlen(tmpp);
1899 attr_width = apr_pstrndup(doc->pool, tmp,len);
1902 tmpp = strstr(tmp, "%");
1904 attr_width = apr_pstrdup(doc->pool, tmp);
1908 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
1909 char *tmp = apr_pstrdup(doc->pool, cur->value);
1910 char *tmpp = strstr(tmp, "px");
1912 size_t len = strlen(tmp) - strlen(tmpp);
1913 attr_height = apr_pstrndup(doc->pool, tmp,len);
1916 tmpp = strstr(tmp, "%");
1918 attr_height = apr_pstrdup(doc->pool, tmp);
1947 if (attr_bgcolor && *attr_bgcolor){
1963 return ixhtml10->out;
1968 * It is a handler who processes the TABLE tag.
1970 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1971 * destination is specified.
1972 * @param node [i] The TR tag node is specified.
1973 * @return The conversion result is returned.
1976 s_ixhtml10_end_td_or_th_tag(void *pdoc, Node *UNUSED(child),char *tagName)
1978 ixhtml10_t *ixhtml10;
1982 ixhtml10 = GET_IXHTML10(pdoc);
1983 doc = ixhtml10->doc;
1989 return ixhtml10->out;
1993 * It is a handler who processes the TABLE tag.
1995 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
1996 * destination is specified.
1997 * @param node [i] The TR tag node is specified.
1998 * @return The conversion result is returned.
2001 s_ixhtml10_start_td_tag(void *pdoc, Node *node)
2003 return s_ixhtml10_start_td_or_th_tag(pdoc,node,"td");
2006 * It is a handler who processes the TABLE tag.
2008 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2009 * destination is specified.
2010 * @param node [i] The TR tag node is specified.
2011 * @return The conversion result is returned.
2014 s_ixhtml10_end_td_tag(void *pdoc, Node *node)
2016 return s_ixhtml10_end_td_or_th_tag(pdoc,node,"td");
2020 * It is a handler who processes the TABLE tag.
2022 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2023 * destination is specified.
2024 * @param node [i] The TR tag node is specified.
2025 * @return The conversion result is returned.
2028 s_ixhtml10_start_th_tag(void *pdoc, Node *node)
2030 return s_ixhtml10_start_td_or_th_tag(pdoc,node,"th");
2033 * It is a handler who processes the TABLE tag.
2035 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2036 * destination is specified.
2037 * @param node [i] The TR tag node is specified.
2038 * @return The conversion result is returned.
2041 s_ixhtml10_end_th_tag(void *pdoc, Node *node)
2043 return s_ixhtml10_end_td_or_th_tag(pdoc,node,"th");
2049 * It is a handler who processes the FONT tag.
2051 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2052 * destination is specified.
2053 * @param node [i] The FONT tag node is specified.
2054 * @return The conversion result is returned.
2057 s_ixhtml10_start_font_tag(void *pdoc, Node *node)
2059 ixhtml10_t *ixhtml10;
2063 char *attr_color = NULL;
2064 char *attr_size = NULL;
2065 char *attr_style = NULL;
2067 ixhtml10 = GET_IXHTML10(pdoc);
2068 doc = ixhtml10->doc;
2071 /*--------------------------------------------------------------------------*/
2072 /* Get Attributes */
2073 /*--------------------------------------------------------------------------*/
2074 for (attr = qs_get_attr(doc,node);
2076 attr = qs_get_next_attr(doc,attr)) {
2077 char *name = qs_get_attr_name(doc,attr);
2078 char *value = qs_get_attr_value(doc,attr);
2079 if (STRCASEEQ('c','C',"color",name) && value && *value) {
2080 attr_color = apr_pstrdup(doc->buf.pool, value);
2082 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2083 /*----------------------------------------------------------------------*/
2085 /*----------------------------------------------------------------------*/
2088 attr_size = "xx-small";
2091 attr_size = "x-small";
2094 attr_size = "small";
2097 attr_size = "medium";
2100 attr_size = "large";
2103 attr_size = "x-large";
2106 attr_size = "xx-large";
2110 if (chxj_chk_numeric(&value[1]) == 0) {
2111 attr_size = apr_pstrdup(doc->pool, value);
2118 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
2119 attr_style = apr_pstrdup(doc->buf.pool, value);
2122 if (IS_CSS_ON(ixhtml10->entryp)) {
2123 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2125 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2126 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2127 css_property_t *cur;
2128 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2129 if (cur->value && *cur->value) {
2130 attr_color = apr_pstrdup(doc->pool, cur->value);
2133 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2134 if (cur->value && *cur->value) {
2135 attr_size = apr_pstrdup(doc->pool, cur->value);
2136 if ( STRCASEEQ('x','X',"xx-small",attr_size)
2137 || STRCASEEQ('x','X',"x-small", attr_size)
2138 || STRCASEEQ('s','S',"small", attr_size)
2139 || STRCASEEQ('m','M',"medium", attr_size)
2140 || STRCASEEQ('l','L',"large", attr_size)
2141 || STRCASEEQ('x','X',"x-large", attr_size)
2142 || STRCASEEQ('x','X',"xx-large",attr_size)) {
2143 attr_size = apr_pstrdup(doc->pool, cur->value);
2150 if (attr_color || attr_size) {
2153 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2159 switch(*attr_size) {
2161 if (*(attr_size + 1) == '1') {
2162 attr_size = "small";
2165 if (*(attr_size + 1) == '2') {
2166 attr_size = "x-small";
2169 if (*(attr_size + 1) == '3') {
2170 attr_size = "xx-small";
2175 if (*(attr_size + 1) == '1') {
2176 attr_size = "large";
2179 if (*(attr_size + 1) == '2') {
2180 attr_size = "x-large";
2183 if (*(attr_size + 1) == '3') {
2184 attr_size = "xx-large";
2198 return ixhtml10->out;
2203 * It is a handler who processes the FONT tag.
2205 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2206 * destination is specified.
2207 * @param node [i] The FONT tag node is specified.
2208 * @return The conversion result is returned.
2211 s_ixhtml10_end_font_tag(void *pdoc, Node *UNUSED(node))
2213 ixhtml10_t *ixhtml10;
2217 ixhtml10 = GET_IXHTML10(pdoc);
2218 doc = ixhtml10->doc;
2219 r = ixhtml10->doc->r;
2222 if (IS_CSS_ON(ixhtml10->entryp)) {
2223 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2226 return ixhtml10->out;
2231 * It is a handler who processes the FORM tag.
2233 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2234 * destination is specified.
2235 * @param node [i] The FORM tag node is specified.
2236 * @return The conversion result is returned.
2239 s_ixhtml10_start_form_tag(void *pdoc, Node *node)
2241 ixhtml10_t *ixhtml10;
2245 char *attr_action = NULL;
2246 char *attr_method = NULL;
2247 char *attr_style = NULL;
2248 char *attr_color = NULL;
2249 char *attr_align = NULL;
2250 char *attr_name = NULL;
2251 char *new_hidden_tag = NULL;
2252 char *css_clear = NULL;
2254 ixhtml10 = GET_IXHTML10(pdoc);
2255 doc = ixhtml10->doc;
2258 /*--------------------------------------------------------------------------*/
2259 /* Get Attributes */
2260 /*--------------------------------------------------------------------------*/
2261 for (attr = qs_get_attr(doc,node);
2263 attr = qs_get_next_attr(doc,attr)) {
2264 char *name = qs_get_attr_name(doc,attr);
2265 char *value = qs_get_attr_value(doc,attr);
2269 if (strcasecmp(name, "action") == 0) {
2270 /*--------------------------------------------------------------------*/
2272 /*--------------------------------------------------------------------*/
2273 attr_action = value;
2279 if (strcasecmp(name, "method") == 0) {
2280 /*--------------------------------------------------------------------*/
2282 /*--------------------------------------------------------------------*/
2283 attr_method = value;
2289 if (strcasecmp(name, "name") == 0) {
2290 /*--------------------------------------------------------------------*/
2292 /*--------------------------------------------------------------------*/
2299 if (strcasecmp(name, "style") == 0) {
2308 if (IS_CSS_ON(ixhtml10->entryp)) {
2309 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2311 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
2312 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2313 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
2314 css_property_t *cur;
2315 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
2316 if (STRCASEEQ('l','L',"left", cur->value)) {
2317 attr_align = apr_pstrdup(doc->pool, "left");
2319 else if (STRCASEEQ('c','C',"center",cur->value)) {
2320 attr_align = apr_pstrdup(doc->pool, "center");
2322 else if (STRCASEEQ('r','R',"right",cur->value)) {
2323 attr_align = apr_pstrdup(doc->pool, "right");
2326 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2327 attr_color = apr_pstrdup(doc->pool, cur->value);
2329 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
2330 css_clear = apr_pstrdup(doc->pool, cur->value);
2335 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2339 attr_action = chxj_encoding_parameter(r, attr_action, 1);
2340 attr_action = chxj_add_cookie_parameter(r, attr_action, ixhtml10->cookie);
2342 char *new_query_string = NULL;
2343 q = strchr(attr_action, '?');
2345 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);
2346 if (new_hidden_tag || new_query_string) {
2352 if (new_query_string) {
2354 W_V(new_query_string);
2378 ixhtml10_flags_t *flg = (ixhtml10_flags_t *)apr_palloc(doc->pool, sizeof(ixhtml10_flags_t));
2379 memset(flg, 0, sizeof(*flg));
2380 if (attr_color || attr_align) {
2381 W_L("<div style=\"");
2383 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2395 flg->with_div_flag = 1;
2398 node->userData = flg;
2399 if (new_hidden_tag) {
2400 W_V(new_hidden_tag);
2402 return ixhtml10->out;
2407 * It is a handler who processes the FORM tag.
2409 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2410 * destination is specified.
2411 * @param node [i] The FORM tag node is specified.
2412 * @return The conversion result is returned.
2415 s_ixhtml10_end_form_tag(void *pdoc, Node *node)
2417 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
2418 Doc *doc = ixhtml10->doc;
2420 ixhtml10_flags_t *flg = (ixhtml10_flags_t *)node->userData;
2421 if (flg && flg->with_div_flag) {
2425 if (IS_CSS_ON(ixhtml10->entryp)) {
2426 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2429 return ixhtml10->out;
2434 * It is a handler who processes the INPUT tag.
2436 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2437 * destination is specified.
2438 * @param node [i] The INPUT tag node is specified.
2439 * @return The conversion result is returned.
2442 s_ixhtml10_start_input_tag(void *pdoc, Node *node)
2444 ixhtml10_t *ixhtml10;
2448 char *attr_accesskey = NULL;
2449 char *attr_max_length = NULL;
2450 char *attr_type = NULL;
2451 char *attr_name = NULL;
2452 char *attr_value = NULL;
2453 char *attr_istyle = NULL;
2454 char *attr_size = NULL;
2455 char *attr_checked = NULL;
2456 char *attr_style = NULL;
2458 ixhtml10 = GET_IXHTML10(pdoc);
2459 doc = ixhtml10->doc;
2462 /*--------------------------------------------------------------------------*/
2463 /* Get Attributes */
2464 /*--------------------------------------------------------------------------*/
2465 for (attr = qs_get_attr(doc,node);
2467 attr = qs_get_next_attr(doc,attr)) {
2468 char *name = qs_get_attr_name(doc,attr);
2469 char *value = qs_get_attr_value(doc,attr);
2470 if (STRCASEEQ('t','T',"type",name) && value && *value) {
2471 char *tmp_type = qs_trim_string(doc->buf.pool, value);
2472 if (tmp_type && (STRCASEEQ('t','T',"text", tmp_type) ||
2473 STRCASEEQ('p','P',"password",tmp_type) ||
2474 STRCASEEQ('c','C',"checkbox",tmp_type) ||
2475 STRCASEEQ('r','R',"radio", tmp_type) ||
2476 STRCASEEQ('h','H',"hidden", tmp_type) ||
2477 STRCASEEQ('s','S',"submit", tmp_type) ||
2478 STRCASEEQ('r','R',"reset", tmp_type))) {
2479 attr_type = tmp_type;
2482 else if (STRCASEEQ('n','N',"name",name) && value && *value) {
2485 else if (STRCASEEQ('v','V',"value",name) && value && *value) {
2488 else if (STRCASEEQ('i','I',"istyle",name) && value && *value) {
2489 attr_istyle = value;
2491 else if (STRCASEEQ('m','M',"maxlength",name) && value && *value) {
2492 attr_max_length = value;
2494 else if (STRCASEEQ('c','C',"checked", name)) {
2495 attr_checked = value;
2497 else if (STRCASEEQ('a','A',"accesskey", name) && value && *value) {
2498 attr_accesskey = value;
2500 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
2503 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2508 if (IS_CSS_ON(ixhtml10->entryp)) {
2509 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2511 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
2512 css_property_t *cur;
2513 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
2514 if (strcasestr(cur->value, "<ja:n>")) {
2517 else if (strcasestr(cur->value, "<ja:en>")) {
2520 else if (strcasestr(cur->value, "<ja:hk>")) {
2523 else if (strcasestr(cur->value, "<ja:h>")) {
2548 if (STRCASEEQ('s','S',"submit",attr_type) || STRCASEEQ('r','R',"reset",attr_type)) {
2549 apr_size_t value_len = strlen(attr_value);
2550 attr_value = chxj_conv_z2h(r, attr_value, &value_len, ixhtml10->entryp);
2555 W_V(chxj_add_slash_to_doublequote(doc->pool, attr_value));
2558 if (attr_accesskey) {
2559 W_L(" accesskey=\"");
2560 W_V(attr_accesskey);
2563 if (attr_istyle && (*attr_istyle == '1' || *attr_istyle == '2' || *attr_istyle == '3' || *attr_istyle == '4')) {
2564 /*------------------------------------------------------------------------*/
2566 /*------------------------------------------------------------------------*/
2567 if (attr_type && STRCASEEQ('p','P',"password", attr_type) && ! ixhtml10->entryp->pc_flag ) {
2568 W_L(" style=\"-wap-input-format:"*<ja:n>";\"");
2571 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
2573 W_L("-wap-input-format:");
2579 else if (attr_type && STRCASEEQ('p','P',"password",attr_type)) {
2580 W_L(" style=\"-wap-input-format:"*<ja:n>";\"");
2582 /*--------------------------------------------------------------------------*/
2583 /* The figure is default for the password. */
2584 /*--------------------------------------------------------------------------*/
2585 if (attr_max_length && *attr_max_length) {
2586 if (chxj_chk_numeric(attr_max_length) == 0) {
2587 W_L(" maxlength=\"");
2588 W_V(attr_max_length);
2593 W_L(" checked=\"checked\"");
2597 ixhtml10_t *ixhtml10;
2609 ixhtml10 = GET_IXHTML10(pdoc);
2610 doc = ixhtml10->doc;
2622 /*--------------------------------------------------------------------------*/
2623 /* Get Attributes */
2624 /*--------------------------------------------------------------------------*/
2625 type = qs_get_type_attr(doc, node, doc->buf.pool);
2626 name = qs_get_name_attr(doc, node, doc->buf.pool);
2627 value = qs_get_value_attr(doc,node, doc->buf.pool);
2628 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2629 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2630 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2631 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2632 size = qs_get_size_attr(doc, node, doc->buf.pool);
2635 if (type && (STRCASEEQ('t','T',"text", type) ||
2636 STRCASEEQ('p','P',"password",type) ||
2637 STRCASEEQ('c','C',"checkbox",type) ||
2638 STRCASEEQ('r','R',"radio", type) ||
2639 STRCASEEQ('h','H',"hidden", type) ||
2640 STRCASEEQ('s','S',"submit", type) ||
2641 STRCASEEQ('r','R',"reset", type))) {
2647 if (size && *size) {
2652 if (name && *name) {
2657 if (value && *value) {
2659 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2662 if (accesskey && *accesskey) {
2663 W_L(" accesskey=\"");
2667 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
2668 /*------------------------------------------------------------------------*/
2670 /*------------------------------------------------------------------------*/
2671 if (type && STRCASEEQ('p','P',"password", type) && ! ixhtml10->entryp->pc_flag ) {
2672 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2675 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,istyle);
2677 W_L("-wap-input-format: ");
2683 else if (type && STRCASEEQ('p','P',"password",type)) {
2684 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2686 /*--------------------------------------------------------------------------*/
2687 /* The figure is default for the password. */
2688 /*--------------------------------------------------------------------------*/
2689 if (max_length && *max_length) {
2690 if (chxj_chk_numeric(max_length) == 0) {
2691 W_L(" maxlength=\"");
2698 W_L(" checked=\"checked\"");
2702 return ixhtml10->out;
2707 * It is a handler who processes the INPUT tag.
2709 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2710 * destination is specified.
2711 * @param node [i] The INPUT tag node is specified.
2712 * @return The conversion result is returned.
2715 s_ixhtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
2717 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
2718 return ixhtml10->out;
2723 * It is a handler who processes the CENTER tag.
2725 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2726 * destination is specified.
2727 * @param node [i] The CENTER tag node is specified.
2728 * @return The conversion result is returned.
2731 s_ixhtml10_start_center_tag(void *pdoc, Node *node)
2733 ixhtml10_t *ixhtml10;
2736 char *attr_style = NULL;
2737 char *attr_color = NULL;
2738 char *attr_size = NULL;
2740 ixhtml10 = GET_IXHTML10(pdoc);
2741 doc = ixhtml10->doc;
2743 for (attr = qs_get_attr(doc,node);
2745 attr = qs_get_next_attr(doc,attr)) {
2746 char *name = qs_get_attr_name(doc,attr);
2747 char *value = qs_get_attr_value(doc,attr);
2748 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2752 if (IS_CSS_ON(ixhtml10->entryp)) {
2753 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2755 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2756 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2757 css_property_t *cur;
2758 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2759 if (cur->value && *cur->value) {
2760 attr_color = apr_pstrdup(doc->pool, cur->value);
2763 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2764 if (cur->value && *cur->value) {
2765 attr_size = apr_pstrdup(doc->pool, cur->value);
2773 W_L("text-align:center;");
2780 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2788 return ixhtml10->out;
2793 * It is a handler who processes the CENTER tag.
2795 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2796 * destination is specified.
2797 * @param node [i] The CENTER tag node is specified.
2798 * @return The conversion result is returned.
2801 s_ixhtml10_end_center_tag(void *pdoc, Node *UNUSED(node))
2803 ixhtml10_t *ixhtml10;
2807 ixhtml10 = GET_IXHTML10(pdoc);
2808 doc = ixhtml10->doc;
2812 if (IS_CSS_ON(ixhtml10->entryp)) {
2813 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2815 return ixhtml10->out;
2820 * It is a handler who processes the li tag.
2822 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2823 * destination is specified.
2824 * @param node [i] The li tag node is specified.
2825 * @return The conversion result is returned.
2828 s_ixhtml10_start_li_tag(void *pdoc, Node *node)
2830 ixhtml10_t *ixhtml10;
2834 char *attr_type = NULL;
2835 char *attr_value = NULL;
2836 char *attr_style = NULL;
2838 ixhtml10 = GET_IXHTML10(pdoc);
2839 doc = ixhtml10->doc;
2842 for (attr = qs_get_attr(doc,node);
2844 attr = qs_get_next_attr(doc,attr)) {
2845 char *name = qs_get_attr_name(doc,attr);
2846 char *value = qs_get_attr_value(doc,attr);
2847 if (STRCASEEQ('t','T',"type",name)) {
2848 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2849 if (*value == '1') {
2850 attr_type = apr_pstrdup(doc->pool, "decimal");
2852 else if (*value == 'a') {
2853 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2855 else if (*value == 'A') {
2856 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2863 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2866 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2870 if (IS_CSS_ON(ixhtml10->entryp)) {
2871 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2873 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2874 css_property_t *cur;
2875 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2876 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2877 attr_type = apr_pstrdup(doc->pool, "decimal");
2879 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2880 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2882 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2883 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2885 else if (STRCASEEQ('d','D',"disc", cur->value)) {
2886 attr_type = apr_pstrdup(doc->pool, "disc");
2888 else if (STRCASEEQ('s','S',"square", cur->value)) {
2889 attr_type = apr_pstrdup(doc->pool, "square");
2891 else if (STRCASEEQ('c','C',"circle", cur->value)) {
2892 attr_type = apr_pstrdup(doc->pool, "circle");
2902 W_L("list-style-type:");
2913 return ixhtml10->out;
2918 * It is a handler who processes the li tag.
2920 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2921 * destination is specified.
2922 * @param node [i] The li tag node is specified.
2923 * @return The conversion result is returned.
2926 s_ixhtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
2928 ixhtml10_t *ixhtml10;
2932 ixhtml10 = GET_IXHTML10(pdoc);
2933 doc = ixhtml10->doc;
2936 if (IS_CSS_ON(ixhtml10->entryp)) {
2937 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
2940 return ixhtml10->out;
2945 * It is a handler who processes the OL tag.
2947 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
2948 * destination is specified.
2949 * @param node [i] The OL tag node is specified.
2950 * @return The conversion result is returned.
2953 s_ixhtml10_start_ol_tag(void *pdoc, Node *node)
2955 ixhtml10_t *ixhtml10;
2959 char *attr_style = NULL;
2960 char *attr_start = NULL;
2961 char *attr_type = NULL;
2962 char *css_clear = NULL;
2964 ixhtml10 = GET_IXHTML10(pdoc);
2965 doc = ixhtml10->doc;
2968 /*--------------------------------------------------------------------------*/
2969 /* Get Attributes */
2970 /*--------------------------------------------------------------------------*/
2971 for (attr = qs_get_attr(doc,node);
2973 attr = qs_get_next_attr(doc,attr)) {
2974 char *name = qs_get_attr_name(doc,attr);
2975 char *value = qs_get_attr_value(doc,attr);
2976 if (STRCASEEQ('t','T',"type",name) && value) {
2977 if (*value == '1') {
2978 attr_type = apr_pstrdup(doc->pool, "decimal");
2980 else if (*value == 'a') {
2981 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2983 else if (*value == 'A') {
2984 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2987 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2990 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2994 if (IS_CSS_ON(ixhtml10->entryp)) {
2995 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
2997 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2998 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
2999 css_property_t *cur;
3000 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3001 if (STRCASEEQ('d','D',"decimal", cur->value)) {
3002 attr_type = apr_pstrdup(doc->pool, "decimal");
3004 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
3005 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
3007 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
3008 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
3011 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3012 css_clear = apr_pstrdup(doc->pool, cur->value);
3017 if (attr_type || css_clear) {
3020 W_L("list-style-type:");
3038 return ixhtml10->out;
3043 * It is a handler who processes the OL tag.
3045 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3046 * destination is specified.
3047 * @param node [i] The OL tag node is specified.
3048 * @return The conversion result is returned.
3051 s_ixhtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
3053 ixhtml10_t *ixhtml10;
3057 ixhtml10 = GET_IXHTML10(pdoc);
3058 doc = ixhtml10->doc;
3062 if (IS_CSS_ON(ixhtml10->entryp)) {
3063 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3065 return ixhtml10->out;
3070 * It is a handler who processes the P tag.
3072 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3073 * destination is specified.
3074 * @param node [i] The P tag node is specified.
3075 * @return The conversion result is returned.
3078 s_ixhtml10_start_p_tag(void *pdoc, Node *node)
3080 ixhtml10_t *ixhtml10;
3084 char *attr_align = NULL;
3085 char *attr_style = NULL;
3086 char *attr_color = NULL;
3087 char *attr_blink = NULL;
3088 char *css_clear = NULL;
3090 ixhtml10 = GET_IXHTML10(pdoc);
3091 doc = ixhtml10->doc;
3094 for (attr = qs_get_attr(doc,node);
3096 attr = qs_get_next_attr(doc,attr)) {
3097 char *nm = qs_get_attr_name(doc,attr);
3098 char *val = qs_get_attr_value(doc,attr);
3099 if (STRCASEEQ('a','A',"align", nm)) {
3100 /*----------------------------------------------------------------------*/
3101 /* CHTML 1.0 (W3C version 3.2) */
3102 /*----------------------------------------------------------------------*/
3103 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3104 attr_align = apr_pstrdup(doc->buf.pool, val);
3108 else if (STRCASEEQ('s','S',"style", nm) && val && *val) {
3109 attr_style = apr_pstrdup(doc->buf.pool, val);
3112 if (IS_CSS_ON(ixhtml10->entryp)) {
3113 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3115 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
3116 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3117 css_property_t *text_deco_prop = chxj_css_get_property_value(doc, style, "text-decoration");
3118 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3120 css_property_t *cur;
3121 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
3122 if (STRCASEEQ('l','L',"left",cur->value)) {
3123 attr_align = apr_pstrdup(doc->pool, "left");
3125 else if (STRCASEEQ('c','C',"center",cur->value)) {
3126 attr_align = apr_pstrdup(doc->pool, "center");
3128 else if (STRCASEEQ('r','R',"right",cur->value)) {
3129 attr_align = apr_pstrdup(doc->pool, "right");
3132 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3133 if (cur->value && *cur->value) {
3134 attr_color = apr_pstrdup(doc->pool, cur->value);
3137 for (cur = text_deco_prop->next; cur != text_deco_prop; cur = cur->next) {
3138 if (cur->value && *cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
3139 attr_blink = apr_pstrdup(doc->pool, cur->value);
3142 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3143 css_clear = apr_pstrdup(doc->pool, cur->value);
3148 if ((attr_align && *attr_align) || (attr_color && *attr_color) || (attr_blink && *attr_blink) || css_clear) {
3156 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
3162 W_L("text-decoration:");
3174 return ixhtml10->out;
3179 * It is a handler who processes the P tag.
3181 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3182 * destination is specified.
3183 * @param node [i] The P tag node is specified.
3184 * @return The conversion result is returned.
3187 s_ixhtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
3189 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3190 Doc *doc = ixhtml10->doc;
3193 if (IS_CSS_ON(ixhtml10->entryp)) {
3194 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3196 return ixhtml10->out;
3201 * It is a handler who processes the PRE tag.
3203 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3204 * destination is specified.
3205 * @param node [i] The PRE tag node is specified.
3206 * @return The conversion result is returned.
3209 s_ixhtml10_start_pre_tag(void *pdoc, Node *node)
3211 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3212 Doc *doc = ixhtml10->doc;
3214 char *attr_style = NULL;
3215 char *css_clear = NULL;
3217 for (attr = qs_get_attr(doc,node);
3219 attr = qs_get_next_attr(doc,attr)) {
3220 char *nm = qs_get_attr_name(doc,attr);
3221 char *val = qs_get_attr_value(doc,attr);
3222 if (val && STRCASEEQ('s','S',"style", nm)) {
3227 if (IS_CSS_ON(ixhtml10->entryp)) {
3228 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3230 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3232 css_property_t *cur;
3233 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3234 css_clear = apr_pstrdup(doc->pool, cur->value);
3239 ixhtml10->pre_flag++;
3249 return ixhtml10->out;
3254 * It is a handler who processes the PRE tag.
3256 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3257 * destination is specified.
3258 * @param node [i] The PRE tag node is specified.
3259 * @return The conversion result is returned.
3262 s_ixhtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
3264 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3265 Doc *doc = ixhtml10->doc;
3268 ixhtml10->pre_flag--;
3269 if (IS_CSS_ON(ixhtml10->entryp)) {
3270 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3273 return ixhtml10->out;
3278 * It is a handler who processes the UL tag.
3280 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3281 * destination is specified.
3282 * @param node [i] The UL tag node is specified.
3283 * @return The conversion result is returned.
3286 s_ixhtml10_start_ul_tag(void *pdoc, Node *node)
3288 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3289 Doc *doc = ixhtml10->doc;
3291 char *attr_type = NULL;
3292 char *attr_style = NULL;
3293 char *css_clear = NULL;
3295 /*--------------------------------------------------------------------------*/
3296 /* Get Attributes */
3297 /*--------------------------------------------------------------------------*/
3298 for (attr = qs_get_attr(doc,node);
3300 attr = qs_get_next_attr(doc,attr)) {
3301 char *name = qs_get_attr_name(doc,attr);
3302 char *value = qs_get_attr_value(doc,attr);
3303 if (STRCASEEQ('t','T',"type",name)) {
3304 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3308 else if (value && *value && STRCASEEQ('s','S',"style", name)) {
3312 if (IS_CSS_ON(ixhtml10->entryp)) {
3313 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3315 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
3316 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3317 css_property_t *cur;
3318 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3319 if (STRCASEEQ('d','D',"disc",cur->value)) {
3320 attr_type = apr_pstrdup(doc->pool, "disc");
3322 else if (STRCASEEQ('c','C',"circle",cur->value)) {
3323 attr_type = apr_pstrdup(doc->pool, "circle");
3325 else if (STRCASEEQ('s','S',"square",cur->value)) {
3326 attr_type = apr_pstrdup(doc->pool, "square");
3329 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3330 css_clear = apr_pstrdup(doc->pool, cur->value);
3335 if (attr_type || css_clear) {
3338 W_L("list-style-type:");
3350 return ixhtml10->out;
3355 * It is a handler who processes the UL tag.
3357 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3358 * destination is specified.
3359 * @param node [i] The UL tag node is specified.
3360 * @return The conversion result is returned.
3363 s_ixhtml10_end_ul_tag(void *pdoc, Node *UNUSED(child))
3365 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3366 Doc *doc = ixhtml10->doc;
3369 if (IS_CSS_ON(ixhtml10->entryp)) {
3370 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3372 return ixhtml10->out;
3377 * It is a handler who processes the HR tag.
3379 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3380 * destination is specified.
3381 * @param node [i] The HR tag node is specified.
3382 * @return The conversion result is returned.
3385 s_ixhtml10_start_hr_tag(void *pdoc, Node *node)
3388 ixhtml10_t *ixhtml10;
3391 char *attr_align = NULL;
3392 char *attr_size = NULL;
3393 char *attr_width = NULL;
3394 char *attr_noshade = NULL;
3395 char *attr_style = NULL;
3396 char *attr_color = NULL;
3397 char *attr_bgcolor = NULL;
3398 char *css_clear = NULL;
3400 ixhtml10 = GET_IXHTML10(pdoc);
3401 doc = ixhtml10->doc;
3404 for (attr = qs_get_attr(doc,node);
3406 attr = qs_get_next_attr(doc,attr)) {
3407 char *name = qs_get_attr_name (doc,attr);
3408 char *value = qs_get_attr_value(doc,attr);
3412 if (strcasecmp(name, "align") == 0) {
3413 /*--------------------------------------------------------------------*/
3415 /*--------------------------------------------------------------------*/
3416 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3424 if (strcasecmp(name, "size") == 0) {
3425 /*--------------------------------------------------------------------*/
3427 /*--------------------------------------------------------------------*/
3428 if (value && *value) {
3432 else if (strcasecmp(name, "style") == 0) {
3433 if (value && *value) {
3441 if (strcasecmp(name, "width") == 0) {
3442 /*--------------------------------------------------------------------*/
3444 /*--------------------------------------------------------------------*/
3445 if (value && *value) {
3453 if (strcasecmp(name, "noshade") == 0) {
3454 /*--------------------------------------------------------------------*/
3456 /*--------------------------------------------------------------------*/
3457 attr_noshade = apr_pstrdup(doc->pool, "noshade");
3463 if (strcasecmp(name, "color") == 0 && value && *value) {
3464 /*--------------------------------------------------------------------*/
3466 /*--------------------------------------------------------------------*/
3468 attr_bgcolor = value;
3476 if (IS_CSS_ON(ixhtml10->entryp)) {
3477 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3479 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
3480 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3481 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3482 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "border-color");
3483 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
3484 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3485 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3486 css_property_t *cur;
3487 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
3488 if (STRCASEEQ('s','S',"solid",cur->value)) {
3489 attr_noshade = "noshade";
3492 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3493 attr_color = apr_pstrdup(doc->pool, cur->value);
3495 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
3496 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3498 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3499 attr_size = apr_pstrdup(doc->pool, cur->value);
3501 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3502 char *tmp = apr_pstrdup(doc->pool, cur->value);
3503 char *tmpp = strstr(tmp, "px");
3505 attr_width = apr_pstrdup(doc->pool, tmp);
3508 tmpp = strstr(tmp, "%");
3510 attr_width = apr_pstrdup(doc->pool, tmp);
3515 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3516 char *tmp = apr_pstrdup(doc->pool, cur->value);
3518 attr_align = apr_pstrdup(doc->pool,tmp);
3522 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3523 css_clear = apr_pstrdup(doc->pool, cur->value);
3528 if (attr_align || attr_size || attr_width || attr_noshade || attr_color || attr_bgcolor || css_clear) {
3532 if (STRCASEEQ('c','C',"center",attr_align)) {
3543 if (chxj_chk_numeric(attr_size) == 0) {
3551 if (!strstr(attr_width, "px") && !strstr(attr_width, "%")) {
3557 W_L("border-style:solid;");
3560 W_L("border-color:");
3565 W_L("background-color:");
3578 return ixhtml10->out;
3583 * It is a handler who processes the HR tag.
3585 * @param ixhtml10 [i/o] The pointer to the IXHTML10 structure at the output
3586 * destination is specified.
3587 * @param node [i] The HR tag node is specified.
3588 * @return The conversion result is returned.
3591 s_ixhtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
3593 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3594 return ixhtml10->out;
3599 * It is a handler who processes the IMG tag.
3601 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3602 * destination is specified.
3603 * @param node [i] The IMG tag node is specified.
3604 * @return The conversion result is returned.
3607 s_ixhtml10_start_img_tag(void *pdoc, Node *node)
3609 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3610 Doc *doc = ixhtml10->doc;
3611 request_rec *r = doc->r;
3613 char *attr_src = NULL;
3614 char *attr_height = NULL;
3615 char *attr_width = NULL;
3616 char *attr_align = NULL;
3617 char *attr_alt = NULL;
3618 char *attr_style = NULL;
3619 char *attr_hspace = NULL;
3620 char *attr_vspace = NULL;
3622 char *css_float = NULL;
3623 char *css_margin_left = NULL;
3624 char *css_margin_right = NULL;
3625 char *css_margin_top = NULL;
3626 char *css_margin_bottom = NULL;
3627 char *css_display = NULL;
3628 char *css_valign = NULL;
3630 #ifndef IMG_NOT_CONVERT_FILENAME
3631 device_table *spec = ixhtml10->spec;
3634 /*--------------------------------------------------------------------------*/
3635 /* Get Attributes */
3636 /*--------------------------------------------------------------------------*/
3637 for (attr = qs_get_attr(doc,node);
3639 attr = qs_get_next_attr(doc,attr)) {
3640 char *name = qs_get_attr_name(doc,attr);
3641 char *value = qs_get_attr_value(doc,attr);
3642 if (STRCASEEQ('s','S',"src",name)) {
3643 /*----------------------------------------------------------------------*/
3645 /*----------------------------------------------------------------------*/
3646 #ifdef IMG_NOT_CONVERT_FILENAME
3647 value = chxj_encoding_parameter(r, value, 1);
3648 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
3649 value = chxj_add_cookie_no_update_parameter(r, value);
3652 value = chxj_img_conv(r, spec, value);
3653 value = chxj_encoding_parameter(r, value, 1);
3654 value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
3655 value = chxj_add_cookie_no_update_parameter(r, value);
3659 else if (STRCASEEQ('a','A',"align",name)) {
3660 /*----------------------------------------------------------------------*/
3662 /*----------------------------------------------------------------------*/
3664 if (STRCASEEQ('t','T',"top", value) ||
3665 STRCASEEQ('m','M',"middle",value) ||
3666 STRCASEEQ('b','B',"bottom",value) ||
3667 STRCASEEQ('l','L',"left", value) ||
3668 STRCASEEQ('r','R',"right", value)) {
3671 else if (STRCASEEQ('c','C',"center",value)) {
3672 attr_align = apr_pstrdup(doc->pool, "middle");
3676 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
3677 /*----------------------------------------------------------------------*/
3679 /*----------------------------------------------------------------------*/
3682 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
3683 /*----------------------------------------------------------------------*/
3685 /*----------------------------------------------------------------------*/
3686 attr_height = value;
3688 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
3689 /*----------------------------------------------------------------------*/
3691 /*----------------------------------------------------------------------*/
3692 attr_hspace = value;
3694 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
3695 /*----------------------------------------------------------------------*/
3697 /*----------------------------------------------------------------------*/
3698 attr_vspace = value;
3700 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
3701 /*----------------------------------------------------------------------*/
3703 /*----------------------------------------------------------------------*/
3706 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
3707 /*----------------------------------------------------------------------*/
3709 /*----------------------------------------------------------------------*/
3714 if (IS_CSS_ON(ixhtml10->entryp)) {
3715 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3717 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3718 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3719 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
3720 css_property_t *margin_left_prop = chxj_css_get_property_value(doc, style, "margin-left");
3721 css_property_t *margin_right_prop = chxj_css_get_property_value(doc, style, "margin-right");
3722 css_property_t *margin_top_prop = chxj_css_get_property_value(doc, style, "margin-top");
3723 css_property_t *margin_bottom_prop = chxj_css_get_property_value(doc, style, "margin-bottom");
3726 css_property_t *cur;
3727 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3728 attr_height = apr_pstrdup(doc->pool, cur->value);
3730 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3731 attr_width = apr_pstrdup(doc->pool, cur->value);
3733 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
3734 css_valign = apr_pstrdup(doc->pool, cur->value);
3737 if (! attr_hspace) {
3738 for (cur = margin_left_prop->next; cur != margin_left_prop; cur = cur->next) {
3739 css_margin_left = apr_pstrdup(doc->pool, cur->value);
3741 for (cur = margin_right_prop->next; cur != margin_right_prop; cur = cur->next) {
3742 css_margin_right = apr_pstrdup(doc->pool, cur->value);
3746 if (! attr_vspace) {
3747 for (cur = margin_top_prop->next; cur != margin_top_prop; cur = cur->next) {
3748 css_margin_top = apr_pstrdup(doc->pool, cur->value);
3750 for (cur = margin_bottom_prop->next; cur != margin_bottom_prop; cur = cur->next) {
3751 css_margin_bottom = apr_pstrdup(doc->pool, cur->value);
3755 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3756 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3757 css_float = apr_pstrdup(doc->pool, cur->value);
3759 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
3760 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
3761 char *tmp = apr_pstrdup(doc->pool, cur->value);
3762 char *tmpp = strstr(tmp, "none");
3764 css_display = apr_pstrdup(doc->pool, tmp);
3778 if (attr_align || attr_hspace || attr_vspace || css_float || css_margin_left || css_margin_right || css_margin_top || css_margin_bottom || css_valign ) {
3781 if (STRCASEEQ('t','T',"top", attr_align)) {
3783 W_L("vertical-align:top;");
3785 else if (STRCASEEQ('m','M',"middle", attr_align) || STRCASEEQ('c','C',"center",attr_align)) {
3787 W_L("vertical-align:middle;");
3789 else if (STRCASEEQ('b','B',"bottom", attr_align)) {
3791 W_L("vertical-align:bottom;");
3793 else if (STRCASEEQ('l','L',"left", attr_align)) {
3797 else if (STRCASEEQ('r','R',"right", attr_align)) {
3799 W_L("float:right;");
3810 W_L("vertical-align:");
3816 W_L("margin-left:");
3819 W_L("margin-right:");
3824 if(css_margin_left){
3825 W_L("margin-left:");
3826 W_V(css_margin_left);
3829 if(css_margin_right){
3830 W_L("margin-right:");
3831 W_V(css_margin_right);
3839 W_L("margin-bottom:");
3846 W_V(css_margin_top);
3849 if(css_margin_bottom){
3850 W_L("margin-bottom:");
3851 W_V(css_margin_bottom);
3877 return ixhtml10->out;
3882 * It is a handler who processes the IMG tag.
3884 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3885 * destination is specified.
3886 * @param node [i] The IMG tag node is specified.
3887 * @return The conversion result is returned.
3890 s_ixhtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
3892 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3893 return ixhtml10->out;
3898 * It is a handler who processes the SELECT tag.
3900 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3901 * destination is specified.
3902 * @param node [i] The SELECT tag node is specified.
3903 * @return The conversion result is returned.
3906 s_ixhtml10_start_select_tag(void *pdoc, Node *node)
3908 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3909 Doc *doc = ixhtml10->doc;
3913 char *multiple = NULL;
3914 char *attr_style = NULL;
3916 for (attr = qs_get_attr(doc,node);
3918 attr = qs_get_next_attr(doc,attr)) {
3919 char *nm = qs_get_attr_name(doc,attr);
3920 char *val = qs_get_attr_value(doc,attr);
3921 if (STRCASEEQ('s','S',"size",nm)) {
3922 /*----------------------------------------------------------------------*/
3923 /* CHTML 1.0 version 2.0 */
3924 /*----------------------------------------------------------------------*/
3925 size = apr_pstrdup(doc->buf.pool, val);
3927 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3928 /*----------------------------------------------------------------------*/
3929 /* CHTML 1.0 version 2.0 */
3930 /*----------------------------------------------------------------------*/
3931 attr_style = apr_pstrdup(doc->buf.pool, val);
3933 else if (STRCASEEQ('n','N',"name",nm)) {
3934 /*----------------------------------------------------------------------*/
3935 /* CHTML 1.0 version 2.0 */
3936 /*----------------------------------------------------------------------*/
3937 name = apr_pstrdup(doc->buf.pool, val);
3939 else if (STRCASEEQ('m','M',"multiple", nm)) {
3940 /*----------------------------------------------------------------------*/
3941 /* CHTML 1.0 version 2.0 */
3942 /*----------------------------------------------------------------------*/
3943 multiple = apr_pstrdup(doc->buf.pool, val);
3947 if (size && *size) {
3952 if (name && *name) {
3958 W_L(" multiple=\"multiple\"");
3962 if (IS_CSS_ON(ixhtml10->entryp)) {
3963 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
3966 return ixhtml10->out;
3971 * It is a handler who processes the SELECT tag.
3973 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3974 * destination is specified.
3975 * @param node [i] The SELECT tag node is specified.
3976 * @return The conversion result is returned.
3979 s_ixhtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
3981 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
3982 Doc *doc = ixhtml10->doc;
3985 if (IS_CSS_ON(ixhtml10->entryp)) {
3986 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
3989 return ixhtml10->out;
3993 * It is a handler who processes the OPTION tag.
3995 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
3996 * destination is specified.
3997 * @param node [i] The OPTION tag node is specified.
3998 * @return The conversion result is returned.
4001 s_ixhtml10_start_option_tag(void *pdoc, Node *node)
4003 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4004 Doc *doc = ixhtml10->doc;
4007 char *selected = NULL;
4009 char *attr_style = NULL;
4011 for (attr = qs_get_attr(doc,node);
4013 attr = qs_get_next_attr(doc,attr)) {
4014 char *nm = qs_get_attr_name(doc,attr);
4015 char *val = qs_get_attr_value(doc,attr);
4016 if (STRCASEEQ('s','S',"selected",nm)) {
4017 /*----------------------------------------------------------------------*/
4018 /* CHTML 1.0 version 2.0 */
4019 /*----------------------------------------------------------------------*/
4020 selected = apr_pstrdup(doc->buf.pool, val);
4022 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
4023 /*----------------------------------------------------------------------*/
4024 /* CHTML 1.0 version 2.0 */
4025 /*----------------------------------------------------------------------*/
4026 attr_style = apr_pstrdup(doc->buf.pool, val);
4028 else if (STRCASEEQ('v','V',"value",nm)) {
4029 /*----------------------------------------------------------------------*/
4030 /* CHTML 1.0 version 2.0 */
4031 /*----------------------------------------------------------------------*/
4032 value = apr_pstrdup(doc->buf.pool, val);
4036 if (value && *value) {
4042 W_L(" selected=\"selected\"");
4046 if (IS_CSS_ON(ixhtml10->entryp)) {
4047 s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4050 return ixhtml10->out;
4055 * It is a handler who processes the OPTION tag.
4057 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4058 * destination is specified.
4059 * @param node [i] The OPTION tag node is specified.
4060 * @return The conversion result is returned.
4063 s_ixhtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
4065 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4066 Doc *doc = ixhtml10->doc;
4069 if (IS_CSS_ON(ixhtml10->entryp)) {
4070 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4073 return ixhtml10->out;
4078 * It is a handler who processes the DIV tag.
4080 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4081 * destination is specified.
4082 * @param node [i] The DIV tag node is specified.
4083 * @return The conversion result is returned.
4086 s_ixhtml10_start_div_tag(void *pdoc, Node *node)
4088 ixhtml10_t *ixhtml10;
4092 char *attr_style = NULL;
4093 char *attr_align = NULL;
4094 char *attr_display = NULL;
4095 char *attr_decoration = NULL;
4096 char *attr_wap_marquee_style = NULL;
4097 char *attr_wap_marquee_dir = NULL;
4098 char *attr_wap_marquee_loop = NULL;
4099 char *attr_color = NULL;
4100 char *attr_bgcolor = NULL;
4101 char *attr_font_size = NULL;
4102 char *css_clear = NULL;
4104 ixhtml10 = GET_IXHTML10(pdoc);
4105 doc = ixhtml10->doc;
4108 for (attr = qs_get_attr(doc,node);
4110 attr = qs_get_next_attr(doc,attr)) {
4111 char *nm = qs_get_attr_name(doc,attr);
4112 char *val = qs_get_attr_value(doc,attr);
4113 if (STRCASEEQ('a','A',"align",nm)) {
4114 /*----------------------------------------------------------------------*/
4115 /* CHTML 1.0 (W3C version 3.2) */
4116 /*----------------------------------------------------------------------*/
4117 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
4118 attr_align = apr_pstrdup(doc->buf.pool, val);
4121 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
4122 attr_style = apr_pstrdup(doc->buf.pool, val);
4126 if (IS_CSS_ON(ixhtml10->entryp)) {
4127 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4129 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
4130 css_property_t *text_decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
4131 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4132 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
4133 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
4134 css_property_t *background_color_prop = chxj_css_get_property_value(doc, style, "background-color");
4135 css_property_t *background_prop = chxj_css_get_property_value(doc, style, "background");
4136 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4138 css_property_t *cur;
4139 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
4140 if (strcasecmp("-wap-marquee", cur->value) == 0) {
4141 attr_display = apr_pstrdup(doc->pool, cur->value);
4144 for (cur = background_color_prop->next; cur != background_color_prop; cur = cur->next) {
4145 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
4146 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
4148 for (cur = background_prop->next; cur != background_prop; cur = cur->next) {
4149 char *ss = strchr(cur->value, '#');
4151 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
4152 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
4155 for (cur = text_decoration_prop->next; cur != text_decoration_prop; cur = cur->next) {
4156 if (STRCASEEQ('b','B',"blink", cur->value)) {
4157 attr_decoration = apr_pstrdup(doc->pool, cur->value);
4160 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4161 attr_color = apr_pstrdup(doc->pool, cur->value);
4163 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
4164 attr_align = apr_pstrdup(doc->pool, cur->value);
4166 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
4167 if ( STRCASEEQ('x','X',"xx-small",cur->value)
4168 || STRCASEEQ('x','X',"x-small",cur->value)
4169 || STRCASEEQ('s','S',"small",cur->value)
4170 || STRCASEEQ('m','M',"medium",cur->value)
4171 || STRCASEEQ('l','L',"large",cur->value)
4172 || STRCASEEQ('x','X',"x-large",cur->value)
4173 || STRCASEEQ('x','X',"xx-large",cur->value)) {
4174 attr_font_size = apr_pstrdup(doc->pool, cur->value);
4178 css_property_t *wap_marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
4179 css_property_t *wap_marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
4180 css_property_t *wap_marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
4181 for (cur = wap_marquee_style_prop->next; cur != wap_marquee_style_prop; cur = cur->next) {
4182 if (STRCASEEQ('s','S',"scroll", cur->value) || STRCASEEQ('s','S',"slide",cur->value) || STRCASEEQ('a','A',"alternate",cur->value)) {
4183 attr_wap_marquee_style = apr_pstrdup(doc->pool, cur->value);
4186 for (cur = wap_marquee_dir_prop->next; cur != wap_marquee_dir_prop; cur = cur->next) {
4187 if (STRCASEEQ('l','L',"ltr",cur->value)) {
4188 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
4190 else if (STRCASEEQ('r','R',"rtl",cur->value)) {
4191 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
4194 for (cur = wap_marquee_loop_prop->next; cur != wap_marquee_loop_prop; cur = cur->next) {
4195 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
4196 attr_wap_marquee_loop = "infinite";
4199 attr_wap_marquee_loop = apr_pstrdup(doc->pool, cur->value);
4203 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4204 css_clear = apr_pstrdup(doc->pool, cur->value);
4212 || attr_wap_marquee_style
4213 || attr_wap_marquee_dir
4214 || attr_wap_marquee_loop
4230 if (attr_decoration) {
4231 W_L("text-decoration:");
4232 W_V(attr_decoration);
4235 if (attr_wap_marquee_style) {
4236 W_L("-wap-marquee-style:");
4237 W_V(attr_wap_marquee_style);
4240 if (attr_wap_marquee_dir) {
4241 W_L("-wap-marquee-dir:");
4242 W_V(attr_wap_marquee_dir);
4245 if (attr_wap_marquee_loop) {
4246 W_L("-wap-marquee-loop:");
4247 W_V(attr_wap_marquee_loop);
4256 W_L("background-color:");
4260 if (attr_font_size) {
4262 W_V(attr_font_size);
4273 return ixhtml10->out;
4278 * It is a handler who processes the DIV tag.
4280 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4281 * destination is specified.
4282 * @param node [i] The DIV tag node is specified.
4283 * @return The conversion result is returned.
4286 s_ixhtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
4288 ixhtml10_t *ixhtml10;
4292 ixhtml10 = GET_IXHTML10(pdoc);
4293 doc = ixhtml10->doc;
4297 if (IS_CSS_ON(ixhtml10->entryp)) {
4298 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4300 return ixhtml10->out;
4305 s_ixhtml10_istyle_to_wap_input_format(apr_pool_t *p, const char *s)
4309 case '1': return apr_psprintf(p, ""*<ja:h>"");
4310 case '2': return apr_psprintf(p, ""*<ja:hk>"");
4311 case '3': return apr_psprintf(p, ""*<ja:en>"");
4312 case '4': return apr_psprintf(p, ""*<ja:n>"");
4314 return apr_pstrdup(p, "");
4318 return apr_pstrdup(p,"");
4323 s_ixhtml10_chxjif_tag(void *pdoc, Node *node)
4325 ixhtml10_t *ixhtml10;
4330 ixhtml10 = GET_IXHTML10(pdoc);
4331 doc = ixhtml10->doc;
4334 for (child = qs_get_child_node(doc, node);
4336 child = qs_get_next_node(doc, child)) {
4338 s_ixhtml10_chxjif_tag(ixhtml10, child);
4345 * It is a handler who processes the TEXTARE tag.
4347 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4348 * destination is specified.
4349 * @param node [i] The TEXTAREA tag node is specified.
4350 * @return The conversion result is returned.
4353 s_ixhtml10_start_textarea_tag(void *pdoc, Node *node)
4355 ixhtml10_t *ixhtml10;
4359 char *attr_accesskey = NULL;
4360 char *attr_name = NULL;
4361 char *attr_rows = NULL;
4362 char *attr_cols = NULL;
4363 char *attr_istyle = NULL;
4364 char *attr_style = NULL;
4367 ixhtml10 = GET_IXHTML10(pdoc);
4368 doc = ixhtml10->doc;
4371 ixhtml10->textarea_flag++;
4372 for (attr = qs_get_attr(doc,node);
4374 attr = qs_get_next_attr(doc,attr)) {
4375 char *name = qs_get_attr_name(doc,attr);
4376 char *value = qs_get_attr_value(doc,attr);
4377 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
4378 attr_accesskey = value;
4380 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
4381 attr_istyle = value;
4383 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
4386 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
4389 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
4392 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4396 if (IS_CSS_ON(ixhtml10->entryp)) {
4397 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4399 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
4400 css_property_t *cur;
4401 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
4402 if (strcasestr(cur->value, "<ja:n>")) {
4405 else if (strcasestr(cur->value, "<ja:en>")) {
4408 else if (strcasestr(cur->value, "<ja:hk>")) {
4411 else if (strcasestr(cur->value, "<ja:h>")) {
4418 if (attr_accesskey) {
4419 W_L(" accesskey=\"");
4420 W_V(attr_accesskey);
4439 char *vv = s_ixhtml10_istyle_to_wap_input_format(doc->buf.pool,attr_istyle);
4441 W_L("-wap-input-format:");
4447 return ixhtml10->out;
4452 * It is a handler who processes the TEXTAREA tag.
4454 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4455 * destination is specified.
4456 * @param node [i] The TEXTAREA tag node is specified.
4457 * @return The conversion result is returned.
4460 s_ixhtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
4462 ixhtml10_t *ixhtml10;
4466 ixhtml10 = GET_IXHTML10(pdoc);
4467 doc = ixhtml10->doc;
4471 ixhtml10->textarea_flag--;
4473 return ixhtml10->out;
4478 * It is a handler who processes the B tag.
4480 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4481 * destination is specified.
4482 * @param node [i] The B tag node is specified.
4483 * @return The conversion result is returned.
4486 s_ixhtml10_start_b_tag(void* pdoc, Node* UNUSED(node))
4488 ixhtml10_t* ixhtml10;
4492 ixhtml10 = GET_IXHTML10(pdoc);
4493 doc = ixhtml10->doc;
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_end_b_tag(void* pdoc, Node* UNUSED(child))
4511 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4513 Doc *doc = ixhtml10->doc;
4516 return ixhtml10->out;
4520 s_ixhtml10_text_tag(void* pdoc, Node* child)
4522 ixhtml10_t* ixhtml10;
4531 apr_size_t z2h_input_len;
4533 ixhtml10 = GET_IXHTML10(pdoc);
4534 doc = ixhtml10->doc;
4537 textval = qs_get_node_value(doc,child);
4538 if (strlen(textval) == 0) {
4539 return ixhtml10->out;
4542 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
4543 memset(tmp, 0, qs_get_node_size(doc,child)+1);
4545 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
4546 memset(one_byte, 0, sizeof(one_byte));
4549 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
4551 int rtn = s_ixhtml10_search_emoji(ixhtml10, &textval[ii], &out,child);
4553 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
4558 if (is_sjis_kanji(textval[ii])) {
4559 one_byte[0] = textval[ii+0];
4560 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4561 one_byte[0] = textval[ii+1];
4562 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4566 if (ixhtml10->pre_flag) {
4567 one_byte[0] = textval[ii+0];
4568 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4571 if (ixhtml10->textarea_flag) {
4572 one_byte[0] = textval[ii+0];
4573 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4576 if (textval[ii] != '\r' && textval[ii] != '\n') {
4577 one_byte[0] = textval[ii+0];
4578 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4582 z2h_input_len = strlen(tdst);
4583 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, ixhtml10->entryp);
4586 return ixhtml10->out;
4591 * It is a handler who processes the BLOCKQUOTE tag.
4593 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4594 * destination is specified.
4595 * @param node [i] The BLOCKQUOTE tag node is specified.
4596 * @return The conversion result is returned.
4599 s_ixhtml10_start_blockquote_tag(void *pdoc, Node *node)
4601 ixhtml10_t *ixhtml10;
4604 char *attr_style = NULL;
4605 char *attr_color = NULL;
4606 char *attr_size = NULL;
4607 char *css_clear = NULL;
4609 ixhtml10 = GET_IXHTML10(pdoc);
4610 doc = ixhtml10->doc;
4611 for (attr = qs_get_attr(doc,node);
4613 attr = qs_get_next_attr(doc,attr)) {
4614 char *nm = qs_get_attr_name(doc,attr);
4615 char *val = qs_get_attr_value(doc,attr);
4616 if (val && STRCASEEQ('s','S',"style", nm)) {
4620 if (IS_CSS_ON(ixhtml10->entryp)) {
4621 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4623 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4624 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
4625 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4627 css_property_t *cur;
4628 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4629 if (cur->value && *cur->value) {
4630 attr_color = apr_pstrdup(doc->pool, cur->value);
4633 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
4634 if (cur->value && *cur->value) {
4635 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4636 attr_size = apr_pstrdup(doc->pool, cur->value);
4638 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4639 attr_size = apr_pstrdup(doc->pool, cur->value);
4641 else if (STRCASEEQ('s','S',"small",cur->value)) {
4642 attr_size = apr_pstrdup(doc->pool, cur->value);
4644 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4645 attr_size = apr_pstrdup(doc->pool, cur->value);
4647 else if (STRCASEEQ('l','L',"large",cur->value)) {
4648 attr_size = apr_pstrdup(doc->pool, cur->value);
4650 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4651 attr_size = apr_pstrdup(doc->pool, cur->value);
4653 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4654 attr_size = apr_pstrdup(doc->pool, cur->value);
4658 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4659 css_clear = apr_pstrdup(doc->pool, cur->value);
4664 if (attr_color || attr_size || css_clear) {
4667 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4685 return ixhtml10->out;
4690 * It is a handler who processes the BLOCKQUOTE tag.
4692 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4693 * destination is specified.
4694 * @param node [i] The BLOCKQUOTE tag node is specified.
4695 * @return The conversion result is returned.
4698 s_ixhtml10_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
4700 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4701 Doc *doc = ixhtml10->doc;
4702 W_L("</blockquote>");
4703 if (IS_CSS_ON(ixhtml10->entryp)) {
4704 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4706 return ixhtml10->out;
4711 * It is a handler who processes the DIR tag.
4713 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4714 * destination is specified.
4715 * @param node [i] The DIR tag node is specified.
4716 * @return The conversion result is returned.
4719 s_ixhtml10_start_dir_tag(void *pdoc, Node *node)
4721 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4722 Doc *doc = ixhtml10->doc;
4724 char *attr_style = NULL;
4725 char *attr_color = NULL;
4726 char *attr_type = NULL;
4727 char *attr_size = NULL;
4728 for (attr = qs_get_attr(doc,node);
4730 attr = qs_get_next_attr(doc,attr)) {
4731 char *name = qs_get_attr_name(doc,attr);
4732 char *value = qs_get_attr_value(doc,attr);
4733 if (STRCASEEQ('t','T',"type",name)) {
4734 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
4738 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4742 if (IS_CSS_ON(ixhtml10->entryp)) {
4743 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4745 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4746 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4747 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
4748 css_property_t *cur;
4749 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4750 if (cur->value && *cur->value) {
4751 attr_color = apr_pstrdup(doc->pool, cur->value);
4754 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4755 if (cur->value && *cur->value) {
4756 attr_type = apr_pstrdup(doc->pool, cur->value);
4759 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4760 if (cur->value && *cur->value) {
4761 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4762 attr_size = apr_pstrdup(doc->pool, cur->value);
4764 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4765 attr_size = apr_pstrdup(doc->pool, cur->value);
4767 else if (STRCASEEQ('s','S',"small",cur->value)) {
4768 attr_size = apr_pstrdup(doc->pool, cur->value);
4770 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4771 attr_size = apr_pstrdup(doc->pool, cur->value);
4773 else if (STRCASEEQ('l','L',"large",cur->value)) {
4774 attr_size = apr_pstrdup(doc->pool, cur->value);
4776 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4777 attr_size = apr_pstrdup(doc->pool, cur->value);
4779 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4780 attr_size = apr_pstrdup(doc->pool, cur->value);
4787 if (attr_type || attr_color || attr_size) {
4790 W_L("list-style-type:");
4795 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4808 return ixhtml10->out;
4813 * It is a handler who processes the DIR tag.
4815 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4816 * destination is specified.
4817 * @param node [i] The DIR tag node is specified.
4818 * @return The conversion result is returned.
4821 s_ixhtml10_end_dir_tag(void *pdoc, Node *UNUSED(child))
4823 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4824 Doc *doc = ixhtml10->doc;
4826 if (IS_CSS_ON(ixhtml10->entryp)) {
4827 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4829 return ixhtml10->out;
4834 * It is a handler who processes the DL tag.
4836 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4837 * destination is specified.
4838 * @param node [i] The DL tag node is specified.
4839 * @return The conversion result is returned.
4842 s_ixhtml10_start_dl_tag(void *pdoc, Node *node)
4844 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4845 Doc *doc = ixhtml10->doc;
4847 char *attr_style = NULL;
4848 char *attr_color = NULL;
4849 char *attr_size = NULL;
4850 char *css_clear = NULL;
4852 for (attr = qs_get_attr(doc,node);
4854 attr = qs_get_next_attr(doc,attr)) {
4855 char *name = qs_get_attr_name(doc,attr);
4856 char *value = qs_get_attr_value(doc,attr);
4857 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4861 if (IS_CSS_ON(ixhtml10->entryp)) {
4862 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4864 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4865 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4866 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4868 css_property_t *cur;
4869 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4870 if (cur->value && *cur->value) {
4871 attr_color = apr_pstrdup(doc->pool, cur->value);
4874 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4875 if (cur->value && *cur->value) {
4876 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4877 attr_size = apr_pstrdup(doc->pool, cur->value);
4879 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4880 attr_size = apr_pstrdup(doc->pool, cur->value);
4882 else if (STRCASEEQ('s','S',"small",cur->value)) {
4883 attr_size = apr_pstrdup(doc->pool, cur->value);
4885 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4886 attr_size = apr_pstrdup(doc->pool, cur->value);
4888 else if (STRCASEEQ('l','L',"large",cur->value)) {
4889 attr_size = apr_pstrdup(doc->pool, cur->value);
4891 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4892 attr_size = apr_pstrdup(doc->pool, cur->value);
4894 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4895 attr_size = apr_pstrdup(doc->pool, cur->value);
4899 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4900 css_clear = apr_pstrdup(doc->pool, cur->value);
4905 if (attr_color || attr_size || css_clear) {
4908 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4926 return ixhtml10->out;
4931 * It is a handler who processes the DL tag.
4933 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4934 * destination is specified.
4935 * @param node [i] The DL tag node is specified.
4936 * @return The conversion result is returned.
4939 s_ixhtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
4941 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4942 Doc *doc = ixhtml10->doc;
4944 if (IS_CSS_ON(ixhtml10->entryp)) {
4945 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
4947 return ixhtml10->out;
4952 * It is a handler who processes the DT tag.
4954 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
4955 * destination is specified.
4956 * @param node [i] The DT tag node is specified.
4957 * @return The conversion result is returned.
4960 s_ixhtml10_start_dt_tag(void *pdoc, Node *node)
4962 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
4963 Doc *doc = ixhtml10->doc;
4965 char *attr_style = NULL;
4966 char *attr_color = NULL;
4967 char *attr_size = NULL;
4968 for (attr = qs_get_attr(doc,node);
4970 attr = qs_get_next_attr(doc,attr)) {
4971 char *name = qs_get_attr_name(doc,attr);
4972 char *value = qs_get_attr_value(doc,attr);
4973 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4977 if (IS_CSS_ON(ixhtml10->entryp)) {
4978 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
4980 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4981 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4982 css_property_t *cur;
4983 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4984 if (cur->value && *cur->value) {
4985 attr_color = apr_pstrdup(doc->pool, cur->value);
4988 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4989 if (cur->value && *cur->value) {
4990 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4991 attr_size = apr_pstrdup(doc->pool, cur->value);
4993 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4994 attr_size = apr_pstrdup(doc->pool, cur->value);
4996 else if (STRCASEEQ('s','S',"small",cur->value)) {
4997 attr_size = apr_pstrdup(doc->pool, cur->value);
4999 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5000 attr_size = apr_pstrdup(doc->pool, cur->value);
5002 else if (STRCASEEQ('l','L',"large",cur->value)) {
5003 attr_size = apr_pstrdup(doc->pool, cur->value);
5005 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5006 attr_size = apr_pstrdup(doc->pool, cur->value);
5008 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5009 attr_size = apr_pstrdup(doc->pool, cur->value);
5016 if (attr_color || attr_size) {
5019 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5032 return ixhtml10->out;
5037 * It is a handler who processes the DT tag.
5039 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5040 * destination is specified.
5041 * @param node [i] The DT tag node is specified.
5042 * @return The conversion result is returned.
5045 s_ixhtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
5047 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5048 Doc *doc = ixhtml10->doc;
5050 if (IS_CSS_ON(ixhtml10->entryp)) {
5051 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5053 return ixhtml10->out;
5058 * It is a handler who processes the DD tag.
5060 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5061 * destination is specified.
5062 * @param node [i] The DD tag node is specified.
5063 * @return The conversion result is returned.
5066 s_ixhtml10_start_dd_tag(void *pdoc, Node *node)
5068 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5069 Doc *doc = ixhtml10->doc;
5071 char *attr_style = NULL;
5072 char *attr_color = NULL;
5073 char *attr_size = NULL;
5074 for (attr = qs_get_attr(doc,node);
5076 attr = qs_get_next_attr(doc,attr)) {
5077 char *name = qs_get_attr_name(doc,attr);
5078 char *value = qs_get_attr_value(doc,attr);
5079 if (STRCASEEQ('s','S',"style", name) && value && *value) {
5083 if (IS_CSS_ON(ixhtml10->entryp)) {
5084 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5086 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5087 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5088 css_property_t *cur;
5089 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5090 if (cur->value && *cur->value) {
5091 attr_color = apr_pstrdup(doc->pool, cur->value);
5094 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5095 if (cur->value && *cur->value) {
5096 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5097 attr_size = apr_pstrdup(doc->pool, cur->value);
5099 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5100 attr_size = apr_pstrdup(doc->pool, cur->value);
5102 else if (STRCASEEQ('s','S',"small",cur->value)) {
5103 attr_size = apr_pstrdup(doc->pool, cur->value);
5105 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5106 attr_size = apr_pstrdup(doc->pool, cur->value);
5108 else if (STRCASEEQ('l','L',"large",cur->value)) {
5109 attr_size = apr_pstrdup(doc->pool, cur->value);
5111 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5112 attr_size = apr_pstrdup(doc->pool, cur->value);
5114 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5115 attr_size = apr_pstrdup(doc->pool, cur->value);
5122 if (attr_color || attr_size) {
5125 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5138 return ixhtml10->out;
5143 * It is a handler who processes the DD tag.
5145 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5146 * destination is specified.
5147 * @param node [i] The DD tag node is specified.
5148 * @return The conversion result is returned.
5151 s_ixhtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
5153 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5154 Doc *doc = ixhtml10->doc;
5156 if (IS_CSS_ON(ixhtml10->entryp)) {
5157 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5159 return ixhtml10->out;
5164 * It is a handler who processes the H1 tag.
5166 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5167 * destination is specified.
5168 * @param node [i] The H1 tag node is specified.
5169 * @return The conversion result is returned.
5172 s_ixhtml10_start_h1_tag(void *pdoc, Node *node)
5174 ixhtml10_t *ixhtml10;
5178 char *attr_style = NULL;
5179 char *attr_align = NULL;
5180 char *css_clear = NULL;
5182 ixhtml10 = GET_IXHTML10(pdoc);
5183 doc = ixhtml10->doc;
5186 for (attr = qs_get_attr(doc,node);
5188 attr = qs_get_next_attr(doc,attr)) {
5189 char *name = qs_get_attr_name(doc,attr);
5190 char *value = qs_get_attr_value(doc,attr);
5191 if (STRCASEEQ('a','A',"align", name)) {
5192 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5196 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5200 if (IS_CSS_ON(ixhtml10->entryp)) {
5201 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5203 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5204 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5206 css_property_t *cur;
5207 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5208 if (STRCASEEQ('l','L',"left", cur->value)) {
5209 attr_align = apr_pstrdup(doc->pool, "left");
5211 else if (STRCASEEQ('c','C',"center",cur->value)) {
5212 attr_align = apr_pstrdup(doc->pool, "center");
5214 else if (STRCASEEQ('r','R',"right",cur->value)) {
5215 attr_align = apr_pstrdup(doc->pool, "right");
5219 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5220 if (STRCASEEQ('b','B',"both", cur->value)) {
5221 css_clear = apr_pstrdup(doc->pool, "both");
5223 else if (STRCASEEQ('r','R',"right", cur->value)) {
5224 css_clear = apr_pstrdup(doc->pool, "right");
5226 else if (STRCASEEQ('l','L',"left", cur->value)) {
5227 css_clear = apr_pstrdup(doc->pool, "left");
5233 if (attr_align || css_clear ) {
5249 return ixhtml10->out;
5254 * It is a handler who processes the H1 tag.
5256 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5257 * destination is specified.
5258 * @param node [i] The H1 tag node is specified.
5259 * @return The conversion result is returned.
5262 s_ixhtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
5264 ixhtml10_t* ixhtml10;
5268 ixhtml10 = GET_IXHTML10(pdoc);
5269 doc = ixhtml10->doc;
5273 if (IS_CSS_ON(ixhtml10->entryp)) {
5274 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5277 return ixhtml10->out;
5282 * It is a handler who processes the H2 tag.
5284 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5285 * destination is specified.
5286 * @param node [i] The H1 tag node is specified.
5287 * @return The conversion result is returned.
5290 s_ixhtml10_start_h2_tag(void *pdoc, Node *node)
5292 ixhtml10_t *ixhtml10;
5296 char *attr_style = NULL;
5297 char *attr_align = NULL;
5298 char *css_clear = NULL;
5300 ixhtml10 = GET_IXHTML10(pdoc);
5301 doc = ixhtml10->doc;
5304 for (attr = qs_get_attr(doc,node);
5306 attr = qs_get_next_attr(doc,attr)) {
5307 char *name = qs_get_attr_name(doc,attr);
5308 char *value = qs_get_attr_value(doc,attr);
5309 if (STRCASEEQ('a','A',"align", name)) {
5310 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5314 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5318 if (IS_CSS_ON(ixhtml10->entryp)) {
5319 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5321 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5322 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5323 css_property_t *cur;
5324 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5325 if (STRCASEEQ('l','L',"left", cur->value)) {
5326 attr_align = apr_pstrdup(doc->pool, "left");
5328 else if (STRCASEEQ('c','C',"center",cur->value)) {
5329 attr_align = apr_pstrdup(doc->pool, "center");
5331 else if (STRCASEEQ('r','R',"right",cur->value)) {
5332 attr_align = apr_pstrdup(doc->pool, "right");
5335 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5336 if (STRCASEEQ('b','B',"both", cur->value)) {
5337 css_clear = apr_pstrdup(doc->pool, "both");
5339 else if (STRCASEEQ('r','R',"right", cur->value)) {
5340 css_clear = apr_pstrdup(doc->pool, "right");
5342 else if (STRCASEEQ('l','L',"left", cur->value)) {
5343 css_clear = apr_pstrdup(doc->pool, "left");
5349 if (attr_align || css_clear ) {
5365 return ixhtml10->out;
5370 * It is a handler who processes the H2 tag.
5372 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5373 * destination is specified.
5374 * @param node [i] The H1 tag node is specified.
5375 * @return The conversion result is returned.
5378 s_ixhtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
5380 ixhtml10_t* ixhtml10;
5384 ixhtml10 = GET_IXHTML10(pdoc);
5385 doc = ixhtml10->doc;
5389 if (IS_CSS_ON(ixhtml10->entryp)) {
5390 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5392 return ixhtml10->out;
5397 * It is a handler who processes the H3 tag.
5399 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5400 * destination is specified.
5401 * @param node [i] The H1 tag node is specified.
5402 * @return The conversion result is returned.
5405 s_ixhtml10_start_h3_tag(void *pdoc, Node *node)
5407 ixhtml10_t *ixhtml10;
5411 char *attr_style = NULL;
5412 char *attr_align = NULL;
5413 char *css_clear = NULL;
5415 ixhtml10 = GET_IXHTML10(pdoc);
5416 doc = ixhtml10->doc;
5419 for (attr = qs_get_attr(doc,node);
5421 attr = qs_get_next_attr(doc,attr)) {
5422 char *name = qs_get_attr_name(doc,attr);
5423 char *value = qs_get_attr_value(doc,attr);
5424 if (STRCASEEQ('a','A',"align", name)) {
5425 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5429 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5433 if (IS_CSS_ON(ixhtml10->entryp)) {
5434 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5436 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5437 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5438 css_property_t *cur;
5439 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5440 if (STRCASEEQ('l','L',"left", cur->value)) {
5441 attr_align = apr_pstrdup(doc->pool, "left");
5443 else if (STRCASEEQ('c','C',"center",cur->value)) {
5444 attr_align = apr_pstrdup(doc->pool, "center");
5446 else if (STRCASEEQ('r','R',"right",cur->value)) {
5447 attr_align = apr_pstrdup(doc->pool, "right");
5450 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5451 if (STRCASEEQ('b','B',"both", cur->value)) {
5452 css_clear = apr_pstrdup(doc->pool, "both");
5454 else if (STRCASEEQ('r','R',"right", cur->value)) {
5455 css_clear = apr_pstrdup(doc->pool, "right");
5457 else if (STRCASEEQ('l','L',"left", cur->value)) {
5458 css_clear = apr_pstrdup(doc->pool, "left");
5464 if (attr_align || css_clear ) {
5480 return ixhtml10->out;
5485 * It is a handler who processes the H3 tag.
5487 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5488 * destination is specified.
5489 * @param node [i] The H1 tag node is specified.
5490 * @return The conversion result is returned.
5493 s_ixhtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
5495 ixhtml10_t* ixhtml10;
5499 ixhtml10 = GET_IXHTML10(pdoc);
5500 doc = ixhtml10->doc;
5504 if (IS_CSS_ON(ixhtml10->entryp)) {
5505 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5507 return ixhtml10->out;
5512 * It is a handler who processes the H4 tag.
5514 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5515 * destination is specified.
5516 * @param node [i] The H1 tag node is specified.
5517 * @return The conversion result is returned.
5520 s_ixhtml10_start_h4_tag(void *pdoc, Node *node)
5522 ixhtml10_t *ixhtml10;
5526 char *attr_style = NULL;
5527 char *attr_align = NULL;
5528 char *css_clear = NULL;
5530 ixhtml10 = GET_IXHTML10(pdoc);
5531 doc = ixhtml10->doc;
5534 for (attr = qs_get_attr(doc,node);
5536 attr = qs_get_next_attr(doc,attr)) {
5537 char *name = qs_get_attr_name(doc,attr);
5538 char *value = qs_get_attr_value(doc,attr);
5539 if (STRCASEEQ('a','A',"align", name)) {
5540 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5544 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5548 if (IS_CSS_ON(ixhtml10->entryp)) {
5549 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5551 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5552 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5553 css_property_t *cur;
5554 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5555 if (STRCASEEQ('l','L',"left", cur->value)) {
5556 attr_align = apr_pstrdup(doc->pool, "left");
5558 else if (STRCASEEQ('c','C',"center",cur->value)) {
5559 attr_align = apr_pstrdup(doc->pool, "center");
5561 else if (STRCASEEQ('r','R',"right",cur->value)) {
5562 attr_align = apr_pstrdup(doc->pool, "right");
5565 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5566 if (STRCASEEQ('b','B',"both", cur->value)) {
5567 css_clear = apr_pstrdup(doc->pool, "both");
5569 else if (STRCASEEQ('r','R',"right", cur->value)) {
5570 css_clear = apr_pstrdup(doc->pool, "right");
5572 else if (STRCASEEQ('l','L',"left", cur->value)) {
5573 css_clear = apr_pstrdup(doc->pool, "left");
5579 if (attr_align || css_clear ) {
5595 return ixhtml10->out;
5600 * It is a handler who processes the H4 tag.
5602 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5603 * destination is specified.
5604 * @param node [i] The H1 tag node is specified.
5605 * @return The conversion result is returned.
5608 s_ixhtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
5610 ixhtml10_t *ixhtml10;
5614 ixhtml10 = GET_IXHTML10(pdoc);
5615 doc = ixhtml10->doc;
5619 if (IS_CSS_ON(ixhtml10->entryp)) {
5620 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5623 return ixhtml10->out;
5628 * It is a handler who processes the H5 tag.
5630 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5631 * destination is specified.
5632 * @param node [i] The H1 tag node is specified.
5633 * @return The conversion result is returned.
5636 s_ixhtml10_start_h5_tag(void *pdoc, Node *node)
5638 ixhtml10_t *ixhtml10;
5642 char *attr_style = NULL;
5643 char *attr_align = NULL;
5644 char *css_clear = NULL;
5646 ixhtml10 = GET_IXHTML10(pdoc);
5647 doc = ixhtml10->doc;
5650 for (attr = qs_get_attr(doc,node);
5652 attr = qs_get_next_attr(doc,attr)) {
5653 char *name = qs_get_attr_name(doc,attr);
5654 char *value = qs_get_attr_value(doc,attr);
5655 if (STRCASEEQ('a','A',"align", name)) {
5656 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5660 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5664 if (IS_CSS_ON(ixhtml10->entryp)) {
5665 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5667 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5668 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5669 css_property_t *cur;
5670 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5671 if (STRCASEEQ('l','L',"left", cur->value)) {
5672 attr_align = apr_pstrdup(doc->pool, "left");
5674 else if (STRCASEEQ('c','C',"center",cur->value)) {
5675 attr_align = apr_pstrdup(doc->pool, "center");
5677 else if (STRCASEEQ('r','R',"right",cur->value)) {
5678 attr_align = apr_pstrdup(doc->pool, "right");
5681 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5682 if (STRCASEEQ('b','B',"both", cur->value)) {
5683 css_clear = apr_pstrdup(doc->pool, "both");
5685 else if (STRCASEEQ('r','R',"right", cur->value)) {
5686 css_clear = apr_pstrdup(doc->pool, "right");
5688 else if (STRCASEEQ('l','L',"left", cur->value)) {
5689 css_clear = apr_pstrdup(doc->pool, "left");
5695 if (attr_align || css_clear ) {
5711 return ixhtml10->out;
5716 * It is a handler who processes the H5 tag.
5718 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5719 * destination is specified.
5720 * @param node [i] The H1 tag node is specified.
5721 * @return The conversion result is returned.
5724 s_ixhtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
5726 ixhtml10_t *ixhtml10;
5730 ixhtml10 = GET_IXHTML10(pdoc);
5731 doc = ixhtml10->doc;
5735 if (IS_CSS_ON(ixhtml10->entryp)) {
5736 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5739 return ixhtml10->out;
5744 * It is a handler who processes the H6 tag.
5746 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5747 * destination is specified.
5748 * @param node [i] The H1 tag node is specified.
5749 * @return The conversion result is returned.
5752 s_ixhtml10_start_h6_tag(void *pdoc, Node *node)
5754 ixhtml10_t *ixhtml10;
5758 char *attr_style = NULL;
5759 char *attr_align = NULL;
5760 char *css_clear = NULL;
5762 ixhtml10 = GET_IXHTML10(pdoc);
5763 doc = ixhtml10->doc;
5766 for (attr = qs_get_attr(doc,node);
5768 attr = qs_get_next_attr(doc,attr)) {
5769 char *name = qs_get_attr_name(doc,attr);
5770 char *value = qs_get_attr_value(doc,attr);
5771 if (STRCASEEQ('a','A',"align", name)) {
5772 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5776 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5780 if (IS_CSS_ON(ixhtml10->entryp)) {
5781 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5783 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5784 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5785 css_property_t *cur;
5786 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5787 if (STRCASEEQ('l','L',"left", cur->value)) {
5788 attr_align = apr_pstrdup(doc->pool, "left");
5790 else if (STRCASEEQ('c','C',"center",cur->value)) {
5791 attr_align = apr_pstrdup(doc->pool, "center");
5793 else if (STRCASEEQ('r','R',"right",cur->value)) {
5794 attr_align = apr_pstrdup(doc->pool, "right");
5797 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5798 if (STRCASEEQ('b','B',"both", cur->value)) {
5799 css_clear = apr_pstrdup(doc->pool, "both");
5801 else if (STRCASEEQ('r','R',"right", cur->value)) {
5802 css_clear = apr_pstrdup(doc->pool, "right");
5804 else if (STRCASEEQ('l','L',"left", cur->value)) {
5805 css_clear = apr_pstrdup(doc->pool, "left");
5811 if (attr_align || css_clear ) {
5827 return ixhtml10->out;
5832 * It is a handler who processes the H6 tag.
5834 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5835 * destination is specified.
5836 * @param node [i] The H1 tag node is specified.
5837 * @return The conversion result is returned.
5840 s_ixhtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
5842 ixhtml10_t *ixhtml10;
5846 ixhtml10 = GET_IXHTML10(pdoc);
5847 doc = ixhtml10->doc;
5851 if (IS_CSS_ON(ixhtml10->entryp)) {
5852 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5855 return ixhtml10->out;
5860 * It is a handler who processes the MENU tag.
5862 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5863 * destination is specified.
5864 * @param node [i] The MENU tag node is specified.
5865 * @return The conversion result is returned.
5868 s_ixhtml10_start_menu_tag(void *pdoc, Node *node)
5870 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5871 Doc *doc = ixhtml10->doc;
5873 char *attr_style = NULL;
5874 char *attr_color = NULL;
5875 char *attr_type = NULL;
5876 char *attr_size = NULL;
5877 for (attr = qs_get_attr(doc,node);
5879 attr = qs_get_next_attr(doc,attr)) {
5880 char *name = qs_get_attr_name(doc,attr);
5881 char *value = qs_get_attr_value(doc,attr);
5882 if (STRCASEEQ('t','T',"type",name)) {
5883 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
5887 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
5891 if (IS_CSS_ON(ixhtml10->entryp)) {
5892 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
5894 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5895 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5896 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
5897 css_property_t *cur;
5898 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5899 if (cur->value && *cur->value) {
5900 attr_color = apr_pstrdup(doc->pool, cur->value);
5903 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5904 if (cur->value && *cur->value) {
5905 attr_type = apr_pstrdup(doc->pool, cur->value);
5908 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5909 if (cur->value && *cur->value) {
5910 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5911 attr_size = apr_pstrdup(doc->pool, cur->value);
5913 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5914 attr_size = apr_pstrdup(doc->pool, cur->value);
5916 else if (STRCASEEQ('s','S',"small",cur->value)) {
5917 attr_size = apr_pstrdup(doc->pool, cur->value);
5919 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5920 attr_size = apr_pstrdup(doc->pool, cur->value);
5922 else if (STRCASEEQ('l','L',"large",cur->value)) {
5923 attr_size = apr_pstrdup(doc->pool, cur->value);
5925 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5926 attr_size = apr_pstrdup(doc->pool, cur->value);
5928 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5929 attr_size = apr_pstrdup(doc->pool, cur->value);
5936 if (attr_type || attr_color || attr_size) {
5939 W_L("list-style-type:");
5944 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5957 return ixhtml10->out;
5962 * It is a handler who processes the MENU tag.
5964 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5965 * destination is specified.
5966 * @param node [i] The MENU tag node is specified.
5967 * @return The conversion result is returned.
5970 s_ixhtml10_end_menu_tag(void *pdoc, Node *UNUSED(child))
5972 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
5973 Doc *doc = ixhtml10->doc;
5975 if (IS_CSS_ON(ixhtml10->entryp)) {
5976 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
5978 return ixhtml10->out;
5983 * It is a handler who processes the PLAINTEXT tag.
5985 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
5986 * destination is specified.
5987 * @param node [i] The PLAINTEXT tag node is specified.
5988 * @return The conversion result is returned.
5991 s_ixhtml10_start_plaintext_tag(void *pdoc, Node *node)
5993 ixhtml10_t *ixhtml10;
5996 ixhtml10 = GET_IXHTML10(pdoc);
5997 doc = ixhtml10->doc;
5999 s_ixhtml10_start_plaintext_tag_inner(pdoc,node);
6000 return ixhtml10->out;
6004 s_ixhtml10_start_plaintext_tag_inner(void *pdoc, Node *node)
6006 ixhtml10_t *ixhtml10;
6009 ixhtml10 = GET_IXHTML10(pdoc);
6010 doc = ixhtml10->doc;
6011 for (child = qs_get_child_node(doc, node);
6013 child = qs_get_next_node(doc, child)) {
6015 s_ixhtml10_start_plaintext_tag_inner(pdoc, child);
6017 return ixhtml10->out;
6022 * It is a handler who processes the PLAINTEXT tag.
6024 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6025 * destination is specified.
6026 * @param node [i] The PLAINTEXT tag node is specified.
6027 * @return The conversion result is returned.
6030 s_ixhtml10_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
6032 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6033 return ixhtml10->out;
6038 * It is a handler who processes the BLINK tag.
6040 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6041 * destination is specified.
6042 * @param node [i] The BLINK tag node is specified.
6043 * @return The conversion result is returned.
6046 s_ixhtml10_start_blink_tag(void *pdoc, Node *node)
6048 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6049 Doc *doc = ixhtml10->doc;
6051 char *attr_style = NULL;
6052 char *attr_color = NULL;
6053 char *attr_size = NULL;
6054 for (attr = qs_get_attr(doc,node);
6056 attr = qs_get_next_attr(doc,attr)) {
6057 char *name = qs_get_attr_name(doc,attr);
6058 char *value = qs_get_attr_value(doc,attr);
6059 if (STRCASEEQ('s','S',"style", name) && value && *value) {
6063 if (IS_CSS_ON(ixhtml10->entryp)) {
6064 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6066 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6067 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6068 css_property_t *cur;
6069 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6070 if (cur->value && *cur->value) {
6071 attr_color = apr_pstrdup(doc->pool, cur->value);
6074 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6075 if (cur->value && *cur->value) {
6076 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
6077 attr_size = apr_pstrdup(doc->pool, cur->value);
6079 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
6080 attr_size = apr_pstrdup(doc->pool, cur->value);
6082 else if (STRCASEEQ('s','S',"small",cur->value)) {
6083 attr_size = apr_pstrdup(doc->pool, cur->value);
6085 else if (STRCASEEQ('m','M',"medium",cur->value)) {
6086 attr_size = apr_pstrdup(doc->pool, cur->value);
6088 else if (STRCASEEQ('l','L',"large",cur->value)) {
6089 attr_size = apr_pstrdup(doc->pool, cur->value);
6091 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
6092 attr_size = apr_pstrdup(doc->pool, cur->value);
6094 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
6095 attr_size = apr_pstrdup(doc->pool, cur->value);
6102 W_L(" style=\"text-decoration:blink;");
6103 if (attr_color || attr_size) {
6105 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6118 return ixhtml10->out;
6123 * It is a handler who processes the BLINK tag.
6125 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6126 * destination is specified.
6127 * @param node [i] The BLINK tag node is specified.
6128 * @return The conversion result is returned.
6131 s_ixhtml10_end_blink_tag(void *pdoc, Node *UNUSED(child))
6133 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6134 Doc *doc = ixhtml10->doc;
6136 if (IS_CSS_ON(ixhtml10->entryp)) {
6137 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6139 return ixhtml10->out;
6144 * It is a handler who processes the MARQUEE tag.
6146 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6147 * destination is specified.
6148 * @param node [i] The MARQUEE tag node is specified.
6149 * @return The conversion result is returned.
6152 s_ixhtml10_start_marquee_tag(void *pdoc, Node *node)
6154 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6155 Doc *doc = ixhtml10->doc;
6157 char *attr_direction = NULL;
6158 char *attr_style = NULL;
6159 char *attr_color = NULL;
6160 char *attr_size = NULL;
6161 char *attr_bgcolor = NULL;
6162 /*--------------------------------------------------------------------------*/
6163 /* Get Attributes */
6164 /*--------------------------------------------------------------------------*/
6165 for (attr = qs_get_attr(doc,node);
6167 attr = qs_get_next_attr(doc,attr)) {
6168 char *name = qs_get_attr_name(doc,attr);
6169 char *value = qs_get_attr_value(doc,attr);
6170 if (STRCASEEQ('d','D',"direction", name)) {
6172 if (STRCASEEQ('l','L',"left",value)) {
6173 attr_direction = "rtl";
6175 else if (STRCASEEQ('r','R',"right",value)) {
6176 attr_direction = "ltr";
6180 else if (STRCASEEQ('b','B',"behavior",name)) {
6183 else if (STRCASEEQ('l','L',"loop",name)) {
6186 else if (STRCASEEQ('b','B',"bgcolor",name)) {
6187 if (value && *value) {
6188 attr_bgcolor = value;
6191 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
6195 if (IS_CSS_ON(ixhtml10->entryp)) {
6196 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6198 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6199 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6200 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
6201 css_property_t *direction_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
6202 css_property_t *cur;
6203 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6204 if (cur->value && *cur->value) {
6205 attr_color = apr_pstrdup(doc->pool, cur->value);
6208 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
6209 if (cur->value && *cur->value) {
6210 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
6213 for (cur = direction_prop->next; cur != direction_prop; cur = cur->next) {
6214 if (cur->value && *cur->value) {
6215 attr_direction = apr_pstrdup(doc->pool, cur->value);
6218 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6219 if (cur->value && *cur->value) {
6220 if ( STRCASEEQ('x','X',"xx-small",cur->value)
6221 || STRCASEEQ('x','X',"x-small", cur->value)
6222 || STRCASEEQ('s','S',"small", cur->value)
6223 || STRCASEEQ('m','M',"medium", cur->value)
6224 || STRCASEEQ('l','L',"large", cur->value)
6225 || STRCASEEQ('x','X',"x-large", cur->value)
6226 || STRCASEEQ('x','X',"xx-large",cur->value)) {
6227 attr_size = apr_pstrdup(doc->pool, cur->value);
6234 W_L(" style=\"display:-wap-marquee;");
6235 if (attr_color || attr_size || attr_direction || attr_bgcolor) {
6236 if (attr_direction) {
6237 W_L("-wap-marquee-dir:");
6238 W_V(attr_direction);
6242 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
6243 W_L("background-color:");
6248 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6262 return ixhtml10->out;
6267 * It is a handler who processes the MARQUEE tag.
6269 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6270 * destination is specified.
6271 * @param node [i] The MARQUEE tag node is specified.
6272 * @return The conversion result is returned.
6275 s_ixhtml10_end_marquee_tag(void *pdoc, Node *UNUSED(node))
6277 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6278 Doc *doc = ixhtml10->doc;
6280 if (IS_CSS_ON(ixhtml10->entryp)) {
6281 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6283 return ixhtml10->out;
6288 * It is handler who processes the New Line Code.
6291 s_ixhtml10_newline_mark(void *pdoc, Node *UNUSED(node))
6293 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6294 Doc *doc = ixhtml10->doc;
6295 if (ixhtml10->start_html_flag) {
6298 return ixhtml10->out;
6303 * It is a handler who processes the LINK tag.
6305 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6306 * destination is specified.
6307 * @param node [i] The LINK tag node is specified.
6308 * @return The conversion result is returned.
6311 s_ixhtml10_link_tag(void *pdoc, Node *node)
6313 ixhtml10_t *ixhtml10;
6320 ixhtml10 = GET_IXHTML10(pdoc);
6321 doc = ixhtml10->doc;
6323 if (! IS_CSS_ON(ixhtml10->entryp)) {
6324 return ixhtml10->out;
6327 for (attr = qs_get_attr(doc,node);
6329 attr = qs_get_next_attr(doc,attr)) {
6330 char *name = qs_get_attr_name(doc,attr);
6331 char *value = qs_get_attr_value(doc,attr);
6332 if (STRCASEEQ('r','R',"rel", name)) {
6333 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
6337 else if (STRCASEEQ('h','H',"href", name)) {
6338 if (value && *value) {
6342 else if (STRCASEEQ('t','T',"type", name)) {
6343 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6349 if (rel && href && type) {
6350 DBG(doc->r, "start load CSS. url:[%s]", href);
6351 ixhtml10->style = chxj_css_parse_from_uri(doc->r, doc->pool, ixhtml10->style, href);
6352 DBG(doc->r, "end load CSS. url:[%s]", href);
6355 return ixhtml10->out;
6359 static css_prop_list_t *
6360 s_ixhtml10_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6362 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6363 Doc *doc = ixhtml10->doc;
6364 css_prop_list_t *last_css = NULL;
6365 if (IS_CSS_ON(ixhtml10->entryp)) {
6366 css_prop_list_t *dup_css;
6367 css_selector_t *selector;
6369 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6370 dup_css = chxj_dup_css_prop_list(doc, last_css);
6371 selector = chxj_css_find_selector(doc, ixhtml10->style, node);
6373 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6375 chxj_css_push_prop_list(ixhtml10->css_prop_stack, dup_css);
6376 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6378 if (style_attr_value) {
6379 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));
6381 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6389 static css_prop_list_t *
6390 s_ixhtml10_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6392 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6393 Doc *doc = ixhtml10->doc;
6394 css_prop_list_t *last_css = NULL;
6395 if (IS_CSS_ON(ixhtml10->entryp)) {
6396 css_prop_list_t *dup_css;
6397 css_selector_t *selector;
6399 last_css = chxj_css_get_last_prop_list(ixhtml10->css_prop_stack);
6400 dup_css = chxj_dup_css_prop_list(doc, last_css);
6401 selector = chxj_css_find_selector(doc, ixhtml10->style, node);
6403 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6407 if (style_attr_value) {
6408 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));
6410 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6419 * It is a handler who processes the SPAN tag.
6421 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6422 * destination is specified.
6423 * @param node [i] The SPAN tag node is specified.
6424 * @return The conversion result is returned.
6427 s_ixhtml10_start_span_tag(void *pdoc, Node *node)
6429 ixhtml10_t *ixhtml10;
6432 char *attr_style = NULL;
6433 char *attr_color = NULL;
6434 char *attr_size = NULL;
6435 char *attr_align = NULL;
6436 char *attr_blink = NULL;
6437 char *attr_marquee = NULL;
6438 char *attr_marquee_dir = NULL;
6439 char *attr_marquee_style = NULL;
6440 char *attr_marquee_loop = NULL;
6441 char *css_bgcolor = NULL;
6443 ixhtml10 = GET_IXHTML10(pdoc);
6444 doc = ixhtml10->doc;
6446 for (attr = qs_get_attr(doc,node);
6448 attr = qs_get_next_attr(doc,attr)) {
6449 char *nm = qs_get_attr_name(doc,attr);
6450 char *val = qs_get_attr_value(doc,attr);
6451 if (val && STRCASEEQ('s','S',"style", nm)) {
6455 if (IS_CSS_ON(ixhtml10->entryp)) {
6456 css_prop_list_t *style = s_ixhtml10_nopush_and_get_now_style(pdoc, node, attr_style);
6458 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6459 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6460 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
6461 css_property_t *decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
6462 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
6463 css_property_t *marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
6464 css_property_t *marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
6465 css_property_t *marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
6466 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
6468 css_property_t *cur;
6469 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6470 attr_color = apr_pstrdup(doc->pool, cur->value);
6472 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6473 if (cur->value && *cur->value) {
6474 if ( STRCASEEQ('x','X',"xx-small",cur->value)
6475 || STRCASEEQ('x','X',"x-small", cur->value)
6476 || STRCASEEQ('s','S',"small", cur->value)
6477 || STRCASEEQ('m','M',"medium", cur->value)
6478 || STRCASEEQ('l','L',"large", cur->value)
6479 || STRCASEEQ('x','X',"x-large", cur->value)
6480 || STRCASEEQ('x','X',"xx-large",cur->value)) {
6481 attr_size = apr_pstrdup(doc->pool, cur->value);
6485 for (cur = decoration_prop->next; cur != decoration_prop; cur = cur->next) {
6486 if (cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
6487 attr_blink = apr_pstrdup(doc->pool, cur->value);
6490 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
6491 if (cur->value && strcasecmp("-wap-marquee",cur->value) == 0) {
6492 attr_marquee = apr_pstrdup(doc->pool, cur->value);
6495 for (cur = marquee_dir_prop->next; cur != marquee_dir_prop; cur = cur->next) {
6496 if (cur->value && *cur->value) {
6497 if ( STRCASEEQ('l','L',"ltr",cur->value)
6498 || STRCASEEQ('r','R',"rtl",cur->value)) {
6499 attr_marquee_dir = apr_pstrdup(doc->pool, cur->value);
6503 for (cur = marquee_style_prop->next; cur != marquee_style_prop; cur = cur->next) {
6504 if (cur->value && *cur->value) {
6505 if ( STRCASEEQ('s','S',"scroll",cur->value)
6506 || STRCASEEQ('s','S',"slide",cur->value)
6507 || STRCASEEQ('a','A',"alternate",cur->value)) {
6508 attr_marquee_style = apr_pstrdup(doc->pool, cur->value);
6512 for (cur = marquee_loop_prop->next; cur != marquee_loop_prop; cur = cur->next) {
6513 if (cur->value && *cur->value) {
6514 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
6515 attr_marquee_loop = "infinite";
6518 attr_marquee_loop = apr_pstrdup(doc->pool, cur->value);
6522 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
6523 if (STRCASEEQ('l','L',"left", cur->value)) {
6524 attr_align = apr_pstrdup(doc->pool, "left");
6526 else if (STRCASEEQ('c','C',"center",cur->value)) {
6527 attr_align = apr_pstrdup(doc->pool, "center");
6529 else if (STRCASEEQ('r','R',"right",cur->value)) {
6530 attr_align = apr_pstrdup(doc->pool, "right");
6533 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
6534 if (cur->value && *cur->value) {
6535 css_bgcolor = apr_pstrdup(doc->pool, cur->value);
6542 if (attr_color || attr_size || attr_align || attr_blink || attr_marquee || css_bgcolor) {
6545 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6561 W_L("text-decoration:");
6566 W_L("display:-wap-marquee;");
6567 if (attr_marquee_dir) {
6568 W_L("-wap-marquee-dir:");
6569 W_V(attr_marquee_dir);
6572 if (attr_marquee_style) {
6573 W_L("-wap-marquee-style:");
6574 W_V(attr_marquee_style);
6577 if (attr_marquee_loop) {
6578 W_L("-wap-marquee-loop:");
6579 W_V(attr_marquee_loop);
6584 W_L("background-color:");
6591 return ixhtml10->out;
6596 * It is a handler who processes the SPAN tag.
6598 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6599 * destination is specified.
6600 * @param node [i] The SPAN tag node is specified.
6601 * @return The conversion result is returned.
6604 s_ixhtml10_end_span_tag(void *pdoc, Node *UNUSED(node))
6606 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6607 Doc *doc = ixhtml10->doc;
6611 if (IS_CSS_ON(ixhtml10->entryp)) {
6612 chxj_css_pop_prop_list(ixhtml10->css_prop_stack);
6615 return ixhtml10->out;
6620 * It is a handler who processes the STYLE tag.
6622 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6623 * destination is specified.
6624 * @param node [i] The STYLE tag node is specified.
6625 * @return The conversion result is returned.
6628 s_ixhtml10_style_tag(void *pdoc, Node *node)
6630 ixhtml10_t *ixhtml10;
6635 ixhtml10 = GET_IXHTML10(pdoc);
6636 doc = ixhtml10->doc;
6638 if (! IS_CSS_ON(ixhtml10->entryp)) {
6639 return ixhtml10->out;
6642 for (attr = qs_get_attr(doc,node);
6644 attr = qs_get_next_attr(doc,attr)) {
6645 char *name = qs_get_attr_name(doc,attr);
6646 char *value = qs_get_attr_value(doc,attr);
6647 if (STRCASEEQ('t','T',"type", name)) {
6648 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6654 Node *child = qs_get_child_node(doc, node);
6655 if (type && child) {
6656 char *name = qs_get_node_name(doc, child);
6657 if (STRCASEEQ('t','T',"text", name)) {
6658 char *value = qs_get_node_value(doc, child);
6659 DBG(doc->r, "start load CSS. buf:[%s]", value);
6660 ixhtml10->style = chxj_css_parse_style_value(doc, ixhtml10->style, value);
6661 DBG(doc->r, "end load CSS. value:[%s]", value);
6664 return ixhtml10->out;
6669 s_ixhtml10_create_style_data(apr_pool_t *pool, const char *style_data)
6674 return apr_pstrcat(pool, "<style type=\"text/css\"><![CDATA[",style_data, "]]></style>", NULL);
6679 * It is a handler who processes the NOBR tag.
6681 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6682 * destination is specified.
6683 * @param node [i] The NOBR tag node is specified.
6684 * @return The conversion result is returned.
6687 s_ixhtml10_start_nobr_tag(void *pdoc, Node *UNUSED(node))
6689 ixhtml10_t *ixhtml10;
6692 ixhtml10 = GET_IXHTML10(pdoc);
6693 doc = ixhtml10->doc;
6696 return ixhtml10->out;
6701 * It is a handler who processes the NOBR tag.
6703 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6704 * destination is specified.
6705 * @param node [i] The NOBR tag node is specified.
6706 * @return The conversion result is returned.
6709 s_ixhtml10_end_nobr_tag(void *pdoc, Node *UNUSED(node))
6711 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6712 Doc *doc = ixhtml10->doc;
6715 return ixhtml10->out;
6721 * It is a handler who processes the SMALL tag.
6723 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6724 * destination is specified.
6725 * @param node [i] The SMALL tag node is specified.
6726 * @return The conversion result is returned.
6729 s_ixhtml10_start_small_tag(void *pdoc, Node *UNUSED(node))
6731 ixhtml10_t *ixhtml10;
6734 ixhtml10 = GET_IXHTML10(pdoc);
6735 doc = ixhtml10->doc;
6738 return ixhtml10->out;
6743 * It is a handler who processes the SMALL tag.
6745 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6746 * destination is specified.
6747 * @param node [i] The SMALL tag node is specified.
6748 * @return The conversion result is returned.
6751 s_ixhtml10_end_small_tag(void *pdoc, Node *UNUSED(node))
6753 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6754 Doc *doc = ixhtml10->doc;
6757 return ixhtml10->out;
6761 * It is a handler who processes the OBJECT tag.
6763 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6764 * destination is specified.
6765 * @param node [i] The OBJECT tag node is specified.
6766 * @return The conversion result is returned.
6769 s_ixhtml10_start_object_tag(void *pdoc, Node *node)
6771 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6772 Doc *doc = ixhtml10->doc;
6774 char *attr_style = NULL;
6775 char *attr_id = NULL;
6776 char *attr_width = NULL;
6777 char *attr_height = NULL;
6778 char *attr_data = NULL;
6779 char *attr_type = NULL;
6780 char *attr_declare = NULL;
6782 /*--------------------------------------------------------------------------*/
6783 /* Get Attributes */
6784 /*--------------------------------------------------------------------------*/
6785 for (attr = qs_get_attr(doc,node);
6787 attr = qs_get_next_attr(doc,attr)) {
6788 char *name = qs_get_attr_name(doc,attr);
6789 char *value = qs_get_attr_value(doc,attr);
6790 if (STRCASEEQ('i','I',"id",name)) {
6791 attr_id = apr_pstrdup(doc->pool, value);
6793 else if (STRCASEEQ('w','W',"width",name)) {
6794 attr_width = apr_pstrdup(doc->pool, value);
6796 else if (STRCASEEQ('h','H',"height",name)) {
6797 attr_height = apr_pstrdup(doc->pool, value);
6799 else if (STRCASEEQ('d','D',"data",name)) {
6800 attr_data = apr_pstrdup(doc->pool, value);
6802 else if (STRCASEEQ('t','T',"type",name)) {
6803 attr_type = apr_pstrdup(doc->pool, value);
6805 else if (STRCASEEQ('d','D',"declare",name)) {
6806 attr_declare = apr_pstrdup(doc->pool, value);
6837 W_L(" declare=\"declare\"");
6841 return ixhtml10->out;
6846 * It is a handler who processes the OBJECT tag.
6848 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6849 * destination is specified.
6850 * @param node [i] The OBJECT tag node is specified.
6851 * @return The conversion result is returned.
6854 s_ixhtml10_end_object_tag(void *pdoc, Node *UNUSED(node))
6856 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6857 Doc *doc = ixhtml10->doc;
6860 return ixhtml10->out;
6864 * It is a handler who processes the PARAM tag.
6866 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6867 * destination is specified.
6868 * @param node [i] The PARAM tag node is specified.
6869 * @return The conversion result is returned.
6872 s_ixhtml10_start_param_tag(void *pdoc, Node *node)
6874 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6875 Doc *doc = ixhtml10->doc;
6877 char *attr_style = NULL;
6878 char *attr_name = NULL;
6879 char *attr_value = NULL;
6880 char *attr_valuetype = NULL;
6882 /*--------------------------------------------------------------------------*/
6883 /* Get Attributes */
6884 /*--------------------------------------------------------------------------*/
6885 for (attr = qs_get_attr(doc,node);
6887 attr = qs_get_next_attr(doc,attr)) {
6888 char *name = qs_get_attr_name(doc,attr);
6889 char *value = qs_get_attr_value(doc,attr);
6890 if (STRCASEEQ('n','N',"name",name)) {
6891 attr_name = apr_pstrdup(doc->pool, value);
6893 else if (STRCASEEQ('v','V',"value",name)) {
6894 attr_value = apr_pstrdup(doc->pool, value);
6896 else if (STRCASEEQ('v','V',"valuetype",name)) {
6897 attr_valuetype = apr_pstrdup(doc->pool, value);
6913 W_L(" valuetype=\"");
6914 W_V(attr_valuetype);
6918 return ixhtml10->out;
6922 * It is a handler who processes the CAPTION tag.
6924 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6925 * destination is specified.
6926 * @param node [i] The CAPTION tag node is specified.
6927 * @return The conversion result is returned.
6930 s_ixhtml10_start_caption_tag(void *pdoc, Node *node)
6932 ixhtml10_t *ixhtml10;
6936 char *attr_style = NULL;
6937 char *attr_align = NULL;
6939 ixhtml10 = GET_IXHTML10(pdoc);
6940 doc = ixhtml10->doc;
6943 for (attr = qs_get_attr(doc,node);
6945 attr = qs_get_next_attr(doc,attr)) {
6946 char *name = qs_get_attr_name(doc,attr);
6947 char *value = qs_get_attr_value(doc,attr);
6948 if (STRCASEEQ('a','A',"align", name)) {
6950 (STRCASEEQ('l','L',"left",value)
6951 || STRCASEEQ('r','R',"right",value)
6952 || STRCASEEQ('t','T',"top",value)
6953 || STRCASEEQ('b','B',"bottom",value)
6958 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
6969 return ixhtml10->out;
6974 * It is a handler who processes the CAPTION tag.
6976 * @param pdoc [i/o] The pointer to the IXHTML10 structure at the output
6977 * destination is specified.
6978 * @param node [i] The CAPTION tag node is specified.
6979 * @return The conversion result is returned.
6982 s_ixhtml10_end_caption_tag(void *pdoc, Node *UNUSED(node))
6984 ixhtml10_t *ixhtml10 = GET_IXHTML10(pdoc);
6985 Doc *doc = ixhtml10->doc;
6988 return ixhtml10->out;