2 * Copyright (C) 2005-2008 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_chtml20.h"
18 #include "chxj_hdml.h"
19 #include "chxj_str_util.h"
20 #include "chxj_dump.h"
21 #include "chxj_img_conv.h"
22 #include "chxj_qr_code.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
27 #define GET_CHTML20(X) ((chtml20_t*)(X))
28 <<<<<<< HEAD:src/chxj_chtml20.c
32 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
33 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
34 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
35 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
36 <<<<<<< HEAD:src/chxj_chtml20.c
39 #define W_NLCODE() do { char *nlcode = TO_NLCODE(chtml20->conf); W_V(nlcode); } while (0)
40 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
42 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
43 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
44 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
45 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
46 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
47 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
48 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
49 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
50 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
51 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
52 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
53 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
54 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
55 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
56 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
57 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
58 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
59 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
60 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
61 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
62 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
63 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
64 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
65 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
66 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
67 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
68 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
69 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
70 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
71 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
72 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
73 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
74 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
75 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
76 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
77 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
78 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
79 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
80 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
81 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
82 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
83 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
84 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
85 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
86 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
87 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
88 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
89 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
90 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
91 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
92 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
93 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
94 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
95 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
96 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
97 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
98 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
99 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
100 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
101 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
102 static char *s_chtml20_start_blockquote_tag(void *pdoc, Node *node);
103 static char *s_chtml20_end_blockquote_tag (void *pdoc, Node *node);
104 static char *s_chtml20_start_dir_tag (void *pdoc, Node *node);
105 static char *s_chtml20_end_dir_tag (void *pdoc, Node *node);
106 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
107 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
108 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
109 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
110 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
111 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
112 static char *s_chtml20_start_menu_tag (void *pdoc, Node *node);
113 static char *s_chtml20_end_menu_tag (void *pdoc, Node *node);
114 static char *s_chtml20_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_chtml20_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_chtml20_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_chtml20_start_blink_tag (void *pdoc, Node *node);
118 static char *s_chtml20_end_blink_tag (void *pdoc, Node *node);
119 static char *s_chtml20_start_marquee_tag (void *pdoc, Node *node);
120 static char *s_chtml20_end_marquee_tag (void *pdoc, Node *node);
122 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
124 static int s_chtml20_search_emoji(chtml20_t *chtml, char *txt, char **rslt);
126 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
127 static char *s_chtml20_text_tag(void *pdoc, Node *node);
130 tag_handler chtml20_handler[] = {
133 s_chtml20_start_html_tag,
134 s_chtml20_end_html_tag,
138 s_chtml20_start_meta_tag,
139 s_chtml20_end_meta_tag,
143 s_chtml20_start_textarea_tag,
144 s_chtml20_end_textarea_tag,
148 s_chtml20_start_p_tag,
153 s_chtml20_start_pre_tag,
154 s_chtml20_end_pre_tag,
158 s_chtml20_start_ul_tag,
159 s_chtml20_end_ul_tag,
163 s_chtml20_start_li_tag,
164 s_chtml20_end_li_tag,
168 s_chtml20_start_ol_tag,
169 s_chtml20_end_ol_tag,
173 s_chtml20_start_h1_tag,
174 s_chtml20_end_h1_tag,
178 s_chtml20_start_h2_tag,
179 s_chtml20_end_h2_tag,
183 s_chtml20_start_h3_tag,
184 s_chtml20_end_h3_tag,
188 s_chtml20_start_h4_tag,
189 s_chtml20_end_h4_tag,
193 s_chtml20_start_h5_tag,
194 s_chtml20_end_h5_tag,
198 s_chtml20_start_h6_tag,
199 s_chtml20_end_h6_tag,
203 s_chtml20_start_head_tag,
204 s_chtml20_end_head_tag,
208 s_chtml20_start_title_tag,
209 s_chtml20_end_title_tag,
213 s_chtml20_start_base_tag,
214 s_chtml20_end_base_tag,
218 s_chtml20_start_body_tag,
219 s_chtml20_end_body_tag,
223 s_chtml20_start_a_tag,
228 s_chtml20_start_br_tag,
229 s_chtml20_end_br_tag,
238 s_chtml20_start_tr_tag,
239 s_chtml20_end_tr_tag,
253 s_chtml20_start_font_tag,
254 s_chtml20_end_font_tag,
258 s_chtml20_start_form_tag,
259 s_chtml20_end_form_tag,
263 s_chtml20_start_input_tag,
264 s_chtml20_end_input_tag,
268 s_chtml20_start_center_tag,
269 s_chtml20_end_center_tag,
273 s_chtml20_start_hr_tag,
274 s_chtml20_end_hr_tag,
278 s_chtml20_start_img_tag,
279 s_chtml20_end_img_tag,
283 s_chtml20_start_select_tag,
284 s_chtml20_end_select_tag,
288 s_chtml20_start_option_tag,
289 s_chtml20_end_option_tag,
293 s_chtml20_start_div_tag,
294 s_chtml20_end_div_tag,
298 s_chtml20_chxjif_tag,
343 s_chtml20_start_dt_tag,
344 s_chtml20_end_dt_tag,
358 s_chtml20_start_blockquote_tag,
359 s_chtml20_end_blockquote_tag,
363 s_chtml20_start_dir_tag,
364 s_chtml20_end_dir_tag,
368 s_chtml20_start_dl_tag,
369 s_chtml20_end_dl_tag,
373 s_chtml20_start_dd_tag,
374 s_chtml20_end_dd_tag,
378 s_chtml20_start_menu_tag,
379 s_chtml20_end_menu_tag,
383 s_chtml20_start_plaintext_tag,
384 s_chtml20_end_plaintext_tag,
388 s_chtml20_start_blink_tag,
389 s_chtml20_end_blink_tag,
393 s_chtml20_start_marquee_tag,
394 s_chtml20_end_marquee_tag,
399 * converts from CHTML5.0 to CHTML2.0.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_chtml20(
414 chxjconvrule_entry *entryp,
423 /*--------------------------------------------------------------------------*/
425 /*--------------------------------------------------------------------------*/
427 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
429 DBG(r,"i found qrcode xml");
432 DBG(r,"not found qrcode xml");
434 /*--------------------------------------------------------------------------*/
435 /* The CHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_chtml20(&chtml20, &doc, r, spec);
440 chtml20.entryp = entryp;
441 chtml20.cookie = cookie;
443 chxj_set_content_type(r, "text/html; charset=Windows-31J");
445 /*--------------------------------------------------------------------------*/
446 /* The character string of the input is analyzed. */
447 /*--------------------------------------------------------------------------*/
448 qs_init_malloc(&doc);
449 qs_init_root_node(&doc);
451 ss = apr_pcalloc(r->pool, srclen + 1);
452 memset(ss, 0, srclen + 1);
453 memcpy(ss, src, srclen);
456 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
459 qs_parse_string(&doc,ss, strlen(ss));
461 <<<<<<< HEAD:src/chxj_chtml20.c
462 if (! chxj_buffered_write_init(r->pool, &doc.buf)) {
463 ERR(r, "failed: chxj_buffered_write_init()");
464 DBG(r, "end chxj_convert_chtml20()");
465 return apr_pstrdup(r->pool, ss);
468 chxj_buffered_write_init(r->pool, &doc.buf);
469 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
470 /*--------------------------------------------------------------------------*/
471 /* It converts it from CHTML to CHTML. */
472 /*--------------------------------------------------------------------------*/
473 chxj_node_convert(spec,r,(void *)&chtml20, &doc, qs_get_root(&doc), 0);
474 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
475 dst = apr_pstrdup(r->pool, chtml20.out);
476 chxj_buffered_write_terminate(&doc.buf);
478 qs_all_free(&doc,QX_LOGMARK);
481 return apr_pstrdup(r->pool,ss);
484 if (strlen(dst) == 0) {
485 dst = apr_psprintf(r->pool, "\n");
488 *dstlen = strlen(dst);
491 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
498 * The CHTML structure is initialized.
500 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
501 * initialized is specified.
502 * @param doc [i] The Doc structure that should be set to the initialized
503 * HDML structure is specified.
504 * @param r [i] To use POOL, the pointer to request_rec is specified.
505 * @param spec [i] The pointer to the device_table
508 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
510 memset(doc, 0, sizeof(Doc));
511 memset(chtml20, 0, sizeof(chtml20_t));
515 chtml20->spec = spec;
516 <<<<<<< HEAD:src/chxj_chtml20.c
517 chtml20->out = qs_alloc_zero_byte_string(r);
519 chtml20->out = qs_alloc_zero_byte_string(r->pool);
520 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
521 chtml20->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
523 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
528 * Corresponding EMOJI to a current character-code is retrieved.
529 * The substitution character string is stored in the rslt pointer if agreeing.
531 * @param chtml20 [i] The pointer to the CHTML structure is specified.
532 * @param txt [i] The character string to want to examine whether it is
533 * EMOJI is specified.
534 * @param rslt [o] The pointer to the pointer that stores the result is
536 * @return When corresponding EMOJI exists, it returns it excluding 0.
539 s_chtml20_search_emoji(chtml20_t *chtml20, char *txt, char **rslt)
546 spec = chtml20->spec;
552 DBG(r,"spec is NULL");
554 for (ee = chtml20->conf->emoji;
558 if (ee->imode == NULL) {
559 DBG(r,"emoji->imode is NULL");
563 if (ee->imode->string != NULL
564 && strlen(ee->imode->string) > 0
565 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
566 if (spec == NULL || spec->emoji_type == NULL) {
567 *rslt = apr_palloc(r->pool, 3);
568 (*rslt)[0] = ee->imode->hex1byte & 0xff;
569 (*rslt)[1] = ee->imode->hex2byte & 0xff;
571 return strlen(ee->imode->string);
583 * It is a handler who processes the HTML tag.
585 * @param pdoc [i/o] The pointer to the CHTML structure at the output
586 * destination is specified.
587 * @param node [i] The HTML tag node is specified.
588 * @return The conversion result is returned.
591 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
597 chtml20 = GET_CHTML20(pdoc);
601 /*--------------------------------------------------------------------------*/
603 /*--------------------------------------------------------------------------*/
605 <<<<<<< HEAD:src/chxj_chtml20.c
608 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
614 * It is a handler who processes the HTML tag.
616 * @param pdoc [i/o] The pointer to the CHTML structure at the output
617 * destination is specified.
618 * @param node [i] The HTML tag node is specified.
619 * @return The conversion result is returned.
622 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
628 chtml20 = GET_CHTML20(pdoc);
633 <<<<<<< HEAD:src/chxj_chtml20.c
636 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
642 * It is a handler who processes the META tag.
644 * @param pdoc [i/o] The pointer to the CHTML structure at the output
645 * destination is specified.
646 * @param node [i] The META tag node is specified.
647 * @return The conversion result is returned.
650 s_chtml20_start_meta_tag(void *pdoc, Node *node)
656 int content_type_flag;
659 chtml20 = GET_CHTML20(pdoc);
663 content_type_flag = 0;
667 /*--------------------------------------------------------------------------*/
669 /*--------------------------------------------------------------------------*/
670 for (attr = qs_get_attr(doc,node);
672 attr = qs_get_next_attr(doc,attr)) {
673 char *name = qs_get_attr_name(doc,attr);
674 char *value = qs_get_attr_value(doc,attr);
678 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
679 /*----------------------------------------------------------------------*/
681 /*----------------------------------------------------------------------*/
682 W_L(" http-equiv=\"");
685 if (STRCASEEQ('c','C',"content-type", value)) {
686 content_type_flag = 1;
688 if (STRCASEEQ('r','R',"refresh", value)) {
696 if (strcasecmp(name, "content") == 0 && value && *value) {
697 if (content_type_flag) {
700 W_L("=\"text/html; charset=Windows-31J\"");
702 else if (refresh_flag) {
703 char *buf = apr_pstrdup(r->pool, value);
707 url = strchr(buf, ';');
709 sec = apr_pstrdup(r->pool, buf);
712 url = chxj_encoding_parameter(r, url);
713 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
745 * It is a handler who processes the META tag.
747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
748 * destination is specified.
749 * @param node [i] The META tag node is specified.
750 * @return The conversion result is returned.
753 s_chtml20_end_meta_tag(void *pdoc, Node *UNUSED(child))
755 chtml20_t *chtml20 = GET_CHTML20(pdoc);
762 * It is a handler who processes the HEAD tag.
764 * @param pdoc [i/o] The pointer to the CHTML structure at the output
765 * destination is specified.
766 * @param node [i] The HEAD tag node is specified.
767 * @return The conversion result is returned.
770 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
775 chtml20 = GET_CHTML20(pdoc);
779 <<<<<<< HEAD:src/chxj_chtml20.c
783 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
789 * It is a handler who processes the HEAD tag.
791 * @param pdoc [i/o] The pointer to the CHTML structure at the output
792 * destination is specified.
793 * @param node [i] The HEAD tag node is specified.
794 * @return The conversion result is returned.
797 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
803 chtml20 = GET_CHTML20(pdoc);
808 <<<<<<< HEAD:src/chxj_chtml20.c
812 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
818 * It is a handler who processes the TITLE tag.
820 * @param pdoc [i/o] The pointer to the CHTML structure at the output
821 * destination is specified.
822 * @param node [i] The TITLE tag node is specified.
823 * @return The conversion result is returned.
826 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
832 chtml20 = GET_CHTML20(pdoc);
844 * It is a handler who processes the TITLE tag.
846 * @param pdoc [i/o] The pointer to the CHTML structure at the output
847 * destination is specified.
848 * @param node [i] The TITLE tag node is specified.
849 * @return The conversion result is returned.
852 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
858 chtml20 = GET_CHTML20(pdoc);
863 <<<<<<< HEAD:src/chxj_chtml20.c
867 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
873 * It is a handler who processes the BASE tag.
875 * @param pdoc [i/o] The pointer to the CHTML structure at the output
876 * destination is specified.
877 * @param node [i] The BASE tag node is specified.
878 * @return The conversion result is returned.
881 s_chtml20_start_base_tag(void *pdoc, Node *node)
888 chtml20 = GET_CHTML20(pdoc);
893 /*--------------------------------------------------------------------------*/
895 /*--------------------------------------------------------------------------*/
896 for (attr = qs_get_attr(doc,node);
898 attr = qs_get_next_attr(doc,attr)) {
899 char *name = qs_get_attr_name(doc,attr);
900 char *value = qs_get_attr_value(doc,attr);
901 <<<<<<< HEAD:src/chxj_chtml20.c
902 if (STRCASEEQ('h','H',"href",name)) {
904 if (STRCASEEQ('h','H',"href", name)) {
905 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
912 <<<<<<< HEAD:src/chxj_chtml20.c
916 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
922 * It is a handler who processes the BASE tag.
924 * @param pdoc [i/o] The pointer to the CHTML structure at the output
925 * destination is specified.
926 * @param node [i] The BASE tag node is specified.
927 * @return The conversion result is returned.
930 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
936 chtml20 = GET_CHTML20(pdoc);
945 * It is a handler who processes the BODY tag.
947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
948 * destination is specified.
949 * @param node [i] The BODY tag node is specified.
950 * @return The conversion result is returned.
953 s_chtml20_start_body_tag(void *pdoc, Node *node)
960 chtml20 = GET_CHTML20(pdoc);
965 /*--------------------------------------------------------------------------*/
967 /*--------------------------------------------------------------------------*/
968 for (attr = qs_get_attr(doc,node);
970 attr = qs_get_next_attr(doc,attr)) {
971 char *name = qs_get_attr_name(doc,attr);
972 char *value = qs_get_attr_value(doc,attr);
976 if (strcasecmp(name, "bgcolor") == 0 && value && *value != 0) {
977 /*----------------------------------------------------------------------*/
979 /*----------------------------------------------------------------------*/
988 if (strcasecmp(name, "text") == 0 && value && *value != 0) {
989 /*----------------------------------------------------------------------*/
991 /*----------------------------------------------------------------------*/
1000 if (strcasecmp(name, "link") == 0 && value && *value != 0) {
1001 /*----------------------------------------------------------------------*/
1003 /*----------------------------------------------------------------------*/
1012 if (strcasecmp(name, "alink") == 0) {
1013 /*----------------------------------------------------------------------*/
1015 /*----------------------------------------------------------------------*/
1022 if (strcasecmp(name, "vlink") == 0) {
1023 /*----------------------------------------------------------------------*/
1025 /*----------------------------------------------------------------------*/
1035 <<<<<<< HEAD:src/chxj_chtml20.c
1039 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1040 return chtml20->out;
1045 * It is a handler who processes the BODY tag.
1047 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1048 * destination is specified.
1049 * @param node [i] The BODY tag node is specified.
1050 * @return The conversion result is returned.
1053 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
1059 chtml20 = GET_CHTML20(pdoc);
1064 <<<<<<< HEAD:src/chxj_chtml20.c
1068 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1069 return chtml20->out;
1074 * It is a handler who processes the A tag.
1076 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1077 * destination is specified.
1078 * @param node [i] The A tag node is specified.
1079 * @return The conversion result is returned.
1082 s_chtml20_start_a_tag(void *pdoc, Node *node)
1089 chtml20 = GET_CHTML20(pdoc);
1094 /*--------------------------------------------------------------------------*/
1095 /* Get Attributes */
1096 /*--------------------------------------------------------------------------*/
1097 for (attr = qs_get_attr(doc,node);
1099 attr = qs_get_next_attr(doc,attr)) {
1100 char *name = qs_get_attr_name(doc,attr);
1101 char *value = qs_get_attr_value(doc,attr);
1105 if (strcasecmp(name, "name") == 0) {
1106 /*--------------------------------------------------------------------*/
1108 /*--------------------------------------------------------------------*/
1117 if (strcasecmp(name, "href") == 0) {
1118 /*--------------------------------------------------------------------*/
1120 /*--------------------------------------------------------------------*/
1121 value = chxj_encoding_parameter(r, value);
1122 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1131 if (strcasecmp(name, "accesskey") == 0) {
1132 /*--------------------------------------------------------------------*/
1134 /*--------------------------------------------------------------------*/
1135 W_L(" accesskey=\"");
1143 if (strcasecmp(name, "cti") == 0) {
1144 /*--------------------------------------------------------------------*/
1146 /*--------------------------------------------------------------------*/
1155 if (strcasecmp(name, "ijam") == 0) {
1156 /*--------------------------------------------------------------------*/
1158 /*--------------------------------------------------------------------*/
1162 if (strcasecmp(name, "ista") == 0) {
1163 /*--------------------------------------------------------------------*/
1165 /*--------------------------------------------------------------------*/
1169 if (strcasecmp(name, "ilet") == 0) {
1170 /*--------------------------------------------------------------------*/
1172 /*--------------------------------------------------------------------*/
1176 if (strcasecmp(name, "iswf") == 0) {
1177 /*--------------------------------------------------------------------*/
1179 /*--------------------------------------------------------------------*/
1183 if (strcasecmp(name, "irst") == 0) {
1184 /*--------------------------------------------------------------------*/
1186 /*--------------------------------------------------------------------*/
1193 if (strcasecmp(name, "utn") == 0) {
1194 /*--------------------------------------------------------------------*/
1196 /*--------------------------------------------------------------------*/
1203 if (strcasecmp(name, "telbook") == 0) {
1204 /*--------------------------------------------------------------------*/
1206 /*--------------------------------------------------------------------*/
1213 if (strcasecmp(name, "kana") == 0) {
1214 /*--------------------------------------------------------------------*/
1216 /*--------------------------------------------------------------------*/
1223 if (strcasecmp(name, "email") == 0) {
1224 /*--------------------------------------------------------------------*/
1226 /*--------------------------------------------------------------------*/
1236 return chtml20->out;
1241 * It is a handler who processes the A tag.
1243 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1244 * destination is specified.
1245 * @param node [i] The A tag node is specified.
1246 * @return The conversion result is returned.
1249 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1255 chtml20 = GET_CHTML20(pdoc);
1262 return chtml20->out;
1267 * It is a handler who processes the BR tag.
1269 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1270 * destination is specified.
1271 * @param node [i] The BR tag node is specified.
1272 * @return The conversion result is returned.
1275 s_chtml20_start_br_tag(void *pdoc, Node *node)
1277 <<<<<<< HEAD:src/chxj_chtml20.c
1287 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1289 chtml20 = GET_CHTML20(pdoc);
1294 /*--------------------------------------------------------------------------*/
1295 /* Get Attributes */
1296 /*--------------------------------------------------------------------------*/
1297 for (attr = qs_get_attr(doc,node);
1299 attr = qs_get_next_attr(doc,attr)) {
1300 <<<<<<< HEAD:src/chxj_chtml20.c
1304 name = qs_get_attr_name(doc,attr);
1305 value = qs_get_attr_value(doc,attr);
1308 char *name = qs_get_attr_name(doc,attr);
1309 char *value = qs_get_attr_value(doc,attr);
1310 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1311 if (STRCASEEQ('c','C',"clear",name)) {
1312 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1320 <<<<<<< HEAD:src/chxj_chtml20.c
1324 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1325 return chtml20->out;
1330 * It is a handler who processes the BR tag.
1332 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1333 * destination is specified.
1334 * @param node [i] The BR tag node is specified.
1335 * @return The conversion result is returned.
1338 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1344 chtml20 = GET_CHTML20(pdoc);
1348 return chtml20->out;
1353 * It is a handler who processes the TR tag.
1355 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1356 * destination is specified.
1357 * @param node [i] The TR tag node is specified.
1358 * @return The conversion result is returned.
1361 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1367 chtml20 = GET_CHTML20(pdoc);
1371 return chtml20->out;
1376 * It is a handler who processes the TR tag.
1378 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1379 * destination is specified.
1380 * @param node [i] The TR tag node is specified.
1381 * @return The conversion result is returned.
1384 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1390 chtml20 = GET_CHTML20(pdoc);
1395 <<<<<<< HEAD:src/chxj_chtml20.c
1399 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1400 return chtml20->out;
1405 * It is a handler who processes the FONT tag.
1407 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1408 * destination is specified.
1409 * @param node [i] The FONT tag node is specified.
1410 * @return The conversion result is returned.
1413 s_chtml20_start_font_tag(void *pdoc, Node *node)
1421 chtml20 = GET_CHTML20(pdoc);
1426 /*--------------------------------------------------------------------------*/
1427 /* Get Attributes */
1428 /*--------------------------------------------------------------------------*/
1429 for (attr = qs_get_attr(doc,node);
1430 attr && color == NULL;
1431 attr = qs_get_next_attr(doc,attr)) {
1432 char *name = qs_get_attr_name(doc,attr);
1433 char *value = qs_get_attr_value(doc,attr);
1437 if (strcasecmp(name, "color") == 0 && value && *value) {
1438 color = apr_pstrdup(doc->buf.pool, value);
1444 if (strcasecmp(name, "size") == 0) {
1445 /*--------------------------------------------------------------------*/
1447 /*--------------------------------------------------------------------*/
1457 W_L("<font color=\"");
1460 chtml20->font_flag++;
1462 return chtml20->out;
1467 * It is a handler who processes the FONT tag.
1469 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1470 * destination is specified.
1471 * @param node [i] The FONT tag node is specified.
1472 * @return The conversion result is returned.
1475 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1481 chtml20 = GET_CHTML20(pdoc);
1485 if (chtml20->font_flag) {
1487 chtml20->font_flag--;
1489 return chtml20->out;
1494 * It is a handler who processes the FORM tag.
1496 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1497 * destination is specified.
1498 * @param node [i] The FORM tag node is specified.
1499 * @return The conversion result is returned.
1502 s_chtml20_start_form_tag(void *pdoc, Node *node)
1509 chtml20 = GET_CHTML20(pdoc);
1514 /*--------------------------------------------------------------------------*/
1515 /* Get Attributes */
1516 /*--------------------------------------------------------------------------*/
1517 for (attr = qs_get_attr(doc,node);
1519 attr = qs_get_next_attr(doc,attr)) {
1520 char *name = qs_get_attr_name(doc,attr);
1521 char *value = qs_get_attr_value(doc,attr);
1525 if (strcasecmp(name, "action") == 0) {
1526 /*--------------------------------------------------------------------*/
1528 /*--------------------------------------------------------------------*/
1529 value = chxj_encoding_parameter(r, value);
1530 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1540 if (strcasecmp(name, "method") == 0) {
1541 /*--------------------------------------------------------------------*/
1543 /*--------------------------------------------------------------------*/
1552 if (strcasecmp(name, "utn") == 0) {
1553 /*--------------------------------------------------------------------*/
1555 /*--------------------------------------------------------------------*/
1567 return chtml20->out;
1572 * It is a handler who processes the FORM tag.
1574 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1575 * destination is specified.
1576 * @param node [i] The FORM tag node is specified.
1577 * @return The conversion result is returned.
1580 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1586 chtml20 = GET_CHTML20(pdoc);
1593 return chtml20->out;
1598 * It is a handler who processes the INPUT tag.
1600 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1601 * destination is specified.
1602 * @param node [i] The INPUT tag node is specified.
1603 * @return The conversion result is returned.
1606 s_chtml20_start_input_tag(void *pdoc, Node *node)
1611 char *max_length = NULL;
1615 char *istyle = NULL;
1617 char *checked = NULL;
1618 char *accesskey = NULL;
1620 chtml20 = GET_CHTML20(pdoc);
1626 /*--------------------------------------------------------------------------*/
1627 /* Get Attributes */
1628 /*--------------------------------------------------------------------------*/
1629 type = qs_get_type_attr(doc, node, doc->buf.pool);
1630 name = qs_get_name_attr(doc, node, doc->buf.pool);
1631 value = qs_get_value_attr(doc,node,doc->buf.pool);
1632 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1633 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1634 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1635 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1636 size = qs_get_size_attr(doc, node, doc->buf.pool);
1639 type = qs_trim_string(doc->buf.pool, type);
1640 if (type && (STRCASEEQ('t','T',"text", type) ||
1641 STRCASEEQ('p','P',"password",type) ||
1642 STRCASEEQ('c','C',"checkbox",type) ||
1643 STRCASEEQ('r','R',"radio", type) ||
1644 STRCASEEQ('h','H',"hidden", type) ||
1645 STRCASEEQ('s','S',"submit", type) ||
1646 STRCASEEQ('r','R',"reset", type))) {
1652 if (size && *size) {
1657 if (name && *name) {
1662 if (value && *value) {
1667 if (accesskey && *accesskey) {
1668 W_L(" accesskey=\"");
1673 /*------------------------------------------------------------------------*/
1675 /*------------------------------------------------------------------------*/
1676 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1682 /*--------------------------------------------------------------------------*/
1683 /* The figure is default for the password. */
1684 /*--------------------------------------------------------------------------*/
1685 if (max_length && *max_length) {
1686 if (chxj_chk_numeric(max_length) != 0) {
1687 max_length = apr_psprintf(doc->buf.pool, "0");
1689 if (istyle && *istyle == '1') {
1690 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1694 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1702 <<<<<<< HEAD:src/chxj_chtml20.c
1706 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1707 return chtml20->out;
1712 * It is a handler who processes the INPUT tag.
1714 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1715 * destination is specified.
1716 * @param node [i] The INPUT tag node is specified.
1717 * @return The conversion result is returned.
1720 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1726 chtml20 = GET_CHTML20(pdoc);
1730 return chtml20->out;
1735 * It is a handler who processes the CENTER tag.
1737 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1738 * destination is specified.
1739 * @param node [i] The CENTER tag node is specified.
1740 * @return The conversion result is returned.
1743 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1749 chtml20 = GET_CHTML20(pdoc);
1754 return chtml20->out;
1759 * It is a handler who processes the CENTER tag.
1761 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1762 * destination is specified.
1763 * @param node [i] The CENTER tag node is specified.
1764 * @return The conversion result is returned.
1767 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1773 chtml20 = GET_CHTML20(pdoc);
1780 return chtml20->out;
1785 * It is a handler who processes the UL tag.
1787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1788 * destination is specified.
1789 * @param node [i] The UL tag node is specified.
1790 * @return The conversion result is returned.
1793 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1799 chtml20 = GET_CHTML20(pdoc);
1806 return chtml20->out;
1811 * It is a handler who processes the UL tag.
1813 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1814 * destination is specified.
1815 * @param node [i] The UL tag node is specified.
1816 * @return The conversion result is returned.
1819 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1825 chtml20 = GET_CHTML20(pdoc);
1832 return chtml20->out;
1837 * It is a handler who processes the OL tag.
1839 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1840 * destination is specified.
1841 * @param node [i] The OL tag node is specified.
1842 * @return The conversion result is returned.
1845 s_chtml20_start_ol_tag(void *pdoc, Node *node)
1847 <<<<<<< HEAD:src/chxj_chtml20.c
1857 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1859 chtml20 = GET_CHTML20(pdoc);
1864 /*--------------------------------------------------------------------------*/
1865 /* Get Attributes */
1866 /*--------------------------------------------------------------------------*/
1867 for (attr = qs_get_attr(doc,node);
1869 attr = qs_get_next_attr(doc,attr)) {
1870 char *name = qs_get_attr_name(doc,attr);
1871 char *value = qs_get_attr_value(doc,attr);
1872 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1877 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1884 <<<<<<< HEAD:src/chxj_chtml20.c
1888 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1889 return chtml20->out;
1894 * It is a handler who processes the OL tag.
1896 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1897 * destination is specified.
1898 * @param node [i] The OL tag node is specified.
1899 * @return The conversion result is returned.
1902 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1908 chtml20 = GET_CHTML20(pdoc);
1915 return chtml20->out;
1920 * It is a handler who processes the LI tag.
1922 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1923 * destination is specified.
1924 * @param node [i] The LI tag node is specified.
1925 * @return The conversion result is returned.
1928 s_chtml20_start_li_tag(void *pdoc, Node *node)
1930 <<<<<<< HEAD:src/chxj_chtml20.c
1940 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
1942 chtml20 = GET_CHTML20(pdoc);
1947 /*--------------------------------------------------------------------------*/
1948 /* Get Attributes */
1949 /*--------------------------------------------------------------------------*/
1950 for (attr = qs_get_attr(doc,node);
1952 attr = qs_get_next_attr(doc,attr)) {
1953 char *name = qs_get_attr_name(doc,attr);
1954 char *value = qs_get_attr_value(doc,attr);
1955 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1960 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1967 return chtml20->out;
1972 * It is a handler who processes the LI tag.
1974 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1975 * destination is specified.
1976 * @param node [i] The LI tag node is specified.
1977 * @return The conversion result is returned.
1980 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1982 chtml20_t *chtml20 = GET_CHTML20(pdoc);
1983 return chtml20->out;
1988 * It is a handler who processes the HR tag.
1990 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1991 * destination is specified.
1992 * @param node [i] The HR tag node is specified.
1993 * @return The conversion result is returned.
1996 s_chtml20_start_hr_tag(void *pdoc, Node *node)
2003 chtml20 = GET_CHTML20(pdoc);
2007 <<<<<<< HEAD:src/chxj_chtml20.c
2010 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2012 for (attr = qs_get_attr(doc,node);
2014 attr = qs_get_next_attr(doc,attr)) {
2015 <<<<<<< HEAD:src/chxj_chtml20.c
2019 name = qs_get_attr_name(doc,attr);
2020 value = qs_get_attr_value(doc,attr);
2023 char *name = qs_get_attr_name(doc,attr);
2024 char *value = qs_get_attr_value(doc,attr);
2025 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2029 if (strcasecmp(name, "align") == 0) {
2030 /*--------------------------------------------------------------------*/
2032 /*--------------------------------------------------------------------*/
2033 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2043 if (strcasecmp(name, "size") == 0) {
2044 /*--------------------------------------------------------------------*/
2046 /*--------------------------------------------------------------------*/
2047 if (value && value[0] != '\0') {
2057 if (strcasecmp(name, "width") == 0) {
2058 /*--------------------------------------------------------------------*/
2060 /*--------------------------------------------------------------------*/
2061 if (value && value[0] != '\0') {
2071 if (strcasecmp(name, "noshade") == 0) {
2072 /*--------------------------------------------------------------------*/
2074 /*--------------------------------------------------------------------*/
2081 if (strcasecmp(name, "color") == 0) {
2082 /*--------------------------------------------------------------------*/
2084 /*--------------------------------------------------------------------*/
2094 <<<<<<< HEAD:src/chxj_chtml20.c
2097 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2098 return chtml20->out;
2103 * It is a handler who processes the HR tag.
2105 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2106 * destination is specified.
2107 * @param node [i] The HR tag node is specified.
2108 * @return The conversion result is returned.
2111 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
2113 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2114 return chtml20->out;
2119 * It is a handler who processes the IMG tag.
2121 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2122 * destination is specified.
2123 * @param node [i] The IMG tag node is specified.
2124 * @return The conversion result is returned.
2127 s_chtml20_start_img_tag(void *pdoc, Node *node)
2133 #ifndef IMG_NOT_CONVERT_FILENAME
2137 chtml20 = GET_CHTML20(pdoc);
2141 #ifndef IMG_NOT_CONVERT_FILENAME
2142 spec = chtml20->spec;
2146 /*-------------------------------------------------------------------------*/
2147 /* Get Attributes */
2148 /*-------------------------------------------------------------------------*/
2149 for (attr = qs_get_attr(doc,node);
2151 attr = qs_get_next_attr(doc,attr)) {
2152 char *name = qs_get_attr_name(doc,attr);
2153 char *value = qs_get_attr_value(doc,attr);
2157 if (strcasecmp(name, "src") == 0) {
2158 /*-------------------------------------------------------------------*/
2160 /*-------------------------------------------------------------------*/
2161 #ifdef IMG_NOT_CONVERT_FILENAME
2162 value = chxj_encoding_parameter(r, value);
2163 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2165 value = apr_psprintf(doc->buf.pool,
2168 (strchr(value, '?')) ? '&' : '?',
2169 CHXJ_COOKIE_NOUPDATE_PARAM);
2175 value = chxj_img_conv(r, spec, value);
2176 value = chxj_encoding_parameter(r, value);
2177 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
2179 value = apr_psprintf(doc->buf.pool,
2182 (strchr(value, '?')) ? '&' : '?',
2183 CHXJ_COOKIE_NOUPDATE_PARAM);
2194 if (strcasecmp(name, "align" ) == 0) {
2195 /*--------------------------------------------------------------------*/
2197 /*--------------------------------------------------------------------*/
2198 <<<<<<< HEAD:src/chxj_chtml20.c
2199 if (value && (STRCASEEQ('t','T',"top", value) ||
2200 STRCASEEQ('m','M',"middle",value) ||
2201 STRCASEEQ('b','B',"bottom",value) ||
2202 STRCASEEQ('l','L',"left", value) ||
2203 STRCASEEQ('r','R',"right", value))) {
2209 if (STRCASEEQ('t','T',"top", value) ||
2210 STRCASEEQ('m','M',"middle",value) ||
2211 STRCASEEQ('b','B',"bottom",value) ||
2212 STRCASEEQ('l','L',"left", value) ||
2213 STRCASEEQ('r','R',"right", value)) {
2218 else if (STRCASEEQ('c','C',"center", value)) {
2223 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2226 else if (strcasecmp(name, "alt" ) == 0 && value && *value) {
2227 /*--------------------------------------------------------------------*/
2229 /*--------------------------------------------------------------------*/
2238 if (strcasecmp(name, "width" ) == 0 && value && *value) {
2239 /*--------------------------------------------------------------------*/
2241 /*--------------------------------------------------------------------*/
2250 if (strcasecmp(name, "height") == 0 && value && *value) {
2251 /*--------------------------------------------------------------------*/
2253 /*--------------------------------------------------------------------*/
2258 else if (strcasecmp(name, "hspace") == 0 && value && *value) {
2259 /*--------------------------------------------------------------------*/
2261 /*--------------------------------------------------------------------*/
2270 if (strcasecmp(name, "vspace") == 0 && value && *value) {
2271 /*--------------------------------------------------------------------*/
2273 /*--------------------------------------------------------------------*/
2286 return chtml20->out;
2291 * It is a handler who processes the IMG tag.
2293 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2294 * destination is specified.
2295 * @param node [i] The IMG tag node is specified.
2296 * @return The conversion result is returned.
2299 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2301 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2303 return chtml20->out;
2308 * It is a handler who processes the SELECT tag.
2310 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2311 * destination is specified.
2312 * @param node [i] The SELECT tag node is specified.
2313 * @return The conversion result is returned.
2316 s_chtml20_start_select_tag(void *pdoc, Node *child)
2323 chtml20 = GET_CHTML20(pdoc);
2329 char *multiple = NULL;
2332 for (attr = qs_get_attr(doc,child);
2334 attr = qs_get_next_attr(doc,attr)) {
2335 char *nm = qs_get_attr_name(doc,attr);
2336 char *val = qs_get_attr_value(doc,attr);
2340 if (strcasecmp(nm, "size") == 0) {
2341 /*--------------------------------------------------------------------*/
2342 /* CHTML 1.0 version 2.0 */
2343 /*--------------------------------------------------------------------*/
2344 size = apr_pstrdup(doc->buf.pool, val);
2350 if (strcasecmp(nm, "name") == 0) {
2351 /*--------------------------------------------------------------------*/
2352 /* CHTML 1.0 version 2.0 */
2353 /*--------------------------------------------------------------------*/
2354 name = apr_pstrdup(doc->buf.pool, val);
2360 if (strcasecmp(nm, "multiple") == 0) {
2361 /*--------------------------------------------------------------------*/
2362 /* CHTML 1.0 version 2.0 */
2363 /*--------------------------------------------------------------------*/
2364 multiple = apr_pstrdup(doc->buf.pool, val);
2372 if (size && *size) {
2377 if (name && *name) {
2386 <<<<<<< HEAD:src/chxj_chtml20.c
2389 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2390 return chtml20->out;
2395 * It is a handler who processes the SELECT tag.
2397 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2398 * destination is specified.
2399 * @param node [i] The SELECT tag node is specified.
2400 * @return The conversion result is returned.
2403 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2408 chtml20 = GET_CHTML20(pdoc);
2412 <<<<<<< HEAD:src/chxj_chtml20.c
2415 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2416 return chtml20->out;
2421 * It is a handler who processes the OPTION tag.
2423 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2424 * destination is specified.
2425 * @param node [i] The OPTION tag node is specified.
2426 * @return The conversion result is returned.
2429 s_chtml20_start_option_tag(void *pdoc, Node *child)
2436 chtml20 = GET_CHTML20(pdoc);
2440 char *selected = NULL;
2444 for (attr = qs_get_attr(doc,child);
2446 attr = qs_get_next_attr(doc,attr)) {
2447 char *nm = qs_get_attr_name(doc,attr);
2448 char *val = qs_get_attr_value(doc,attr);
2452 if (strcasecmp(nm, "selected") == 0) {
2453 /*--------------------------------------------------------------------*/
2454 /* CHTML 1.0 version 2.0 */
2455 /*--------------------------------------------------------------------*/
2456 selected = apr_pstrdup(doc->buf.pool, val);
2462 if (strcasecmp(nm, "value") == 0) {
2463 /*--------------------------------------------------------------------*/
2464 /* CHTML 1.0 version 2.0 */
2465 /*--------------------------------------------------------------------*/
2466 value = apr_pstrdup(doc->buf.pool, val);
2475 if (value && *value) {
2485 return chtml20->out;
2490 * It is a handler who processes the OPTION tag.
2492 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2493 * destination is specified.
2494 * @param node [i] The OPTION tag node is specified.
2495 * @return The conversion result is returned.
2498 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2500 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2504 return chtml20->out;
2509 * It is a handler who processes the DIV tag.
2511 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2512 * destination is specified.
2513 * @param node [i] The DIV tag node is specified.
2514 * @return The conversion result is returned.
2517 s_chtml20_start_div_tag(void *pdoc, Node *child)
2524 chtml20 = GET_CHTML20(pdoc);
2532 for (attr = qs_get_attr(doc,child);
2534 attr = qs_get_next_attr(doc,attr)) {
2535 <<<<<<< HEAD:src/chxj_chtml20.c
2540 nm = qs_get_attr_name(doc,attr);
2541 val = qs_get_attr_value(doc,attr);
2544 char *nm = qs_get_attr_name(doc,attr);
2545 char *val = qs_get_attr_value(doc,attr);
2546 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2547 if (STRCASEEQ('a','A', "align", nm)) {
2548 /*----------------------------------------------------------------------*/
2549 /* CHTML 1.0 (W3C version 3.2) */
2550 /*----------------------------------------------------------------------*/
2551 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2552 align = apr_pstrdup(doc->buf.pool, val);
2562 return chtml20->out;
2567 * It is a handler who processes the DIV tag.
2569 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2570 * destination is specified.
2571 * @param node [i] The DIV tag node is specified.
2572 * @return The conversion result is returned.
2575 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2577 <<<<<<< HEAD:src/chxj_chtml20.c
2582 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2583 Doc *doc = chtml20->doc;
2584 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2586 <<<<<<< HEAD:src/chxj_chtml20.c
2587 chtml20 = GET_CHTML20(pdoc);
2592 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2594 <<<<<<< HEAD:src/chxj_chtml20.c
2597 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2598 return chtml20->out;
2603 * It is a handler who processes the H1 tag.
2605 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2606 * destination is specified.
2607 * @param node [i] The H1 tag node is specified.
2608 * @return The conversion result is returned.
2611 s_chtml20_start_h1_tag(void *pdoc, Node *node)
2613 <<<<<<< HEAD:src/chxj_chtml20.c
2623 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2625 chtml20 = GET_CHTML20(pdoc);
2630 for (attr = qs_get_attr(doc,node);
2632 attr = qs_get_next_attr(doc,attr)) {
2633 <<<<<<< HEAD:src/chxj_chtml20.c
2636 name = qs_get_attr_name(doc,attr);
2637 value = qs_get_attr_value(doc,attr);
2639 char *name = qs_get_attr_name(doc,attr);
2640 char *value = qs_get_attr_value(doc,attr);
2641 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2642 if (STRCASEEQ('a','A',"align", name)) {
2643 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2652 return chtml20->out;
2657 * It is a handler who processes the H1 tag.
2659 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2660 * destination is specified.
2661 * @param node [i] The H1 tag node is specified.
2662 * @return The conversion result is returned.
2665 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2670 chtml20 = GET_CHTML20(pdoc);
2674 <<<<<<< HEAD:src/chxj_chtml20.c
2677 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2678 return chtml20->out;
2683 * It is a handler who processes the H2 tag.
2685 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2686 * destination is specified.
2687 * @param node [i] The H2 tag node is specified.
2688 * @return The conversion result is returned.
2691 s_chtml20_start_h2_tag(void *pdoc, Node *node)
2696 <<<<<<< HEAD:src/chxj_chtml20.c
2700 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2702 chtml20 = GET_CHTML20(pdoc);
2707 for (attr = qs_get_attr(doc,node);
2709 attr = qs_get_next_attr(doc,attr)) {
2710 <<<<<<< HEAD:src/chxj_chtml20.c
2713 name = qs_get_attr_name(doc,attr);
2714 value = qs_get_attr_value(doc,attr);
2716 char *name = qs_get_attr_name(doc,attr);
2717 char *value = qs_get_attr_value(doc,attr);
2718 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2719 if (STRCASEEQ('a','A',"align", name)) {
2720 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2729 return chtml20->out;
2734 * It is a handler who processes the H2 tag.
2736 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2737 * destination is specified.
2738 * @param node [i] The H2 tag node is specified.
2739 * @return The conversion result is returned.
2742 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2744 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2745 Doc *doc = chtml20->doc;
2750 <<<<<<< HEAD:src/chxj_chtml20.c
2753 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2754 return chtml20->out;
2759 * It is a handler who processes the H3 tag.
2761 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2762 * destination is specified.
2763 * @param node [i] The H3 tag node is specified.
2764 * @return The conversion result is returned.
2767 s_chtml20_start_h3_tag(void *pdoc, Node *node)
2769 <<<<<<< HEAD:src/chxj_chtml20.c
2779 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2781 chtml20 = GET_CHTML20(pdoc);
2786 for (attr = qs_get_attr(doc,node);
2788 attr = qs_get_next_attr(doc,attr)) {
2789 <<<<<<< HEAD:src/chxj_chtml20.c
2792 name = qs_get_attr_name(doc,attr);
2793 value = qs_get_attr_value(doc,attr);
2795 char *name = qs_get_attr_name(doc,attr);
2796 char *value = qs_get_attr_value(doc,attr);
2797 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2798 if (STRCASEEQ('a','A',"align", name)) {
2799 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2808 return chtml20->out;
2813 * It is a handler who processes the H3 tag.
2815 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2816 * destination is specified.
2817 * @param node [i] The H3 tag node is specified.
2818 * @return The conversion result is returned.
2821 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2823 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2824 Doc *doc = chtml20->doc;
2827 <<<<<<< HEAD:src/chxj_chtml20.c
2830 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2831 return chtml20->out;
2836 * It is a handler who processes the H4 tag.
2838 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2839 * destination is specified.
2840 * @param node [i] The H4 tag node is specified.
2841 * @return The conversion result is returned.
2844 s_chtml20_start_h4_tag(void *pdoc, Node *node)
2846 <<<<<<< HEAD:src/chxj_chtml20.c
2856 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2858 chtml20 = GET_CHTML20(pdoc);
2863 for (attr = qs_get_attr(doc,node);
2865 attr = qs_get_next_attr(doc,attr)) {
2866 <<<<<<< HEAD:src/chxj_chtml20.c
2869 name = qs_get_attr_name(doc,attr);
2870 value = qs_get_attr_value(doc,attr);
2872 char *name = qs_get_attr_name(doc,attr);
2873 char *value = qs_get_attr_value(doc,attr);
2874 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2875 if (STRCASEEQ('a','A',"align", name)) {
2876 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2885 return chtml20->out;
2890 * It is a handler who processes the H4 tag.
2892 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2893 * destination is specified.
2894 * @param node [i] The H4 tag node is specified.
2895 * @return The conversion result is returned.
2898 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2900 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2901 Doc *doc = chtml20->doc;
2904 <<<<<<< HEAD:src/chxj_chtml20.c
2907 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2908 return chtml20->out;
2913 * It is a handler who processes the H5 tag.
2915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2916 * destination is specified.
2917 * @param node [i] The H5 tag node is specified.
2918 * @return The conversion result is returned.
2921 s_chtml20_start_h5_tag(void *pdoc, Node *node)
2923 <<<<<<< HEAD:src/chxj_chtml20.c
2933 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2935 chtml20 = GET_CHTML20(pdoc);
2940 for (attr = qs_get_attr(doc,node);
2942 attr = qs_get_next_attr(doc,attr)) {
2943 <<<<<<< HEAD:src/chxj_chtml20.c
2946 name = qs_get_attr_name(doc,attr);
2947 value = qs_get_attr_value(doc,attr);
2949 char *name = qs_get_attr_name(doc,attr);
2950 char *value = qs_get_attr_value(doc,attr);
2951 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2952 if (STRCASEEQ('a','A',"align", name)) {
2953 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2962 return chtml20->out;
2967 * It is a handler who processes the H5 tag.
2969 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2970 * destination is specified.
2971 * @param node [i] The H5 tag node is specified.
2972 * @return The conversion result is returned.
2975 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2977 chtml20_t *chtml20 = GET_CHTML20(pdoc);
2978 Doc *doc = chtml20->doc;
2981 <<<<<<< HEAD:src/chxj_chtml20.c
2984 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
2985 return chtml20->out;
2990 * It is a handler who processes the H6 tag.
2992 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2993 * destination is specified.
2994 * @param node [i] The H6 tag node is specified.
2995 * @return The conversion result is returned.
2998 s_chtml20_start_h6_tag(void *pdoc, Node *node)
3000 <<<<<<< HEAD:src/chxj_chtml20.c
3010 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3012 chtml20 = GET_CHTML20(pdoc);
3017 for (attr = qs_get_attr(doc,node);
3019 attr = qs_get_next_attr(doc,attr)) {
3020 <<<<<<< HEAD:src/chxj_chtml20.c
3023 name = qs_get_attr_name(doc,attr);
3024 value = qs_get_attr_value(doc,attr);
3026 char *name = qs_get_attr_name(doc,attr);
3027 char *value = qs_get_attr_value(doc,attr);
3028 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3029 if (STRCASEEQ('a','A',"align", name)) {
3030 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3039 return chtml20->out;
3044 * It is a handler who processes the H6 tag.
3046 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3047 * destination is specified.
3048 * @param node [i] The H6 tag node is specified.
3049 * @return The conversion result is returned.
3052 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
3054 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3055 Doc *doc = chtml20->doc;
3057 <<<<<<< HEAD:src/chxj_chtml20.c
3058 chtml20 = GET_CHTML20(pdoc);
3063 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3065 <<<<<<< HEAD:src/chxj_chtml20.c
3068 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3069 return chtml20->out;
3074 * It is a handler who processes the PRE tag.
3076 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3077 * destination is specified.
3078 * @param node [i] The PRE tag node is specified.
3079 * @return The conversion result is returned.
3082 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
3084 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3085 Doc *doc = chtml20->doc;
3087 chtml20->pre_flag++;
3090 return chtml20->out;
3095 * It is a handler who processes the PRE tag.
3097 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3098 * destination is specified.
3099 * @param node [i] The PRE tag node is specified.
3100 * @return The conversion result is returned.
3103 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
3105 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3106 Doc *doc = chtml20->doc;
3110 chtml20->pre_flag--;
3112 return chtml20->out;
3117 * It is a handler who processes the P tag.
3119 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3120 * destination is specified.
3121 * @param node [i] The P tag node is specified.
3122 * @return The conversion result is returned.
3125 s_chtml20_start_p_tag(void *pdoc, Node *node)
3127 <<<<<<< HEAD:src/chxj_chtml20.c
3139 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3141 chtml20 = GET_CHTML20(pdoc);
3146 for (attr = qs_get_attr(doc,node);
3148 attr = qs_get_next_attr(doc,attr)) {
3149 char *nm = qs_get_attr_name(doc,attr);
3150 char *val = qs_get_attr_value(doc,attr);
3151 if (STRCASEEQ('a','A',"align", nm)) {
3152 /*----------------------------------------------------------------------*/
3153 /* CHTML 1.0 (W3C version 3.2) */
3154 /*----------------------------------------------------------------------*/
3155 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3156 align = apr_pstrdup(doc->buf.pool, val);
3167 <<<<<<< HEAD:src/chxj_chtml20.c
3170 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3171 return chtml20->out;
3176 * It is a handler who processes the P tag.
3178 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3179 * destination is specified.
3180 * @param node [i] The P tag node is specified.
3181 * @return The conversion result is returned.
3184 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
3190 chtml20 = GET_CHTML20(pdoc);
3196 return chtml20->out;
3201 s_chtml20_chxjif_tag(void *pdoc, Node *node)
3208 chtml20 = GET_CHTML20(pdoc);
3212 for (child = qs_get_child_node(doc, node);
3214 child = qs_get_next_node(doc, child)) {
3217 s_chtml20_chxjif_tag(pdoc, child);
3225 * It is a handler who processes the TEXTARE tag.
3227 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3228 * destination is specified.
3229 * @param node [i] The TEXTAREA tag node is specified.
3230 * @return The conversion result is returned.
3233 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
3240 chtml20 = GET_CHTML20(pdoc);
3244 chtml20->textarea_flag++;
3246 for (attr = qs_get_attr(doc,node);
3248 attr = qs_get_next_attr(doc,attr)) {
3249 char *name = qs_get_attr_name(doc,attr);
3250 char *value = qs_get_attr_value(doc,attr);
3254 if (strcasecmp(name, "accesskey") == 0 && value && *value != 0) {
3255 W_L(" accesskey=\"");
3263 if (strcasecmp(name, "name") == 0 && value && *value != 0) {
3272 if (strcasecmp(name, "rows") == 0 && value && *value != 0) {
3281 if (strcasecmp(name, "cols") == 0 && value && *value != 0) {
3290 if (strcasecmp(name, "istyle") == 0 && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3302 <<<<<<< HEAD:src/chxj_chtml20.c
3305 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3306 return chtml20->out;
3311 * It is a handler who processes the TEXTAREA tag.
3313 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3314 * destination is specified.
3315 * @param node [i] The TEXTAREA tag node is specified.
3316 * @return The conversion result is returned.
3319 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3321 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3322 Doc *doc = chtml20->doc;
3324 <<<<<<< HEAD:src/chxj_chtml20.c
3325 chtml20 = GET_CHTML20(pdoc);
3330 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3332 <<<<<<< HEAD:src/chxj_chtml20.c
3335 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3336 chtml20->textarea_flag--;
3338 return chtml20->out;
3343 s_chtml20_text_tag(void *pdoc, Node *child)
3355 chtml20 = GET_CHTML20(pdoc);
3359 textval = qs_get_node_value(doc,child);
3360 if (strlen(textval) == 0) {
3361 return chtml20->out;
3364 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3365 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3367 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3368 memset(one_byte, 0, sizeof(one_byte));
3371 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3373 int rtn = s_chtml20_search_emoji(chtml20, &textval[ii], &out);
3375 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3379 if (is_sjis_kanji(textval[ii])) {
3380 one_byte[0] = textval[ii+0];
3381 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3382 one_byte[0] = textval[ii+1];
3383 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3387 if (chtml20->pre_flag) {
3388 one_byte[0] = textval[ii+0];
3389 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3392 if (chtml20->textarea_flag) {
3393 one_byte[0] = textval[ii+0];
3394 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3397 if (textval[ii] != '\r' && textval[ii] != '\n') {
3398 one_byte[0] = textval[ii+0];
3399 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3403 return chtml20->out;
3407 * It is a handler who processes the BLOCKQUOTE tag.
3409 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3410 * destination is specified.
3411 * @param node [i] The BLOCKQUOTE tag node is specified.
3412 * @return The conversion result is returned.
3415 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3419 chtml20 = GET_CHTML20(pdoc);
3421 W_L("<blockquote>");
3422 return chtml20->out;
3427 * It is a handler who processes the BLOCKQUOTE tag.
3429 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3430 * destination is specified.
3431 * @param node [i] The BLOCKQUOTE tag node is specified.
3432 * @return The conversion result is returned.
3435 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3440 chtml20 = GET_CHTML20(pdoc);
3442 W_L("</blockquote>");
3443 return chtml20->out;
3448 * It is a handler who processes the DIR tag.
3450 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3451 * destination is specified.
3452 * @param node [i] The DIR tag node is specified.
3453 * @return The conversion result is returned.
3456 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3460 chtml20 = GET_CHTML20(pdoc);
3463 return chtml20->out;
3468 * It is a handler who processes the DIR tag.
3470 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3471 * destination is specified.
3472 * @param node [i] The DIR tag node is specified.
3473 * @return The conversion result is returned.
3476 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3481 chtml20 = GET_CHTML20(pdoc);
3484 return chtml20->out;
3489 * It is a handler who processes the BLOCKQUOTE tag.
3491 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3492 * destination is specified.
3493 * @param node [i] The BLOCKQUOTE tag node is specified.
3494 * @return The conversion result is returned.
3497 s_chtml20_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
3499 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3500 Doc *doc = chtml20->doc;
3501 W_L("<blockquote>");
3503 return chtml20->out;
3508 * It is a handler who processes the BLOCKQUOTE tag.
3510 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3511 * destination is specified.
3512 * @param node [i] The BLOCKQUOTE tag node is specified.
3513 * @return The conversion result is returned.
3516 s_chtml20_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3518 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3519 Doc *doc = chtml20->doc;
3520 W_L("</blockquote>");
3522 return chtml20->out;
3527 * It is a handler who processes the DIR tag.
3529 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3530 * destination is specified.
3531 * @param node [i] The DIR tag node is specified.
3532 * @return The conversion result is returned.
3535 s_chtml20_start_dir_tag(void *pdoc, Node *UNUSED(child))
3537 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3538 Doc *doc = chtml20->doc;
3541 return chtml20->out;
3546 * It is a handler who processes the DIR tag.
3548 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3549 * destination is specified.
3550 * @param node [i] The DIR tag node is specified.
3551 * @return The conversion result is returned.
3554 s_chtml20_end_dir_tag(void *pdoc, Node *UNUSED(child))
3556 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3557 Doc *doc = chtml20->doc;
3561 return chtml20->out;
3566 * It is a handler who processes the DL tag.
3568 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3569 * destination is specified.
3570 * @param node [i] The DL tag node is specified.
3571 * @return The conversion result is returned.
3574 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
3576 <<<<<<< HEAD:src/chxj_chtml20.c
3579 chtml20 = GET_CHTML20(pdoc);
3582 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3583 Doc *doc = chtml20->doc;
3584 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3587 return chtml20->out;
3592 * It is a handler who processes the DL tag.
3594 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3595 * destination is specified.
3596 * @param node [i] The DL tag node is specified.
3597 * @return The conversion result is returned.
3600 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
3602 <<<<<<< HEAD:src/chxj_chtml20.c
3605 chtml20 = GET_CHTML20(pdoc);
3608 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3609 Doc *doc = chtml20->doc;
3610 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3612 <<<<<<< HEAD:src/chxj_chtml20.c
3615 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3616 return chtml20->out;
3621 * It is a handter who processes the DT tag.
3623 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3624 * destination is specified.
3625 * @param node [i] The DT tag node is specified.
3626 * @return The conversion result is returned.
3629 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
3631 <<<<<<< HEAD:src/chxj_chtml20.c
3634 chtml20 = GET_CHTML20(pdoc);
3637 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3638 Doc *doc = chtml20->doc;
3639 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3641 return chtml20->out;
3646 * It is a handter who processes the DT tag.
3648 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3649 * destination is specified.
3650 * @param node [i] The DT tag node is specified.
3651 * @return The conversion result is returned.
3654 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
3656 <<<<<<< HEAD:src/chxj_chtml20.c
3658 chtml20 = GET_CHTML20(pdoc);
3660 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3662 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3663 return chtml20->out;
3668 * It is a handder who processes the DD tag.
3670 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3671 * destination is specified.
3672 * @param node [i] The DD tag node is specified.
3673 * @return The conversion result is returned.
3676 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3678 <<<<<<< HEAD:src/chxj_chtml20.c
3681 chtml20 = GET_CHTML20(pdoc);
3684 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3685 Doc *doc = chtml20->doc;
3686 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3688 return chtml20->out;
3693 * It is a handder who processes the DD tag.
3695 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3696 * destination is specified.
3697 * @param node [i] The DD tag node is specified.
3698 * @return The conversion result is returned.
3701 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3703 <<<<<<< HEAD:src/chxj_chtml20.c
3705 chtml20 = GET_CHTML20(pdoc);
3706 return chtml20->out;
3709 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3710 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3712 <<<<<<< HEAD:src/chxj_chtml20.c
3714 return chtml20->out;
3717 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3720 * It is a hanmenuer who processes the MENU tag.
3722 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3723 * destination is specified.
3724 * @param node [i] The MENU tag node is specified.
3725 * @return The conversion result is returned.
3728 s_chtml20_start_menu_tag(void *pdoc, Node *UNUSED(child))
3730 <<<<<<< HEAD:src/chxj_chtml20.c
3733 chtml20 = GET_CHTML20(pdoc);
3736 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3737 Doc *doc = chtml20->doc;
3739 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3741 <<<<<<< HEAD:src/chxj_chtml20.c
3744 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3745 return chtml20->out;
3750 * It is a hanmenuer who processes the MENU tag.
3752 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3753 * destination is specified.
3754 * @param node [i] The MENU tag node is specified.
3755 * @return The conversion result is returned.
3758 s_chtml20_end_menu_tag(void *pdoc, Node *UNUSED(child))
3760 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3761 <<<<<<< HEAD:src/chxj_chtml20.c
3762 Doc *doc = chtml20->doc;
3764 Doc *doc = chtml20->doc;
3766 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3768 <<<<<<< HEAD:src/chxj_chtml20.c
3771 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3772 return chtml20->out;
3777 * It is a hanplaintexter who processes the PLAINTEXT tag.
3779 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3780 * destination is specified.
3781 * @param node [i] The PLAINTEXT tag node is specified.
3782 * @return The conversion result is returned.
3785 s_chtml20_start_plaintext_tag(void *pdoc, Node *node)
3787 <<<<<<< HEAD:src/chxj_chtml20.c
3791 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3792 Doc *doc = chtml20->doc;
3793 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3795 <<<<<<< HEAD:src/chxj_chtml20.c
3796 chtml20 = GET_CHTML20(pdoc);
3799 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3801 s_chtml20_start_plaintext_tag_inner(pdoc,node);
3802 return chtml20->out;
3806 s_chtml20_start_plaintext_tag_inner(void *pdoc, Node *node)
3808 <<<<<<< HEAD:src/chxj_chtml20.c
3812 chtml20 = GET_CHTML20(pdoc);
3815 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3816 Doc *doc = chtml20->doc;
3819 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3820 for (child = qs_get_child_node(doc, node);
3822 child = qs_get_next_node(doc, child)) {
3824 s_chtml20_start_plaintext_tag_inner(pdoc, child);
3826 return chtml20->out;
3831 * It is a hanplaintexter who processes the PLAINTEXT tag.
3833 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3834 * destination is specified.
3835 * @param node [i] The PLAINTEXT tag node is specified.
3836 * @return The conversion result is returned.
3839 s_chtml20_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3841 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3842 return chtml20->out;
3844 <<<<<<< HEAD:src/chxj_chtml20.c
3848 * It is a hanblinker who processes the BLINK tag.
3850 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3851 * destination is specified.
3852 * @param node [i] The BLINK tag node is specified.
3853 * @return The conversion result is returned.
3856 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3858 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3859 Doc *doc = chtml20->doc;
3861 return chtml20->out;
3866 * It is a hanblinker who processes the BLINK tag.
3868 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3869 * destination is specified.
3870 * @param node [i] The BLINK tag node is specified.
3871 * @return The conversion result is returned.
3874 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3876 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3877 Doc *doc = chtml20->doc;
3880 return chtml20->out;
3882 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3884 <<<<<<< HEAD:src/chxj_chtml20.c
3886 * It is a hanblinker who processes the BLINK tag.
3888 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3889 * destination is specified.
3890 * @param node [i] The BLINK tag node is specified.
3891 * @return The conversion result is returned.
3894 s_chtml20_start_blink_tag(void *pdoc, Node *UNUSED(child))
3896 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3897 Doc *doc = chtml20->doc;
3899 return chtml20->out;
3904 * It is a hanblinker who processes the BLINK tag.
3906 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3907 * destination is specified.
3908 * @param node [i] The BLINK tag node is specified.
3909 * @return The conversion result is returned.
3912 s_chtml20_end_blink_tag(void *pdoc, Node *UNUSED(child))
3914 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3915 Doc *doc = chtml20->doc;
3917 return chtml20->out;
3921 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3924 * It is a hanmarqueeer who processes the MARQUEE tag.
3926 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3927 * destination is specified.
3928 * @param node [i] The MARQUEE tag node is specified.
3929 * @return The conversion result is returned.
3932 s_chtml20_start_marquee_tag(void *pdoc, Node *node)
3934 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3935 <<<<<<< HEAD:src/chxj_chtml20.c
3936 Doc *doc = chtml20->doc;
3939 Doc *doc = chtml20->doc;
3941 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3943 /*--------------------------------------------------------------------------*/
3944 /* Get Attributes */
3945 /*--------------------------------------------------------------------------*/
3946 for (attr = qs_get_attr(doc,node);
3948 attr = qs_get_next_attr(doc,attr)) {
3949 char *name = qs_get_attr_name(doc,attr);
3950 char *value = qs_get_attr_value(doc,attr);
3951 if (STRCASEEQ('d','D',"direction", name)) {
3952 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3953 W_L(" direction=\"");
3958 else if (STRCASEEQ('b','B',"behavior",name)) {
3959 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3960 W_L(" behavior=\"");
3965 else if (STRCASEEQ('l','L',"loop",name)) {
3966 if (value && *value) {
3974 return chtml20->out;
3979 * It is a hanmarqueeer who processes the MARQUEE tag.
3981 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3982 * destination is specified.
3983 * @param node [i] The MARQUEE tag node is specified.
3984 * @return The conversion result is returned.
3987 s_chtml20_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3989 chtml20_t *chtml20 = GET_CHTML20(pdoc);
3990 <<<<<<< HEAD:src/chxj_chtml20.c
3991 Doc *doc = chtml20->doc;
3993 Doc *doc = chtml20->doc;
3994 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
3996 <<<<<<< HEAD:src/chxj_chtml20.c
3999 >>>>>>> * updated new trunk.:src/chxj_chtml20.c
4000 return chtml20->out;