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.
18 #include "chxj_chtml20.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
25 #include "chxj_buffered_write.h"
27 #define GET_CHTML20(X) ((chtml20_t*)(X))
28 #define W_L(X) do { chtml20->out = BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, (X)); } while(0)
29 #define W_V(X) do { chtml20->out = (X) ? BUFFERED_WRITE_VALUE(chtml20->out, &doc->buf, (X)) \
30 : BUFFERED_WRITE_LITERAL(chtml20->out, &doc->buf, ""); } while(0)
32 static char *s_chtml20_start_html_tag (void *pdoc, Node *node);
33 static char *s_chtml20_end_html_tag (void *pdoc, Node *node);
34 static char *s_chtml20_start_meta_tag (void *pdoc, Node *node);
35 static char *s_chtml20_end_meta_tag (void *pdoc, Node *node);
36 static char *s_chtml20_start_textarea_tag(void *pdoc, Node *node);
37 static char *s_chtml20_end_textarea_tag (void *pdoc, Node *node);
38 static char *s_chtml20_start_p_tag (void *pdoc, Node *node);
39 static char *s_chtml20_end_p_tag (void *pdoc, Node *node);
40 static char *s_chtml20_start_pre_tag (void *pdoc, Node *node);
41 static char *s_chtml20_end_pre_tag (void *pdoc, Node *node);
42 static char *s_chtml20_start_h1_tag (void *pdoc, Node *node);
43 static char *s_chtml20_end_h1_tag (void *pdoc, Node *node);
44 static char *s_chtml20_start_h2_tag (void *pdoc, Node *node);
45 static char *s_chtml20_end_h2_tag (void *pdoc, Node *node);
46 static char *s_chtml20_start_h3_tag (void *pdoc, Node *node);
47 static char *s_chtml20_end_h3_tag (void *pdoc, Node *node);
48 static char *s_chtml20_start_h4_tag (void *pdoc, Node *node);
49 static char *s_chtml20_end_h4_tag (void *pdoc, Node *node);
50 static char *s_chtml20_start_h5_tag (void *pdoc, Node *node);
51 static char *s_chtml20_end_h5_tag (void *pdoc, Node *node);
52 static char *s_chtml20_start_h6_tag (void *pdoc, Node *node);
53 static char *s_chtml20_end_h6_tag (void *pdoc, Node *node);
54 static char *s_chtml20_start_ul_tag (void *pdoc, Node *node);
55 static char *s_chtml20_end_ul_tag (void *pdoc, Node *node);
56 static char *s_chtml20_start_ol_tag (void *pdoc, Node *node);
57 static char *s_chtml20_end_ol_tag (void *pdoc, Node *node);
58 static char *s_chtml20_start_li_tag (void *pdoc, Node *node);
59 static char *s_chtml20_end_li_tag (void *pdoc, Node *node);
60 static char *s_chtml20_start_head_tag (void *pdoc, Node *node);
61 static char *s_chtml20_end_head_tag (void *pdoc, Node *node);
62 static char *s_chtml20_start_title_tag (void *pdoc, Node *node);
63 static char *s_chtml20_end_title_tag (void *pdoc, Node *node);
64 static char *s_chtml20_start_base_tag (void *pdoc, Node *node);
65 static char *s_chtml20_end_base_tag (void *pdoc, Node *node);
66 static char *s_chtml20_start_body_tag (void *pdoc, Node *node);
67 static char *s_chtml20_end_body_tag (void *pdoc, Node *node);
68 static char *s_chtml20_start_a_tag (void *pdoc, Node *node);
69 static char *s_chtml20_end_a_tag (void *pdoc, Node *node);
70 static char *s_chtml20_start_br_tag (void *pdoc, Node *node);
71 static char *s_chtml20_end_br_tag (void *pdoc, Node *node);
72 static char *s_chtml20_start_tr_tag (void *pdoc, Node *node);
73 static char *s_chtml20_end_tr_tag (void *pdoc, Node *node);
74 static char *s_chtml20_start_font_tag (void *pdoc, Node *node);
75 static char *s_chtml20_end_font_tag (void *pdoc, Node *node);
76 static char *s_chtml20_start_form_tag (void *pdoc, Node *node);
77 static char *s_chtml20_end_form_tag (void *pdoc, Node *node);
78 static char *s_chtml20_start_input_tag (void *pdoc, Node *node);
79 static char *s_chtml20_end_input_tag (void *pdoc, Node *node);
80 static char *s_chtml20_start_center_tag (void *pdoc, Node *node);
81 static char *s_chtml20_end_center_tag (void *pdoc, Node *node);
82 static char *s_chtml20_start_hr_tag (void *pdoc, Node *node);
83 static char *s_chtml20_end_hr_tag (void *pdoc, Node *node);
84 static char *s_chtml20_start_img_tag (void *pdoc, Node *node);
85 static char *s_chtml20_end_img_tag (void *pdoc, Node *node);
86 static char *s_chtml20_start_select_tag (void *pdoc, Node *node);
87 static char *s_chtml20_end_select_tag (void *pdoc, Node *node);
88 static char *s_chtml20_start_option_tag (void *pdoc, Node *node);
89 static char *s_chtml20_end_option_tag (void *pdoc, Node *node);
90 static char *s_chtml20_start_div_tag (void *pdoc, Node *node);
91 static char *s_chtml20_end_div_tag (void *pdoc, Node *node);
92 static char *s_chtml20_start_dl_tag (void *pdoc, Node *node);
93 static char *s_chtml20_end_dl_tag (void *pdoc, Node *node);
94 static char *s_chtml20_start_dt_tag (void *pdoc, Node *node);
95 static char *s_chtml20_end_dt_tag (void *pdoc, Node *node);
96 static char *s_chtml20_start_dd_tag (void *pdoc, Node *node);
97 static char *s_chtml20_end_dd_tag (void *pdoc, Node *node);
99 static void s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
101 static char *s_chtml20_chxjif_tag(void *pdoc, Node *node);
102 static char *s_chtml20_text_tag(void *pdoc, Node *node);
106 tag_handler chtml20_handler[] = {
109 s_chtml20_start_html_tag,
110 s_chtml20_end_html_tag,
114 s_chtml20_start_meta_tag,
115 s_chtml20_end_meta_tag,
119 s_chtml20_start_textarea_tag,
120 s_chtml20_end_textarea_tag,
124 s_chtml20_start_p_tag,
129 s_chtml20_start_pre_tag,
130 s_chtml20_end_pre_tag,
134 s_chtml20_start_ul_tag,
135 s_chtml20_end_ul_tag,
139 s_chtml20_start_li_tag,
140 s_chtml20_end_li_tag,
144 s_chtml20_start_ol_tag,
145 s_chtml20_end_ol_tag,
149 s_chtml20_start_h1_tag,
150 s_chtml20_end_h1_tag,
154 s_chtml20_start_h2_tag,
155 s_chtml20_end_h2_tag,
159 s_chtml20_start_h3_tag,
160 s_chtml20_end_h3_tag,
164 s_chtml20_start_h4_tag,
165 s_chtml20_end_h4_tag,
169 s_chtml20_start_h5_tag,
170 s_chtml20_end_h5_tag,
174 s_chtml20_start_h6_tag,
175 s_chtml20_end_h6_tag,
179 s_chtml20_start_head_tag,
180 s_chtml20_end_head_tag,
184 s_chtml20_start_title_tag,
185 s_chtml20_end_title_tag,
189 s_chtml20_start_base_tag,
190 s_chtml20_end_base_tag,
194 s_chtml20_start_body_tag,
195 s_chtml20_end_body_tag,
199 s_chtml20_start_a_tag,
204 s_chtml20_start_br_tag,
205 s_chtml20_end_br_tag,
214 s_chtml20_start_tr_tag,
215 s_chtml20_end_tr_tag,
229 s_chtml20_start_font_tag,
230 s_chtml20_end_font_tag,
234 s_chtml20_start_form_tag,
235 s_chtml20_end_form_tag,
239 s_chtml20_start_input_tag,
240 s_chtml20_end_input_tag,
244 s_chtml20_start_center_tag,
245 s_chtml20_end_center_tag,
249 s_chtml20_start_hr_tag,
250 s_chtml20_end_hr_tag,
254 s_chtml20_start_img_tag,
255 s_chtml20_end_img_tag,
259 s_chtml20_start_select_tag,
260 s_chtml20_end_select_tag,
264 s_chtml20_start_option_tag,
265 s_chtml20_end_option_tag,
269 s_chtml20_start_div_tag,
270 s_chtml20_end_div_tag,
274 s_chtml20_chxjif_tag,
319 s_chtml20_start_dt_tag,
320 s_chtml20_end_dt_tag,
334 s_chtml20_start_dl_tag,
335 s_chtml20_end_dl_tag,
339 s_chtml20_start_dd_tag,
340 s_chtml20_end_dd_tag,
345 * converts from CHTML5.0 to CHTML2.0.
347 * @param r [i] Requet_rec is appointed.
348 * @param spec [i] The result of the device specification processing which
349 * was done in advance is appointed.
350 * @param src [i] The character string before the converting is appointed.
351 * @return The character string after the converting is returned.
354 chxj_convert_chtml20(
360 chxjconvrule_entry *entryp,
369 /*--------------------------------------------------------------------------*/
371 /*--------------------------------------------------------------------------*/
373 dst = chxj_qr_code_blob_handler(r, src, (size_t *)dstlen);
375 DBG(r,"i found qrcode xml");
378 DBG(r,"not found qrcode xml");
380 /*--------------------------------------------------------------------------*/
381 /* The CHTML structure is initialized. */
382 /*--------------------------------------------------------------------------*/
383 s_init_chtml20(&chtml20, &doc, r, spec);
386 chtml20.entryp = entryp;
387 chtml20.cookie = cookie;
389 if (IS_SJIS_STRING(GET_SPEC_CHARSET(spec))) {
390 ap_set_content_type(r, "text/html; charset=Windows-31J");
393 ap_set_content_type(r, "text/html; charset=UTF-8");
396 /*--------------------------------------------------------------------------*/
397 /* The character string of the input is analyzed. */
398 /*--------------------------------------------------------------------------*/
399 qs_init_malloc(&doc);
400 qs_init_root_node(&doc);
402 ss = apr_pcalloc(r->pool, srclen + 1);
403 memset(ss, 0, srclen + 1);
404 memcpy(ss, src, srclen);
407 chxj_dump_out("[src] CHTML -> CHTML2.0", ss, srclen);
410 qs_parse_string(&doc,ss, strlen(ss));
412 if (! chxj_buffered_write_init(r->pool, &doc.buf)) {
413 ERR(r, "failed: chxj_buffered_write_init()");
414 DBG(r, "end chxj_convert_chtml20()");
415 return apr_pstrdup(r->pool, ss);
418 /*--------------------------------------------------------------------------*/
419 /* It converts it from CHTML to CHTML. */
420 /*--------------------------------------------------------------------------*/
421 chxj_node_convert(spec,r,(void*)&chtml20, &doc, qs_get_root(&doc), 0);
422 /*--------------------------------------------------------------------------*/
423 /* flush buffer AND terminate. */
424 /*--------------------------------------------------------------------------*/
425 chtml20.out = chxj_buffered_write_flush(chtml20.out, &doc.buf);
426 dst = apr_pstrdup(r->pool, chtml20.out);
427 chxj_buffered_write_terminate(&doc.buf);
429 qs_all_free(&doc,QX_LOGMARK);
432 return apr_pstrdup(r->pool,ss);
435 if (strlen(dst) == 0) {
436 dst = apr_psprintf(r->pool, "\n");
439 *dstlen = strlen(dst);
442 chxj_dump_out("[dst] CHTML -> CHTML2.0", dst, *dstlen);
449 * The CHTML structure is initialized.
451 * @param chtml20 [i/o] The pointer to the HDML structure that wants to be
452 * initialized is specified.
453 * @param doc [i] The Doc structure that should be set to the initialized
454 * HDML structure is specified.
455 * @param r [i] To use POOL, the pointer to request_rec is specified.
456 * @param spec [i] The pointer to the device_table
459 s_init_chtml20(chtml20_t *chtml20, Doc *doc, request_rec *r, device_table *spec)
461 memset(doc, 0, sizeof(Doc));
462 memset(chtml20, 0, sizeof(chtml20_t));
466 chtml20->spec = spec;
467 chtml20->out = qs_alloc_zero_byte_string(r);
468 chtml20->conf = ap_get_module_config(r->per_dir_config, &chxj_module);
470 chtml20->doc->parse_mode = PARSE_MODE_CHTML;
475 * It is a handler who processes the HTML tag.
477 * @param pdoc [i/o] The pointer to the CHTML structure at the output
478 * destination is specified.
479 * @param node [i] The HTML tag node is specified.
480 * @return The conversion result is returned.
483 s_chtml20_start_html_tag(void *pdoc, Node *UNUSED(node))
489 chtml20 = GET_CHTML20(pdoc);
493 /*--------------------------------------------------------------------------*/
495 /*--------------------------------------------------------------------------*/
503 * It is a handler who processes the HTML tag.
505 * @param pdoc [i/o] The pointer to the CHTML structure at the output
506 * destination is specified.
507 * @param node [i] The HTML tag node is specified.
508 * @return The conversion result is returned.
511 s_chtml20_end_html_tag(void *pdoc, Node *UNUSED(child))
517 chtml20 = GET_CHTML20(pdoc);
527 * It is a handler who processes the META tag.
529 * @param pdoc [i/o] The pointer to the CHTML structure at the output
530 * destination is specified.
531 * @param node [i] The META tag node is specified.
532 * @return The conversion result is returned.
535 s_chtml20_start_meta_tag(void *pdoc, Node *node)
541 int content_type_flag;
544 chtml20 = GET_CHTML20(pdoc);
548 content_type_flag = 0;
552 /*--------------------------------------------------------------------------*/
554 /*--------------------------------------------------------------------------*/
555 for (attr = qs_get_attr(doc,node);
557 attr = qs_get_next_attr(doc,attr)) {
562 name = qs_get_attr_name(doc,attr);
563 value = qs_get_attr_value(doc,attr);
568 if (strcasecmp(name, "http-equiv") == 0) {
569 /*----------------------------------------------------------------------*/
571 /*----------------------------------------------------------------------*/
572 W_L(" http-equiv=\"");
575 if (STRCASEEQ('c','C',"content-type",value)) {
576 content_type_flag = 1;
578 if (STRCASEEQ('r','R',"refresh", value)) {
586 if (strcasecmp(name, "content") == 0) {
587 if (content_type_flag) {
588 if (IS_SJIS_STRING(GET_SPEC_CHARSET(chtml20->spec))) {
592 W_L("text/html; charset=Windows-31J");
599 W_L("text/html; charset=UTF-8");
602 else if (refresh_flag) {
603 char* buf = apr_pstrdup(r->pool, value);
607 url = strchr(buf, ';');
609 sec = apr_pstrdup(r->pool, buf);
612 url = chxj_encoding_parameter(r, url);
613 url = chxj_add_cookie_parameter(r, url, chtml20->cookie);
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_end_meta_tag(void *pdoc, Node *UNUSED(child))
654 chtml20 = GET_CHTML20(pdoc);
661 * It is a handler who processes the HEAD tag.
663 * @param pdoc [i/o] The pointer to the CHTML structure at the output
664 * destination is specified.
665 * @param node [i] The HEAD tag node is specified.
666 * @return The conversion result is returned.
669 s_chtml20_start_head_tag(void *pdoc, Node *UNUSED(node))
675 chtml20 = GET_CHTML20(pdoc);
685 * It is a handler who processes the HEAD tag.
687 * @param pdoc [i/o] The pointer to the CHTML structure at the output
688 * destination is specified.
689 * @param node [i] The HEAD tag node is specified.
690 * @return The conversion result is returned.
693 s_chtml20_end_head_tag(void *pdoc, Node *UNUSED(child))
699 chtml20 = GET_CHTML20(pdoc);
709 * It is a handler who processes the TITLE tag.
711 * @param pdoc [i/o] The pointer to the CHTML structure at the output
712 * destination is specified.
713 * @param node [i] The TITLE tag node is specified.
714 * @return The conversion result is returned.
717 s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
723 chtml20 = GET_CHTML20(pdoc);
733 * It is a handler who processes the TITLE tag.
735 * @param pdoc [i/o] The pointer to the CHTML structure at the output
736 * destination is specified.
737 * @param node [i] The TITLE tag node is specified.
738 * @return The conversion result is returned.
741 s_chtml20_end_title_tag(void *pdoc, Node *UNUSED(child))
747 chtml20 = GET_CHTML20(pdoc);
757 * It is a handler who processes the BASE tag.
759 * @param pdoc [i/o] The pointer to the CHTML structure at the output
760 * destination is specified.
761 * @param node [i] The BASE tag node is specified.
762 * @return The conversion result is returned.
765 s_chtml20_start_base_tag(void *pdoc, Node *node)
772 chtml20 = GET_CHTML20(pdoc);
777 /*--------------------------------------------------------------------------*/
779 /*--------------------------------------------------------------------------*/
780 for (attr = qs_get_attr(doc,node);
782 attr = qs_get_next_attr(doc,attr)) {
787 name = qs_get_attr_name(doc,attr);
788 value = qs_get_attr_value(doc,attr);
790 if (STRCASEEQ('h','H',"href",name)) {
802 * It is a handler who processes the BASE tag.
804 * @param pdoc [i/o] The pointer to the CHTML structure at the output
805 * destination is specified.
806 * @param node [i] The BASE tag node is specified.
807 * @return The conversion result is returned.
810 s_chtml20_end_base_tag(void *pdoc, Node *UNUSED(child))
816 chtml20 = GET_CHTML20(pdoc);
825 * It is a handler who processes the BODY tag.
827 * @param pdoc [i/o] The pointer to the CHTML structure at the output
828 * destination is specified.
829 * @param node [i] The BODY tag node is specified.
830 * @return The conversion result is returned.
833 s_chtml20_start_body_tag(void *pdoc, Node *node)
840 chtml20 = GET_CHTML20(pdoc);
845 /*--------------------------------------------------------------------------*/
847 /*--------------------------------------------------------------------------*/
848 for (attr = qs_get_attr(doc,node);
850 attr = qs_get_next_attr(doc,attr)) {
854 name = qs_get_attr_name(doc,attr);
855 value = qs_get_attr_value(doc,attr);
860 if (strcasecmp(name, "bgcolor") == 0) {
861 /*----------------------------------------------------------------------*/
863 /*----------------------------------------------------------------------*/
872 if (strcasecmp(name, "text") == 0) {
873 /*----------------------------------------------------------------------*/
875 /*----------------------------------------------------------------------*/
884 if (strcasecmp(name, "link") == 0) {
885 /*----------------------------------------------------------------------*/
887 /*----------------------------------------------------------------------*/
896 if (strcasecmp(name, "alink") == 0) {
897 /*----------------------------------------------------------------------*/
899 /*----------------------------------------------------------------------*/
906 if (strcasecmp(name, "vlink") == 0) {
907 /*----------------------------------------------------------------------*/
909 /*----------------------------------------------------------------------*/
924 * It is a handler who processes the BODY tag.
926 * @param pdoc [i/o] The pointer to the CHTML structure at the output
927 * destination is specified.
928 * @param node [i] The BODY tag node is specified.
929 * @return The conversion result is returned.
932 s_chtml20_end_body_tag(void *pdoc, Node *UNUSED(child))
938 chtml20 = GET_CHTML20(pdoc);
948 * It is a handler who processes the A tag.
950 * @param pdoc [i/o] The pointer to the CHTML structure at the output
951 * destination is specified.
952 * @param node [i] The A tag node is specified.
953 * @return The conversion result is returned.
956 s_chtml20_start_a_tag(void *pdoc, Node *node)
963 chtml20 = GET_CHTML20(pdoc);
968 /*--------------------------------------------------------------------------*/
970 /*--------------------------------------------------------------------------*/
971 for (attr = qs_get_attr(doc,node);
973 attr = qs_get_next_attr(doc,attr)) {
978 name = qs_get_attr_name(doc,attr);
979 value = qs_get_attr_value(doc,attr);
984 if (strcasecmp(name, "name") == 0) {
985 /*--------------------------------------------------------------------*/
987 /*--------------------------------------------------------------------*/
996 if (strcasecmp(name, "href") == 0) {
997 /*--------------------------------------------------------------------*/
999 /*--------------------------------------------------------------------*/
1000 value = chxj_encoding_parameter(r, value);
1001 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1010 if (strcasecmp(name, "accesskey") == 0) {
1011 /*--------------------------------------------------------------------*/
1013 /*--------------------------------------------------------------------*/
1014 W_L(" accesskey=\"");
1022 if (strcasecmp(name, "cti") == 0) {
1023 /*--------------------------------------------------------------------*/
1025 /*--------------------------------------------------------------------*/
1034 if (strcasecmp(name, "ijam") == 0) {
1035 /*--------------------------------------------------------------------*/
1037 /*--------------------------------------------------------------------*/
1041 if (strcasecmp(name, "ista") == 0) {
1042 /*--------------------------------------------------------------------*/
1044 /*--------------------------------------------------------------------*/
1048 if (strcasecmp(name, "ilet") == 0) {
1049 /*--------------------------------------------------------------------*/
1051 /*--------------------------------------------------------------------*/
1055 if (strcasecmp(name, "iswf") == 0) {
1056 /*--------------------------------------------------------------------*/
1058 /*--------------------------------------------------------------------*/
1062 if (strcasecmp(name, "irst") == 0) {
1063 /*--------------------------------------------------------------------*/
1065 /*--------------------------------------------------------------------*/
1072 if (strcasecmp(name, "utn") == 0) {
1073 /*--------------------------------------------------------------------*/
1075 /*--------------------------------------------------------------------*/
1082 if (strcasecmp(name, "telbook") == 0) {
1083 /*--------------------------------------------------------------------*/
1085 /*--------------------------------------------------------------------*/
1092 if (strcasecmp(name, "kana") == 0) {
1093 /*--------------------------------------------------------------------*/
1095 /*--------------------------------------------------------------------*/
1102 if (strcasecmp(name, "email") == 0) {
1103 /*--------------------------------------------------------------------*/
1105 /*--------------------------------------------------------------------*/
1115 return chtml20->out;
1120 * It is a handler who processes the A tag.
1122 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1123 * destination is specified.
1124 * @param node [i] The A tag node is specified.
1125 * @return The conversion result is returned.
1128 s_chtml20_end_a_tag(void *pdoc, Node *UNUSED(child))
1134 chtml20 = GET_CHTML20(pdoc);
1139 return chtml20->out;
1144 * It is a handler who processes the BR tag.
1146 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1147 * destination is specified.
1148 * @param node [i] The BR tag node is specified.
1149 * @return The conversion result is returned.
1152 s_chtml20_start_br_tag(void *pdoc, Node *UNUSED(node))
1158 chtml20 = GET_CHTML20(pdoc);
1163 return chtml20->out;
1168 * It is a handler who processes the BR tag.
1170 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1171 * destination is specified.
1172 * @param node [i] The BR tag node is specified.
1173 * @return The conversion result is returned.
1176 s_chtml20_end_br_tag(void *pdoc, Node *UNUSED(child))
1182 chtml20 = GET_CHTML20(pdoc);
1186 return chtml20->out;
1191 * It is a handler who processes the TR tag.
1193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1194 * destination is specified.
1195 * @param node [i] The TR tag node is specified.
1196 * @return The conversion result is returned.
1199 s_chtml20_start_tr_tag(void *pdoc, Node *UNUSED(node))
1205 chtml20 = GET_CHTML20(pdoc);
1209 return chtml20->out;
1214 * It is a handler who processes the TR tag.
1216 * @param chtml20 [i/o] The pointer to the CHTML structure at the output
1217 * destination is specified.
1218 * @param node [i] The TR tag node is specified.
1219 * @return The conversion result is returned.
1222 s_chtml20_end_tr_tag(void *pdoc, Node *UNUSED(child))
1228 chtml20 = GET_CHTML20(pdoc);
1233 return chtml20->out;
1238 * It is a handler who processes the FONT tag.
1240 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1241 * destination is specified.
1242 * @param node [i] The FONT tag node is specified.
1243 * @return The conversion result is returned.
1246 s_chtml20_start_font_tag(void *pdoc, Node *node)
1253 chtml20 = GET_CHTML20(pdoc);
1258 /*--------------------------------------------------------------------------*/
1259 /* Get Attributes */
1260 /*--------------------------------------------------------------------------*/
1261 for (attr = qs_get_attr(doc,node);
1263 attr = qs_get_next_attr(doc,attr)) {
1268 name = qs_get_attr_name(doc,attr);
1269 value = qs_get_attr_value(doc,attr);
1274 if (strcasecmp(name, "color") == 0) {
1283 if (strcasecmp(name, "size") == 0) {
1284 /*--------------------------------------------------------------------*/
1286 /*--------------------------------------------------------------------*/
1296 return chtml20->out;
1301 * It is a handler who processes the FONT tag.
1303 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1304 * destination is specified.
1305 * @param node [i] The FONT tag node is specified.
1306 * @return The conversion result is returned.
1309 s_chtml20_end_font_tag(void *pdoc, Node *UNUSED(child))
1315 chtml20 = GET_CHTML20(pdoc);
1320 return chtml20->out;
1325 * It is a handler who processes the FORM tag.
1327 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1328 * destination is specified.
1329 * @param node [i] The FORM tag node is specified.
1330 * @return The conversion result is returned.
1333 s_chtml20_start_form_tag(void *pdoc, Node *node)
1340 chtml20 = GET_CHTML20(pdoc);
1345 /*--------------------------------------------------------------------------*/
1346 /* Get Attributes */
1347 /*--------------------------------------------------------------------------*/
1348 for (attr = qs_get_attr(doc,node);
1350 attr = qs_get_next_attr(doc,attr)) {
1355 name = qs_get_attr_name(doc,attr);
1356 value = qs_get_attr_value(doc,attr);
1361 if (strcasecmp(name, "action") == 0) {
1362 /*--------------------------------------------------------------------*/
1364 /*--------------------------------------------------------------------*/
1365 value = chxj_encoding_parameter(r, value);
1366 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1376 if (strcasecmp(name, "method") == 0) {
1377 /*--------------------------------------------------------------------*/
1379 /*--------------------------------------------------------------------*/
1388 if (strcasecmp(name, "utn") == 0) {
1389 /*--------------------------------------------------------------------*/
1391 /*--------------------------------------------------------------------*/
1401 return chtml20->out;
1406 * It is a handler who processes the FORM tag.
1408 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1409 * destination is specified.
1410 * @param node [i] The FORM tag node is specified.
1411 * @return The conversion result is returned.
1414 s_chtml20_end_form_tag(void *pdoc, Node *UNUSED(child))
1420 chtml20 = GET_CHTML20(pdoc);
1425 return chtml20->out;
1430 * It is a handler who processes the INPUT tag.
1432 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1433 * destination is specified.
1434 * @param node [i] The INPUT tag node is specified.
1435 * @return The conversion result is returned.
1438 s_chtml20_start_input_tag(void *pdoc, Node *node)
1443 char *max_length = NULL;
1447 char *istyle = NULL;
1449 char *checked = NULL;
1450 char *accesskey = NULL;
1452 chtml20 = GET_CHTML20(pdoc);
1457 /*--------------------------------------------------------------------------*/
1458 /* Get Attributes */
1459 /*--------------------------------------------------------------------------*/
1460 type = qs_get_type_attr(doc, node, r);
1461 name = qs_get_name_attr(doc, node, r);
1462 value = qs_get_value_attr(doc,node,r);
1463 istyle = qs_get_istyle_attr(doc,node,r);
1464 max_length = qs_get_maxlength_attr(doc,node,r);
1465 checked = qs_get_checked_attr(doc,node,r);
1466 accesskey = qs_get_accesskey_attr(doc, node, r);
1467 size = qs_get_size_attr(doc, node, r);
1494 W_L(" accesskey=\"");
1500 /*------------------------------------------------------------------------*/
1502 /*------------------------------------------------------------------------*/
1508 /*--------------------------------------------------------------------------*/
1509 /* The figure is default for the password. */
1510 /*--------------------------------------------------------------------------*/
1512 if (chxj_chk_numeric(max_length) != 0)
1513 max_length = apr_psprintf(r->pool, "0");
1514 if (istyle != NULL && istyle[0] == '1') {
1515 char *vv = apr_psprintf(doc->buf.pool,
1516 " maxlength=\"%d\"",
1517 chxj_atoi(max_length)*2);
1521 char *vv = apr_psprintf(doc->buf.pool,
1522 " maxlength=\"%d\"",
1523 chxj_atoi(max_length));
1532 return chtml20->out;
1537 * It is a handler who processes the INPUT tag.
1539 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1540 * destination is specified.
1541 * @param node [i] The INPUT tag node is specified.
1542 * @return The conversion result is returned.
1545 s_chtml20_end_input_tag(void *pdoc, Node *UNUSED(child))
1551 chtml20 = GET_CHTML20(pdoc);
1555 return chtml20->out;
1560 * It is a handler who processes the CENTER tag.
1562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1563 * destination is specified.
1564 * @param node [i] The CENTER tag node is specified.
1565 * @return The conversion result is returned.
1568 s_chtml20_start_center_tag(void *pdoc, Node *UNUSED(node))
1574 chtml20 = GET_CHTML20(pdoc);
1579 return chtml20->out;
1584 * It is a handler who processes the CENTER tag.
1586 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1587 * destination is specified.
1588 * @param node [i] The CENTER tag node is specified.
1589 * @return The conversion result is returned.
1592 s_chtml20_end_center_tag(void *pdoc, Node *UNUSED(child))
1598 chtml20 = GET_CHTML20(pdoc);
1603 return chtml20->out;
1608 * It is a handler who processes the UL tag.
1610 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1611 * destination is specified.
1612 * @param node [i] The UL tag node is specified.
1613 * @return The conversion result is returned.
1616 s_chtml20_start_ul_tag(void *pdoc, Node *UNUSED(node))
1622 chtml20 = GET_CHTML20(pdoc);
1627 return chtml20->out;
1632 * It is a handler who processes the UL tag.
1634 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1635 * destination is specified.
1636 * @param node [i] The UL tag node is specified.
1637 * @return The conversion result is returned.
1640 s_chtml20_end_ul_tag(void *pdoc, Node *UNUSED(child))
1646 chtml20 = GET_CHTML20(pdoc);
1651 return chtml20->out;
1656 * It is a handler who processes the OL tag.
1658 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1659 * destination is specified.
1660 * @param node [i] The OL tag node is specified.
1661 * @return The conversion result is returned.
1664 s_chtml20_start_ol_tag(void *pdoc, Node *UNUSED(node))
1670 chtml20 = GET_CHTML20(pdoc);
1675 return chtml20->out;
1680 * It is a handler who processes the OL tag.
1682 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1683 * destination is specified.
1684 * @param node [i] The OL tag node is specified.
1685 * @return The conversion result is returned.
1688 s_chtml20_end_ol_tag(void *pdoc, Node *UNUSED(child))
1694 chtml20 = GET_CHTML20(pdoc);
1699 return chtml20->out;
1704 * It is a handler who processes the LI tag.
1706 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1707 * destination is specified.
1708 * @param node [i] The LI tag node is specified.
1709 * @return The conversion result is returned.
1712 s_chtml20_start_li_tag(void *pdoc, Node *UNUSED(node))
1718 chtml20 = GET_CHTML20(pdoc);
1723 return chtml20->out;
1728 * It is a handler who processes the LI tag.
1730 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1731 * destination is specified.
1732 * @param node [i] The LI tag node is specified.
1733 * @return The conversion result is returned.
1736 s_chtml20_end_li_tag(void *pdoc, Node *UNUSED(child))
1742 chtml20 = GET_CHTML20(pdoc);
1747 return chtml20->out;
1752 * It is a handler who processes the HR tag.
1754 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1755 * destination is specified.
1756 * @param node [i] The HR tag node is specified.
1757 * @return The conversion result is returned.
1760 s_chtml20_start_hr_tag(void *pdoc, Node *node)
1767 chtml20 = GET_CHTML20(pdoc);
1772 for (attr = qs_get_attr(doc,node);
1774 attr = qs_get_next_attr(doc,attr)) {
1779 name = qs_get_attr_name(doc,attr);
1780 value = qs_get_attr_value(doc,attr);
1785 if (strcasecmp(name, "align") == 0) {
1786 /*--------------------------------------------------------------------*/
1788 /*--------------------------------------------------------------------*/
1797 if (strcasecmp(name, "size") == 0) {
1798 /*--------------------------------------------------------------------*/
1800 /*--------------------------------------------------------------------*/
1809 if (strcasecmp(name, "width") == 0) {
1810 /*--------------------------------------------------------------------*/
1812 /*--------------------------------------------------------------------*/
1821 if (strcasecmp(name, "noshade") == 0) {
1822 /*--------------------------------------------------------------------*/
1824 /*--------------------------------------------------------------------*/
1831 if (strcasecmp(name, "color") == 0) {
1832 /*--------------------------------------------------------------------*/
1834 /*--------------------------------------------------------------------*/
1844 return chtml20->out;
1849 * It is a handler who processes the HR tag.
1851 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1852 * destination is specified.
1853 * @param node [i] The HR tag node is specified.
1854 * @return The conversion result is returned.
1857 s_chtml20_end_hr_tag(void *pdoc, Node *UNUSED(child))
1863 chtml20 = GET_CHTML20(pdoc);
1867 return chtml20->out;
1872 * It is a handler who processes the IMG tag.
1874 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1875 * destination is specified.
1876 * @param node [i] The IMG tag node is specified.
1877 * @return The conversion result is returned.
1880 s_chtml20_start_img_tag(void *pdoc, Node *node)
1886 #ifndef IMG_NOT_CONVERT_FILENAME
1890 chtml20 = GET_CHTML20(pdoc);
1894 #ifndef IMG_NOT_CONVERT_FILENAME
1895 spec = chtml20->spec;
1899 /*-------------------------------------------------------------------------*/
1900 /* Get Attributes */
1901 /*-------------------------------------------------------------------------*/
1902 for (attr = qs_get_attr(doc,node);
1904 attr = qs_get_next_attr(doc,attr)) {
1909 name = qs_get_attr_name(doc,attr);
1910 value = qs_get_attr_value(doc,attr);
1915 if (strcasecmp(name, "src") == 0) {
1916 /*-------------------------------------------------------------------*/
1918 /*-------------------------------------------------------------------*/
1919 #ifdef IMG_NOT_CONVERT_FILENAME
1920 value = chxj_encoding_parameter(r, value);
1921 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1923 value = apr_psprintf(r->pool,
1926 (strchr(value, '?')) ? '&' : '?',
1927 CHXJ_COOKIE_NOUPDATE_PARAM);
1933 value = chxj_img_conv(r, spec, value);
1934 value = chxj_encoding_parameter(r, value);
1935 value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
1937 value = apr_psprintf(r->pool,
1940 (strchr(value, '?')) ? '&' : '?',
1941 CHXJ_COOKIE_NOUPDATE_PARAM);
1952 if (strcasecmp(name, "align" ) == 0) {
1953 /*--------------------------------------------------------------------*/
1955 /*--------------------------------------------------------------------*/
1960 else if (strcasecmp(name, "alt" ) == 0) {
1961 /*--------------------------------------------------------------------*/
1963 /*--------------------------------------------------------------------*/
1968 else if (strcasecmp(name, "align" ) == 0) {
1969 /*--------------------------------------------------------------------*/
1971 /*--------------------------------------------------------------------*/
1978 if (strcasecmp(name, "width" ) == 0) {
1979 /*--------------------------------------------------------------------*/
1981 /*--------------------------------------------------------------------*/
1990 if (strcasecmp(name, "height") == 0) {
1991 /*--------------------------------------------------------------------*/
1993 /*--------------------------------------------------------------------*/
1999 if (strcasecmp(name, "hspace") == 0) {
2000 /*--------------------------------------------------------------------*/
2002 /*--------------------------------------------------------------------*/
2011 if (strcasecmp(name, "vspace") == 0) {
2012 /*--------------------------------------------------------------------*/
2014 /*--------------------------------------------------------------------*/
2026 return chtml20->out;
2031 * It is a handler who processes the IMG tag.
2033 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2034 * destination is specified.
2035 * @param node [i] The IMG tag node is specified.
2036 * @return The conversion result is returned.
2039 s_chtml20_end_img_tag(void *pdoc, Node *UNUSED(child))
2045 chtml20 = GET_CHTML20(pdoc);
2049 return chtml20->out;
2054 * It is a handler who processes the SELECT tag.
2056 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2057 * destination is specified.
2058 * @param node [i] The SELECT tag node is specified.
2059 * @return The conversion result is returned.
2062 s_chtml20_start_select_tag(void *pdoc, Node *child)
2069 chtml20 = GET_CHTML20(pdoc);
2077 for (attr = qs_get_attr(doc,child);
2079 attr = qs_get_next_attr(doc,attr)) {
2084 nm = qs_get_attr_name(doc,attr);
2085 val = qs_get_attr_value(doc,attr);
2090 if (strcasecmp(nm, "size") == 0) {
2091 /*--------------------------------------------------------------------*/
2092 /* CHTML 1.0 version 2.0 */
2093 /*--------------------------------------------------------------------*/
2094 size = apr_pstrdup(r->pool, val);
2100 if (strcasecmp(nm, "name") == 0) {
2101 /*--------------------------------------------------------------------*/
2102 /* CHTML 1.0 version 2.0 */
2103 /*--------------------------------------------------------------------*/
2104 name = apr_pstrdup(r->pool, val);
2110 if (strcasecmp(nm, "multiple") == 0) {
2111 /*--------------------------------------------------------------------*/
2112 /* CHTML 1.0 version 2.0 */
2113 /*--------------------------------------------------------------------*/
2135 return chtml20->out;
2140 * It is a handler who processes the SELECT tag.
2142 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2143 * destination is specified.
2144 * @param node [i] The SELECT tag node is specified.
2145 * @return The conversion result is returned.
2148 s_chtml20_end_select_tag(void *pdoc, Node *UNUSED(child))
2154 chtml20 = GET_CHTML20(pdoc);
2159 return chtml20->out;
2164 * It is a handler who processes the OPTION tag.
2166 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2167 * destination is specified.
2168 * @param node [i] The OPTION tag node is specified.
2169 * @return The conversion result is returned.
2172 s_chtml20_start_option_tag(void *pdoc, Node *child)
2179 chtml20 = GET_CHTML20(pdoc);
2183 char *selected = NULL;
2187 for (attr = qs_get_attr(doc,child);
2189 attr = qs_get_next_attr(doc,attr)) {
2194 nm = qs_get_attr_name(doc,attr);
2195 val = qs_get_attr_value(doc,attr);
2200 if (strcasecmp(nm, "selected") == 0) {
2201 /*--------------------------------------------------------------------*/
2202 /* CHTML 1.0 version 2.0 */
2203 /*--------------------------------------------------------------------*/
2204 selected = apr_pstrdup(r->pool, val);
2210 if (strcasecmp(nm, "value") == 0) {
2211 /*--------------------------------------------------------------------*/
2212 /* CHTML 1.0 version 2.0 */
2213 /*--------------------------------------------------------------------*/
2214 value = apr_pstrdup(r->pool, val);
2236 return chtml20->out;
2241 * It is a handler who processes the OPTION tag.
2243 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2244 * destination is specified.
2245 * @param node [i] The OPTION tag node is specified.
2246 * @return The conversion result is returned.
2249 s_chtml20_end_option_tag(void *pdoc, Node *UNUSED(child))
2255 chtml20 = GET_CHTML20(pdoc);
2261 return chtml20->out;
2266 * It is a handler who processes the DIV tag.
2268 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2269 * destination is specified.
2270 * @param node [i] The DIV tag node is specified.
2271 * @return The conversion result is returned.
2274 s_chtml20_start_div_tag(void *pdoc, Node *child)
2281 chtml20 = GET_CHTML20(pdoc);
2289 for (attr = qs_get_attr(doc,child);
2291 attr = qs_get_next_attr(doc,attr)) {
2296 nm = qs_get_attr_name(doc,attr);
2297 val = qs_get_attr_value(doc,attr);
2299 if (STRCASEEQ('a','A',"align", nm)) {
2300 /*----------------------------------------------------------------------*/
2301 /* CHTML 1.0 (W3C version 3.2) */
2302 /*----------------------------------------------------------------------*/
2303 align = apr_pstrdup(r->pool, val);
2313 return chtml20->out;
2318 * It is a handler who processes the DIV tag.
2320 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2321 * destination is specified.
2322 * @param node [i] The DIV tag node is specified.
2323 * @return The conversion result is returned.
2326 s_chtml20_end_div_tag(void *pdoc, Node *UNUSED(child))
2332 chtml20 = GET_CHTML20(pdoc);
2337 return chtml20->out;
2342 * It is a handler who processes the H1 tag.
2344 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2345 * destination is specified.
2346 * @param node [i] The H1 tag node is specified.
2347 * @return The conversion result is returned.
2350 s_chtml20_start_h1_tag(void *pdoc, Node *UNUSED(node))
2356 chtml20 = GET_CHTML20(pdoc);
2361 return chtml20->out;
2366 * It is a handler who processes the H1 tag.
2368 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2369 * destination is specified.
2370 * @param node [i] The H1 tag node is specified.
2371 * @return The conversion result is returned.
2374 s_chtml20_end_h1_tag(void *pdoc, Node *UNUSED(child))
2380 chtml20 = GET_CHTML20(pdoc);
2385 return chtml20->out;
2390 * It is a handler who processes the H2 tag.
2392 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2393 * destination is specified.
2394 * @param node [i] The H2 tag node is specified.
2395 * @return The conversion result is returned.
2398 s_chtml20_start_h2_tag(void *pdoc, Node *UNUSED(node))
2404 chtml20 = GET_CHTML20(pdoc);
2409 return chtml20->out;
2414 * It is a handler who processes the H2 tag.
2416 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2417 * destination is specified.
2418 * @param node [i] The H2 tag node is specified.
2419 * @return The conversion result is returned.
2422 s_chtml20_end_h2_tag(void *pdoc, Node *UNUSED(child))
2428 chtml20 = GET_CHTML20(pdoc);
2433 return chtml20->out;
2438 * It is a handler who processes the H3 tag.
2440 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2441 * destination is specified.
2442 * @param node [i] The H3 tag node is specified.
2443 * @return The conversion result is returned.
2446 s_chtml20_start_h3_tag(void *pdoc, Node *UNUSED(node))
2452 chtml20 = GET_CHTML20(pdoc);
2457 return chtml20->out;
2462 * It is a handler who processes the H3 tag.
2464 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2465 * destination is specified.
2466 * @param node [i] The H3 tag node is specified.
2467 * @return The conversion result is returned.
2470 s_chtml20_end_h3_tag(void *pdoc, Node *UNUSED(child))
2476 chtml20 = GET_CHTML20(pdoc);
2481 return chtml20->out;
2486 * It is a handler who processes the H4 tag.
2488 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2489 * destination is specified.
2490 * @param node [i] The H4 tag node is specified.
2491 * @return The conversion result is returned.
2494 s_chtml20_start_h4_tag(void *pdoc, Node *UNUSED(node))
2500 chtml20 = GET_CHTML20(pdoc);
2505 return chtml20->out;
2510 * It is a handler who processes the H4 tag.
2512 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2513 * destination is specified.
2514 * @param node [i] The H4 tag node is specified.
2515 * @return The conversion result is returned.
2518 s_chtml20_end_h4_tag(void *pdoc, Node *UNUSED(child))
2524 chtml20 = GET_CHTML20(pdoc);
2529 return chtml20->out;
2534 * It is a handler who processes the H5 tag.
2536 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2537 * destination is specified.
2538 * @param node [i] The H5 tag node is specified.
2539 * @return The conversion result is returned.
2542 s_chtml20_start_h5_tag(void *pdoc, Node *UNUSED(node))
2548 chtml20 = GET_CHTML20(pdoc);
2553 return chtml20->out;
2558 * It is a handler who processes the H5 tag.
2560 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2561 * destination is specified.
2562 * @param node [i] The H5 tag node is specified.
2563 * @return The conversion result is returned.
2566 s_chtml20_end_h5_tag(void *pdoc, Node *UNUSED(child))
2572 chtml20 = GET_CHTML20(pdoc);
2577 return chtml20->out;
2582 * It is a handler who processes the H6 tag.
2584 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2585 * destination is specified.
2586 * @param node [i] The H6 tag node is specified.
2587 * @return The conversion result is returned.
2590 s_chtml20_start_h6_tag(void *pdoc, Node *UNUSED(node))
2596 chtml20 = GET_CHTML20(pdoc);
2601 return chtml20->out;
2606 * It is a handler who processes the H6 tag.
2608 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2609 * destination is specified.
2610 * @param node [i] The H6 tag node is specified.
2611 * @return The conversion result is returned.
2614 s_chtml20_end_h6_tag(void *pdoc, Node *UNUSED(child))
2620 chtml20 = GET_CHTML20(pdoc);
2625 return chtml20->out;
2630 * It is a handler who processes the PRE tag.
2632 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2633 * destination is specified.
2634 * @param node [i] The PRE tag node is specified.
2635 * @return The conversion result is returned.
2638 s_chtml20_start_pre_tag(void *pdoc, Node *UNUSED(node))
2644 chtml20 = GET_CHTML20(pdoc);
2648 chtml20->pre_flag++;
2651 return chtml20->out;
2656 * It is a handler who processes the PRE tag.
2658 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2659 * destination is specified.
2660 * @param node [i] The PRE tag node is specified.
2661 * @return The conversion result is returned.
2664 s_chtml20_end_pre_tag(void *pdoc, Node *UNUSED(child))
2670 chtml20 = GET_CHTML20(pdoc);
2675 chtml20->pre_flag--;
2677 return chtml20->out;
2682 * It is a handler who processes the P tag.
2684 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2685 * destination is specified.
2686 * @param node [i] The P tag node is specified.
2687 * @return The conversion result is returned.
2690 s_chtml20_start_p_tag(void *pdoc, Node *UNUSED(node))
2696 chtml20 = GET_CHTML20(pdoc);
2701 return chtml20->out;
2706 * It is a handler who processes the P tag.
2708 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2709 * destination is specified.
2710 * @param node [i] The P tag node is specified.
2711 * @return The conversion result is returned.
2714 s_chtml20_end_p_tag(void *pdoc, Node *UNUSED(child))
2720 chtml20 = GET_CHTML20(pdoc);
2725 return chtml20->out;
2730 s_chtml20_chxjif_tag(void *pdoc, Node *node)
2737 chtml20 = GET_CHTML20(pdoc);
2741 for (child = qs_get_child_node(doc, node);
2743 child = qs_get_next_node(doc, child)) {
2745 s_chtml20_chxjif_tag(pdoc, child);
2753 * It is a handler who processes the TEXTARE tag.
2755 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2756 * destination is specified.
2757 * @param node [i] The TEXTAREA tag node is specified.
2758 * @return The conversion result is returned.
2761 s_chtml20_start_textarea_tag(void *pdoc, Node *node)
2768 chtml20 = GET_CHTML20(pdoc);
2772 chtml20->textarea_flag++;
2774 for (attr = qs_get_attr(doc,node);
2776 attr = qs_get_next_attr(doc,attr)) {
2781 name = qs_get_attr_name(doc,attr);
2782 value = qs_get_attr_value(doc,attr);
2787 if (strcasecmp(name, "name") == 0) {
2796 if (strcasecmp(name, "rows") == 0) {
2805 if (strcasecmp(name, "cols") == 0) {
2817 return chtml20->out;
2822 * It is a handler who processes the TEXTAREA tag.
2824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2825 * destination is specified.
2826 * @param node [i] The TEXTAREA tag node is specified.
2827 * @return The conversion result is returned.
2830 s_chtml20_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2836 chtml20 = GET_CHTML20(pdoc);
2840 W_L("</textarea>\r\n");
2841 chtml20->textarea_flag--;
2843 return chtml20->out;
2848 s_chtml20_text_tag(void *pdoc, Node *child)
2860 chtml20 = GET_CHTML20(pdoc);
2864 textval = qs_get_node_value(doc,child);
2865 textval = qs_trim_string(r->pool, textval);
2866 if (strlen(textval) == 0)
2867 return chtml20->out;
2869 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2870 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2872 tdst = qs_alloc_zero_byte_string(r);
2873 memset(one_byte, 0, sizeof(one_byte));
2876 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2877 if (is_sjis_kanji(textval[ii])) {
2878 one_byte[0] = textval[ii+0];
2879 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2880 one_byte[0] = textval[ii+1];
2881 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2885 if (chtml20->pre_flag) {
2886 one_byte[0] = textval[ii+0];
2887 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2890 if (chtml20->textarea_flag) {
2891 one_byte[0] = textval[ii+0];
2892 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2895 if (textval[ii] != '\r' && textval[ii] != '\n') {
2896 one_byte[0] = textval[ii+0];
2897 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2901 return chtml20->out;
2906 * It is a handler who processes the DL tag.
2908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2909 * destination is specified.
2910 * @param node [i] The DL tag node is specified.
2911 * @return The conversion result is returned.
2914 s_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
2920 chtml20 = GET_CHTML20(pdoc);
2925 return chtml20->out;
2930 * It is a handler who processes the DLtag.
2932 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2933 * destination is specified.
2934 * @param node [i] The DL tag node is specified.
2935 * @return The conversion result is returned.
2938 s_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
2944 chtml20 = GET_CHTML20(pdoc);
2949 return chtml20->out;
2954 * It is a handler who processes the DT tag.
2956 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2957 * destination is specified.
2958 * @param node [i] The DT tag node is specified.
2959 * @return The conversion result is returned.
2962 s_chtml20_start_dt_tag(void *pdoc, Node *UNUSED(child))
2968 chtml20 = GET_CHTML20(pdoc);
2973 return chtml20->out;
2978 * It is a handler who processes the DT tag.
2980 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2981 * destination is specified.
2982 * @param node [i] The DT tag node is specified.
2983 * @return The conversion result is returned.
2986 s_chtml20_end_dt_tag(void *pdoc, Node *UNUSED(child))
2992 chtml20 = GET_CHTML20(pdoc);
2997 return chtml20->out;
3002 * It is a handler who processes the DD tag.
3004 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3005 * destination is specified.
3006 * @param node [i] The DD tag node is specified.
3007 * @return The conversion result is returned.
3010 s_chtml20_start_dd_tag(void *pdoc, Node *UNUSED(child))
3016 chtml20 = GET_CHTML20(pdoc);
3021 return chtml20->out;
3026 * It is a handler who processes the DD tag.
3028 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3029 * destination is specified.
3030 * @param node [i] The DD tag node is specified.
3031 * @return The conversion result is returned.
3034 s_chtml20_end_dd_tag(void *pdoc, Node *UNUSED(child))
3040 chtml20 = GET_CHTML20(pdoc);
3045 return chtml20->out;