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_chtml10.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_cookie.h"
23 #include "chxj_encoding.h"
24 #include "chxj_buffered_write.h"
26 #define GET_CHTML10(X) ((chtml10_t *)(X))
27 #define W_L(X) do { chtml10->out = BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, (X)); } while(0)
28 #define W_V(X) do { chtml10->out = (X) ? BUFFERED_WRITE_VALUE(chtml10->out, &doc->buf, (X)) \
29 : BUFFERED_WRITE_LITERAL(chtml10->out, &doc->buf, ""); } while(0)
31 static char *s_chtml10_start_html_tag (void *pdoc, Node *node);
32 static char *s_chtml10_end_html_tag (void *pdoc, Node *node);
33 static char *s_chtml10_start_meta_tag (void *pdoc, Node *node);
34 static char *s_chtml10_end_meta_tag (void *pdoc, Node *node);
35 static char *s_chtml10_start_textarea_tag (void *pdoc, Node *node);
36 static char *s_chtml10_end_textarea_tag (void *pdoc, Node *node);
37 static char *s_chtml10_start_p_tag (void *pdoc, Node *node);
38 static char *s_chtml10_end_p_tag (void *pdoc, Node *node);
39 static char *s_chtml10_start_pre_tag (void *pdoc, Node *node);
40 static char *s_chtml10_end_pre_tag (void *pdoc, Node *node);
41 static char *s_chtml10_start_ul_tag (void *pdoc, Node *node);
42 static char *s_chtml10_end_ul_tag (void *pdoc, Node *node);
43 static char *s_chtml10_start_li_tag (void *pdoc, Node *node);
44 static char *s_chtml10_end_li_tag (void *pdoc, Node *node);
45 static char *s_chtml10_start_ol_tag (void *pdoc, Node *node);
46 static char *s_chtml10_end_ol_tag (void *pdoc, Node *node);
47 static char *s_chtml10_start_h1_tag (void *pdoc, Node *node);
48 static char *s_chtml10_end_h1_tag (void *pdoc, Node *node);
49 static char *s_chtml10_start_h2_tag (void *pdoc, Node *node);
50 static char *s_chtml10_end_h2_tag (void *pdoc, Node *node);
51 static char *s_chtml10_start_h3_tag (void *pdoc, Node *node);
52 static char *s_chtml10_end_h3_tag (void *pdoc, Node *node);
53 static char *s_chtml10_start_h4_tag (void *pdoc, Node *node);
54 static char *s_chtml10_end_h4_tag (void *pdoc, Node *node);
55 static char *s_chtml10_start_h5_tag (void *pdoc, Node *node);
56 static char *s_chtml10_end_h5_tag (void *pdoc, Node *node);
57 static char *s_chtml10_start_h6_tag (void *pdoc, Node *node);
58 static char *s_chtml10_end_h6_tag (void *pdoc, Node *node);
59 static char *s_chtml10_start_head_tag (void *pdoc, Node *node);
60 static char *s_chtml10_end_head_tag (void *pdoc, Node *node);
61 static char *s_chtml10_start_title_tag (void *pdoc, Node *node);
62 static char *s_chtml10_end_title_tag (void *pdoc, Node *node);
63 static char *s_chtml10_start_base_tag (void *pdoc, Node *node);
64 static char *s_chtml10_end_base_tag (void *pdoc, Node *node);
65 static char *s_chtml10_start_body_tag (void *pdoc, Node *node);
66 static char *s_chtml10_end_body_tag (void *pdoc, Node *node);
67 static char *s_chtml10_start_a_tag (void *pdoc, Node *node);
68 static char *s_chtml10_end_a_tag (void *pdoc, Node *node);
69 static char *s_chtml10_start_br_tag (void *pdoc, Node *node);
70 static char *s_chtml10_end_br_tag (void *pdoc, Node *node);
71 static char *s_chtml10_start_tr_tag (void *pdoc, Node *node);
72 static char *s_chtml10_end_tr_tag (void *pdoc, Node *node);
73 static char *s_chtml10_start_font_tag (void *pdoc, Node *node);
74 static char *s_chtml10_end_font_tag (void *pdoc, Node *node);
75 static char *s_chtml10_start_input_tag (void *pdoc, Node *node);
76 static char *s_chtml10_end_input_tag (void *pdoc, Node *node);
77 static char *s_chtml10_start_form_tag (void *pdoc, Node *node);
78 static char *s_chtml10_end_form_tag (void *pdoc, Node *node);
79 static char *s_chtml10_start_center_tag (void *pdoc, Node *node);
80 static char *s_chtml10_end_center_tag (void *pdoc, Node *node);
81 static char *s_chtml10_start_hr_tag (void *pdoc, Node *node);
82 static char *s_chtml10_end_hr_tag (void *pdoc, Node *node);
83 static char *s_chtml10_start_img_tag (void *pdoc, Node *node);
84 static char *s_chtml10_end_img_tag (void *pdoc, Node *node);
85 static char *s_chtml10_start_select_tag (void *pdoc, Node *node);
86 static char *s_chtml10_end_select_tag (void *pdoc, Node *node);
87 static char *s_chtml10_start_option_tag (void *pdoc, Node *node);
88 static char *s_chtml10_end_option_tag (void *pdoc, Node *node);
89 static char *s_chtml10_start_div_tag (void *pdoc, Node *node);
90 static char *s_chtml10_end_div_tag (void *pdoc, Node *node);
91 static char *s_chtml10_start_dl_tag (void *pdoc, Node *node);
92 static char *s_chtml10_end_dl_tag (void *pdoc, Node *node);
93 static char *s_chtml10_start_dt_tag (void *pdoc, Node *node);
94 static char *s_chtml10_end_dt_tag (void *pdoc, Node *node);
95 static char *s_chtml10_start_dd_tag (void *pdoc, Node *node);
96 static char *s_chtml10_end_dd_tag (void *pdoc, Node *node);
98 static void s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
100 static char *s_chtml10_chxjif_tag (void *pdoc, Node *node);
101 static char *s_chtml10_text (void *pdoc, Node *node);
103 tag_handler chtml10_handler[] = {
106 s_chtml10_start_html_tag,
107 s_chtml10_end_html_tag,
111 s_chtml10_start_meta_tag,
112 s_chtml10_end_meta_tag,
116 s_chtml10_start_textarea_tag,
117 s_chtml10_end_textarea_tag,
121 s_chtml10_start_p_tag,
126 s_chtml10_start_pre_tag,
127 s_chtml10_end_pre_tag,
131 s_chtml10_start_ul_tag,
132 s_chtml10_end_ul_tag,
136 s_chtml10_start_li_tag,
137 s_chtml10_end_li_tag,
141 s_chtml10_start_ol_tag,
142 s_chtml10_end_ol_tag,
146 s_chtml10_start_h1_tag,
147 s_chtml10_end_h1_tag,
151 s_chtml10_start_h2_tag,
152 s_chtml10_end_h2_tag,
156 s_chtml10_start_h3_tag,
157 s_chtml10_end_h3_tag,
161 s_chtml10_start_h4_tag,
162 s_chtml10_end_h4_tag,
166 s_chtml10_start_h5_tag,
167 s_chtml10_end_h5_tag,
171 s_chtml10_start_h6_tag,
172 s_chtml10_end_h6_tag,
176 s_chtml10_start_head_tag,
177 s_chtml10_end_head_tag,
181 s_chtml10_start_title_tag,
182 s_chtml10_end_title_tag,
186 s_chtml10_start_base_tag,
187 s_chtml10_end_base_tag,
191 s_chtml10_start_body_tag,
192 s_chtml10_end_body_tag,
196 s_chtml10_start_a_tag,
201 s_chtml10_start_br_tag,
202 s_chtml10_end_br_tag,
211 s_chtml10_start_tr_tag,
212 s_chtml10_end_tr_tag,
226 s_chtml10_start_font_tag,
227 s_chtml10_end_font_tag,
231 s_chtml10_start_form_tag,
232 s_chtml10_end_form_tag,
236 s_chtml10_start_input_tag,
237 s_chtml10_end_input_tag,
241 s_chtml10_start_center_tag,
242 s_chtml10_end_center_tag,
246 s_chtml10_start_hr_tag,
247 s_chtml10_end_hr_tag,
251 s_chtml10_start_img_tag,
252 s_chtml10_end_img_tag,
256 s_chtml10_start_select_tag,
257 s_chtml10_end_select_tag,
261 s_chtml10_start_option_tag,
262 s_chtml10_end_option_tag,
266 s_chtml10_start_div_tag,
267 s_chtml10_end_div_tag,
271 s_chtml10_chxjif_tag,
316 s_chtml10_start_dt_tag,
317 s_chtml10_end_dt_tag,
331 s_chtml10_start_dl_tag,
332 s_chtml10_end_dl_tag,
336 s_chtml10_start_dd_tag,
337 s_chtml10_end_dd_tag,
343 * converts from CHTML5.0 to CHTML1.0.
345 * @param r [i] Requet_rec is appointed.
346 * @param spec [i] The result of the device specification processing which
347 * was done in advance is appointed.
348 * @param src [i] The character string before the converting is appointed.
349 * @return The character string after the converting is returned.
352 chxj_convert_chtml10(
358 chxjconvrule_entry *entryp,
369 DBG(r, "start chxj_convert_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
371 /*--------------------------------------------------------------------------*/
373 /*--------------------------------------------------------------------------*/
375 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
377 DBG(r, "i found qrcode xml");
378 DBG(r, "end chxj_convert_chtml10()");
381 DBG(r,"not found qrcode xml");
383 /*--------------------------------------------------------------------------*/
384 /* The CHTML structure is initialized. */
385 /*--------------------------------------------------------------------------*/
386 s_init_chtml10(&chtml10, &doc, r, spec);
387 chtml10.entryp = entryp;
388 chtml10.cookie = cookie;
390 if (IS_SJIS_STRING(GET_SPEC_CHARSET(spec))) {
391 ap_set_content_type(r, "text/html; charset=Windows-31J");
394 ap_set_content_type(r, "text/html; charset=UTF-8");
397 /*--------------------------------------------------------------------------*/
398 /* The character string of the input is analyzed. */
399 /*--------------------------------------------------------------------------*/
400 qs_init_malloc(&doc);
401 qs_init_root_node(&doc);
403 ss = apr_pcalloc(r->pool, srclen + 1);
404 memset(ss, 0, srclen + 1);
405 memcpy(ss, src, srclen);
408 chxj_dump_out("[src] CHTML -> CHTML1.0", ss, srclen);
411 qs_parse_string(&doc,ss, strlen(ss));
413 if (! chxj_buffered_write_init(r->pool, &doc.buf)) {
414 ERR(r, "failed: chxj_buffered_write_init()");
415 DBG(r, "end chxj_convert_chtml10()");
416 return apr_pstrdup(r->pool, ss);
419 /*--------------------------------------------------------------------------*/
420 /* It converts it from CHTML to CHTML. */
421 /*--------------------------------------------------------------------------*/
422 chxj_node_convert(spec,r,(void *)&chtml10, &doc, qs_get_root(&doc), 0);
424 /*--------------------------------------------------------------------------*/
425 /* flush buffer AND terminate. */
426 /*--------------------------------------------------------------------------*/
427 chtml10.out = chxj_buffered_write_flush(chtml10.out, &doc.buf);
428 dst = apr_pstrdup(r->pool, chtml10.out);
429 chxj_buffered_write_terminate(&doc.buf);
431 qs_all_free(&doc,QX_LOGMARK);
433 DBG(r, "end chxj_convert_chtml10()");
434 return apr_pstrdup(r->pool,ss);
437 if (strlen(dst) == 0) {
438 dst = apr_psprintf(r->pool, "\n");
440 *dstlen = strlen(dst);
443 chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
446 DBG(r, "end chxj_convert_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
453 * The CHTML structure is initialized.
455 * @param chtml10 [i/o] The pointer to the HDML structure that wants to be
456 * initialized is specified.
457 * @param doc [i] The Doc structure that should be set to the initialized
458 * HDML structure is specified.
459 * @param r [i] To use POOL, the pointer to request_rec is specified.
460 * @param spec [i] The pointer to the device_table
469 memset(doc, 0, sizeof(Doc));
470 memset(chtml10, 0, sizeof(chtml10_t));
474 chtml10->spec = spec;
475 chtml10->out = qs_alloc_zero_byte_string(r);
476 chtml10->conf = ap_get_module_config(r->per_dir_config, &chxj_module);
477 chtml10->doc->parse_mode = PARSE_MODE_CHTML;
482 * It is a handler who processes the HTML tag.
484 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
485 * destination is specified.
486 * @param node [i] The HTML tag node is specified.
487 * @return The conversion result is returned.
490 s_chtml10_start_html_tag(void *pdoc, Node *UNUSED(node))
496 chtml10 = GET_CHTML10(pdoc);
500 /*--------------------------------------------------------------------------*/
502 /*--------------------------------------------------------------------------*/
510 * It is a handler who processes the HTML tag.
512 * @param pdoc [i/o] The pointer to the CHTML structure at the output
513 * destination is specified.
514 * @param node [i] The HTML tag node is specified.
515 * @return The conversion result is returned.
518 s_chtml10_end_html_tag(void *pdoc, Node *UNUSED(child))
525 chtml10 = GET_CHTML10(pdoc);
536 * It is a handler who processes the META tag.
538 * @param pdoc [i/o] The pointer to the CHTML structure at the output
539 * destination is specified.
540 * @param node [i] The META tag node is specified.
541 * @return The conversion result is returned.
544 s_chtml10_start_meta_tag(void *pdoc, Node *UNUSED(node))
548 chtml10 = GET_CHTML10(pdoc);
557 * It is a handler who processes the META tag.
559 * @param pdoc [i/o] The pointer to the CHTML structure at the output
560 * destination is specified.
561 * @param node [i] The META tag node is specified.
562 * @return The conversion result is returned.
565 s_chtml10_end_meta_tag(void *pdoc, Node *UNUSED(child))
569 chtml10 = GET_CHTML10(pdoc);
576 * It is a handler who processes the HEAD tag.
578 * @param pdoc [i/o] The pointer to the CHTML structure at the output
579 * destination is specified.
580 * @param node [i] The HEAD tag node is specified.
581 * @return The conversion result is returned.
584 s_chtml10_start_head_tag(void *pdoc, Node *UNUSED(node))
589 chtml10 = GET_CHTML10(pdoc);
599 * It is a handler who processes the HEAD tag.
601 * @param pdoc [i/o] The pointer to the CHTML structure at the output
602 * destination is specified.
603 * @param node [i] The HEAD tag node is specified.
604 * @return The conversion result is returned.
607 s_chtml10_end_head_tag(void *pdoc, Node *UNUSED(child))
612 chtml10 = GET_CHTML10(pdoc);
622 * It is a handler who processes the OL tag.
624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
625 * destination is specified.
626 * @param node [i] The OL tag node is specified.
627 * @return The conversion result is returned.
630 s_chtml10_start_ol_tag(void *pdoc, Node *UNUSED(node))
635 chtml10 = GET_CHTML10(pdoc);
645 * It is a handler who processes the OL tag.
647 * @param pdoc [i/o] The pointer to the CHTML structure at the output
648 * destination is specified.
649 * @param node [i] The OL tag node is specified.
650 * @return The conversion result is returned.
653 s_chtml10_end_ol_tag(void *pdoc, Node *UNUSED(child))
659 chtml10 = GET_CHTML10(pdoc);
670 * It is a handler who processes the UL tag.
672 * @param pdoc [i/o] The pointer to the CHTML structure at the output
673 * destination is specified.
674 * @param node [i] The UL tag node is specified.
675 * @return The conversion result is returned.
678 s_chtml10_start_ul_tag(void *pdoc, Node *UNUSED(node))
684 chtml10 = GET_CHTML10(pdoc);
695 * It is a handler who processes the UL tag.
697 * @param pdoc [i/o] The pointer to the CHTML structure at the output
698 * destination is specified.
699 * @param node [i] The UL tag node is specified.
700 * @return The conversion result is returned.
703 s_chtml10_end_ul_tag(void* pdoc, Node* UNUSED(child))
709 chtml10 = GET_CHTML10(pdoc);
720 * It is a handler who processes the LI tag.
722 * @param pdoc [i/o] The pointer to the CHTML structure at the output
723 * destination is specified.
724 * @param node [i] The LI tag node is specified.
725 * @return The conversion result is returned.
728 s_chtml10_start_li_tag(void *pdoc, Node *UNUSED(node))
734 chtml10 = GET_CHTML10(pdoc);
745 * It is a handler who processes the LI tag.
747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
748 * destination is specified.
749 * @param node [i] The LI tag node is specified.
750 * @return The conversion result is returned.
753 s_chtml10_end_li_tag(void *pdoc, Node *UNUSED(child))
759 chtml10 = GET_CHTML10(pdoc);
770 * It is a handler who processes the H1 tag.
772 * @param pdoc [i/o] The pointer to the CHTML structure at the output
773 * destination is specified.
774 * @param node [i] The H1 tag node is specified.
775 * @return The conversion result is returned.
778 s_chtml10_start_h1_tag(void *pdoc, Node *UNUSED(node))
784 chtml10 = GET_CHTML10(pdoc);
795 * It is a handler who processes the H1 tag.
797 * @param pdoc [i/o] The pointer to the CHTML structure at the output
798 * destination is specified.
799 * @param node [i] The H1 tag node is specified.
800 * @return The conversion result is returned.
803 s_chtml10_end_h1_tag(void *pdoc, Node *UNUSED(child))
809 chtml10 = GET_CHTML10(pdoc);
820 * It is a handler who processes the H2 tag.
822 * @param pdoc [i/o] The pointer to the CHTML structure at the output
823 * destination is specified.
824 * @param node [i] The H2 tag node is specified.
825 * @return The conversion result is returned.
828 s_chtml10_start_h2_tag(void *pdoc, Node *UNUSED(node))
834 chtml10 = GET_CHTML10(pdoc);
845 * It is a handler who processes the H2 tag.
847 * @param pdoc [i/o] The pointer to the CHTML structure at the output
848 * destination is specified.
849 * @param node [i] The H2 tag node is specified.
850 * @return The conversion result is returned.
853 s_chtml10_end_h2_tag(void *pdoc, Node *UNUSED(child))
859 chtml10 = GET_CHTML10(pdoc);
870 * It is a handler who processes the H3 tag.
872 * @param pdoc [i/o] The pointer to the CHTML structure at the output
873 * destination is specified.
874 * @param node [i] The H3 tag node is specified.
875 * @return The conversion result is returned.
878 s_chtml10_start_h3_tag(void *pdoc, Node *UNUSED(node))
884 chtml10 = GET_CHTML10(pdoc);
895 * It is a handler who processes the H3 tag.
897 * @param pdoc [i/o] The pointer to the CHTML structure at the output
898 * destination is specified.
899 * @param node [i] The H3 tag node is specified.
900 * @return The conversion result is returned.
903 s_chtml10_end_h3_tag(void *pdoc, Node *UNUSED(child))
909 chtml10 = GET_CHTML10(pdoc);
920 * It is a handler who processes the H4 tag.
922 * @param pdoc [i/o] The pointer to the CHTML structure at the output
923 * destination is specified.
924 * @param node [i] The H4 tag node is specified.
925 * @return The conversion result is returned.
928 s_chtml10_start_h4_tag(void *pdoc, Node *UNUSED(node))
934 chtml10 = GET_CHTML10(pdoc);
945 * It is a handler who processes the H4 tag.
947 * @param pdoc [i/o] The pointer to the CHTML structure at the output
948 * destination is specified.
949 * @param node [i] The H4 tag node is specified.
950 * @return The conversion result is returned.
953 s_chtml10_end_h4_tag(void *pdoc, Node *UNUSED(child))
959 chtml10 = GET_CHTML10(pdoc);
970 * It is a handler who processes the H5 tag.
972 * @param pdoc [i/o] The pointer to the CHTML structure at the output
973 * destination is specified.
974 * @param node [i] The H5 tag node is specified.
975 * @return The conversion result is returned.
978 s_chtml10_start_h5_tag(void *pdoc, Node *UNUSED(node))
984 chtml10 = GET_CHTML10(pdoc);
995 * It is a handler who processes the H5 tag.
997 * @param pdoc [i/o] The pointer to the CHTML structure at the output
998 * destination is specified.
999 * @param node [i] The H5 tag node is specified.
1000 * @return The conversion result is returned.
1003 s_chtml10_end_h5_tag(void *pdoc, Node *UNUSED(child))
1009 chtml10 = GET_CHTML10(pdoc);
1015 return chtml10->out;
1020 * It is a handler who processes the H6 tag.
1022 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1023 * destination is specified.
1024 * @param node [i] The H6 tag node is specified.
1025 * @return The conversion result is returned.
1028 s_chtml10_start_h6_tag(void *pdoc, Node *UNUSED(node))
1034 chtml10 = GET_CHTML10(pdoc);
1040 return chtml10->out;
1045 * It is a handler who processes the H6 tag.
1047 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1048 * destination is specified.
1049 * @param node [i] The H6 tag node is specified.
1050 * @return The conversion result is returned.
1053 s_chtml10_end_h6_tag(void *pdoc, Node *UNUSED(child))
1059 chtml10 = GET_CHTML10(pdoc);
1065 return chtml10->out;
1070 * It is a handler who processes the TITLE tag.
1072 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1073 * destination is specified.
1074 * @param node [i] The TITLE tag node is specified.
1075 * @return The conversion result is returned.
1078 s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
1084 chtml10 = GET_CHTML10(pdoc);
1090 return chtml10->out;
1095 * It is a handler who processes the TITLE tag.
1097 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1098 * destination is specified.
1099 * @param node [i] The TITLE tag node is specified.
1100 * @return The conversion result is returned.
1103 s_chtml10_end_title_tag(void *pdoc, Node *UNUSED(child))
1109 chtml10 = GET_CHTML10(pdoc);
1113 W_L("</title>\r\n");
1115 return chtml10->out;
1120 * It is a handler who processes the BASE tag.
1122 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1123 * destination is specified.
1124 * @param node [i] The BASE tag node is specified.
1125 * @return The conversion result is returned.
1128 s_chtml10_start_base_tag(void *pdoc, Node *node)
1135 chtml10 = GET_CHTML10(pdoc);
1142 /*--------------------------------------------------------------------------*/
1143 /* Get Attributes */
1144 /*--------------------------------------------------------------------------*/
1145 for (attr = qs_get_attr(doc,node);
1147 attr = qs_get_next_attr(doc,attr)) {
1151 name = qs_get_attr_name(doc,attr);
1152 value = qs_get_attr_value(doc,attr);
1154 if (STRCASEEQ('h','H',"href", name)) {
1163 return chtml10->out;
1168 * It is a handler who processes the BASE tag.
1170 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1171 * destination is specified.
1172 * @param node [i] The BASE tag node is specified.
1173 * @return The conversion result is returned.
1176 s_chtml10_end_base_tag(void *pdoc, Node *UNUSED(child))
1178 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1180 return chtml10->out;
1185 * It is a handler who processes the BODY tag.
1187 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1188 * destination is specified.
1189 * @param node [i] The BODY tag node is specified.
1190 * @return The conversion result is returned.
1193 s_chtml10_start_body_tag(void *pdoc, Node *node)
1200 chtml10 = GET_CHTML10(pdoc);
1206 /*--------------------------------------------------------------------------*/
1207 /* Get Attributes */
1208 /*--------------------------------------------------------------------------*/
1209 for (attr = qs_get_attr(doc,node);
1211 attr = qs_get_next_attr(doc,attr)) {
1213 name = qs_get_attr_name(doc,attr);
1218 if (strcasecmp(name, "alink") == 0) {
1219 /*----------------------------------------------------------------------*/
1221 /*----------------------------------------------------------------------*/
1228 if (strcasecmp(name, "bgcolor") == 0) {
1229 /*----------------------------------------------------------------------*/
1231 /*----------------------------------------------------------------------*/
1238 if (strcasecmp(name, "text") == 0) {
1239 /*----------------------------------------------------------------------*/
1241 /*----------------------------------------------------------------------*/
1248 if (strcasecmp(name, "link") == 0) {
1249 /*----------------------------------------------------------------------*/
1251 /*----------------------------------------------------------------------*/
1258 if (strcasecmp(name, "vlink") == 0) {
1259 /*----------------------------------------------------------------------*/
1261 /*----------------------------------------------------------------------*/
1273 return chtml10->out;
1278 * It is a handler who processes the BODY tag.
1280 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1281 * destination is specified.
1282 * @param node [i] The BODY tag node is specified.
1283 * @return The conversion result is returned.
1286 s_chtml10_end_body_tag(void *pdoc, Node *UNUSED(child))
1292 chtml10 = GET_CHTML10(pdoc);
1298 return chtml10->out;
1303 * It is a handler who processes the A tag.
1305 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1306 * destination is specified.
1307 * @param node [i] The A tag node is specified.
1308 * @return The conversion result is returned.
1311 s_chtml10_start_a_tag(void *pdoc, Node *node)
1318 chtml10 = GET_CHTML10(pdoc);
1324 /*--------------------------------------------------------------------------*/
1325 /* Get Attributes */
1326 /*--------------------------------------------------------------------------*/
1327 for (attr = qs_get_attr(doc,node);
1329 attr = qs_get_next_attr(doc,attr)) {
1334 name = qs_get_attr_name(doc,attr);
1335 value = qs_get_attr_value(doc,attr);
1340 if (strcasecmp(name, "name") == 0) {
1341 /*--------------------------------------------------------------------*/
1343 /*--------------------------------------------------------------------*/
1352 if (strcasecmp(name, "href") == 0) {
1353 /*--------------------------------------------------------------------*/
1355 /*--------------------------------------------------------------------*/
1356 value = chxj_encoding_parameter(r, value);
1357 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1366 if (strcasecmp(name, "accesskey") == 0) {
1367 /*--------------------------------------------------------------------*/
1369 /*--------------------------------------------------------------------*/
1370 W_L(" accesskey=\"");
1378 if (strcasecmp(name, "cti") == 0) {
1379 /*--------------------------------------------------------------------*/
1381 /*--------------------------------------------------------------------*/
1388 if (strcasecmp(name, "utn") == 0) {
1389 /*--------------------------------------------------------------------*/
1391 /*--------------------------------------------------------------------*/
1398 if (strcasecmp(name, "telbook") == 0) {
1399 /*--------------------------------------------------------------------*/
1401 /*--------------------------------------------------------------------*/
1408 if (strcasecmp(name, "kana") == 0) {
1409 /*--------------------------------------------------------------------*/
1411 /*--------------------------------------------------------------------*/
1418 if (strcasecmp(name, "email") == 0) {
1419 /*--------------------------------------------------------------------*/
1421 /*--------------------------------------------------------------------*/
1428 if (strcasecmp(name, "ista") == 0) {
1429 /*--------------------------------------------------------------------*/
1431 /*--------------------------------------------------------------------*/
1435 if (strcasecmp(name, "ilet") == 0) {
1436 /*--------------------------------------------------------------------*/
1438 /*--------------------------------------------------------------------*/
1442 if (strcasecmp(name, "iswf") == 0) {
1443 /*--------------------------------------------------------------------*/
1445 /*--------------------------------------------------------------------*/
1449 if (strcasecmp(name, "irst") == 0) {
1450 /*--------------------------------------------------------------------*/
1452 /*--------------------------------------------------------------------*/
1456 if (strcasecmp(name, "ijam") == 0) {
1457 /*--------------------------------------------------------------------*/
1459 /*--------------------------------------------------------------------*/
1471 return chtml10->out;
1476 * It is a handler who processes the A tag.
1478 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1479 * destination is specified.
1480 * @param node [i] The A tag node is specified.
1481 * @return The conversion result is returned.
1484 s_chtml10_end_a_tag(void *pdoc, Node *UNUSED(child))
1490 chtml10 = GET_CHTML10(pdoc);
1496 return chtml10->out;
1501 * It is a handler who processes the BR tag.
1503 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1504 * destination is specified.
1505 * @param node [i] The BR tag node is specified.
1506 * @return The conversion result is returned.
1509 s_chtml10_start_br_tag(void *pdoc, Node *UNUSED(node))
1515 chtml10 = GET_CHTML10(pdoc);
1521 return chtml10->out;
1526 * It is a handler who processes the BR tag.
1528 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1529 * destination is specified.
1530 * @param node [i] The BR tag node is specified.
1531 * @return The conversion result is returned.
1534 s_chtml10_end_br_tag(void *pdoc, Node *UNUSED(child))
1536 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1538 return chtml10->out;
1543 * It is a handler who processes the TR tag.
1545 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1546 * destination is specified.
1547 * @param node [i] The TR tag node is specified.
1548 * @return The conversion result is returned.
1551 s_chtml10_start_tr_tag(void *pdoc, Node *UNUSED(node))
1553 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1555 return chtml10->out;
1560 * It is a handler who processes the TR tag.
1562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1563 * destination is specified.
1564 * @param node [i] The TR tag node is specified.
1565 * @return The conversion result is returned.
1568 s_chtml10_end_tr_tag(void *pdoc, Node *UNUSED(child))
1573 chtml10 = GET_CHTML10(pdoc);
1578 return chtml10->out;
1583 * It is a handler who processes the FONT tag.
1585 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1586 * destination is specified.
1587 * @param node [i] The FONT tag node is specified.
1588 * @return The conversion result is returned.
1591 s_chtml10_start_font_tag(void *pdoc, Node *UNUSED(node))
1593 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1597 return chtml10->out;
1602 * It is a handler who processes the FONT tag.
1604 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1605 * destination is specified.
1606 * @param node [i] The FONT tag node is specified.
1607 * @return The conversion result is returned.
1610 s_chtml10_end_font_tag(void *pdoc, Node *UNUSED(child))
1612 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1616 return chtml10->out;
1621 * It is a handler who processes the FORM tag.
1623 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1624 * destination is specified.
1625 * @param node [i] The FORM tag node is specified.
1626 * @return The conversion result is returned.
1629 s_chtml10_start_form_tag(void *pdoc, Node *node)
1636 chtml10 = GET_CHTML10(pdoc);
1642 /*--------------------------------------------------------------------------*/
1643 /* Get Attributes */
1644 /*--------------------------------------------------------------------------*/
1645 for (attr = qs_get_attr(doc,node);
1647 attr = qs_get_next_attr(doc,attr)) {
1651 name = qs_get_attr_name(doc,attr);
1652 value = qs_get_attr_value(doc,attr);
1657 if (strcasecmp(name, "action") == 0) {
1658 /*--------------------------------------------------------------------*/
1660 /*--------------------------------------------------------------------*/
1661 value = chxj_encoding_parameter(r, value);
1662 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
1671 if (strcasecmp(name, "method") == 0) {
1672 /*--------------------------------------------------------------------*/
1674 /*--------------------------------------------------------------------*/
1683 if (strcasecmp(name, "utn") == 0) {
1684 /*--------------------------------------------------------------------*/
1686 /*--------------------------------------------------------------------*/
1697 return chtml10->out;
1702 * It is a handler who processes the FORM tag.
1704 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1705 * destination is specified.
1706 * @param node [i] The FORM tag node is specified.
1707 * @return The conversion result is returned.
1710 s_chtml10_end_form_tag(void *pdoc, Node *UNUSED(child))
1715 chtml10 = GET_CHTML10(pdoc);
1720 return chtml10->out;
1725 * It is a handler who processes the INPUT tag.
1727 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1728 * destination is specified.
1729 * @param node [i] The INPUT tag node is specified.
1730 * @return The conversion result is returned.
1733 s_chtml10_start_input_tag(void *pdoc, Node *node)
1747 chtml10 = GET_CHTML10(pdoc);
1762 /*--------------------------------------------------------------------------*/
1763 /* Get Attributes */
1764 /*--------------------------------------------------------------------------*/
1766 type = qs_get_type_attr(doc, node, r);
1767 name = qs_get_name_attr(doc, node, r);
1768 value = qs_get_value_attr(doc,node,r);
1769 istyle = qs_get_istyle_attr(doc,node,r);
1770 max_length = qs_get_maxlength_attr(doc,node,r);
1771 checked = qs_get_checked_attr(doc,node,r);
1772 accesskey = qs_get_accesskey_attr(doc, node, r);
1773 size = qs_get_size_attr(doc, node, r);
1800 W_L(" accesskey=\"");
1806 /*------------------------------------------------------------------------*/
1808 /*------------------------------------------------------------------------*/
1811 /*--------------------------------------------------------------------------*/
1812 /* The figure is default for the password. */
1813 /*--------------------------------------------------------------------------*/
1815 W_L(" maxlength=\"");
1826 return chtml10->out;
1831 * It is a handler who processes the INPUT tag.
1833 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1834 * destination is specified.
1835 * @param node [i] The INPUT tag node is specified.
1836 * @return The conversion result is returned.
1839 s_chtml10_end_input_tag(void *pdoc, Node *UNUSED(child))
1841 chtml10_t *chtml10 = GET_CHTML10(pdoc);
1843 return chtml10->out;
1848 * It is a handler who processes the CENTER tag.
1850 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1851 * destination is specified.
1852 * @param node [i] The CENTER tag node is specified.
1853 * @return The conversion result is returned.
1856 s_chtml10_start_center_tag(void *pdoc, Node *UNUSED(node))
1861 chtml10 = GET_CHTML10(pdoc);
1866 return chtml10->out;
1871 * It is a handler who processes the CENTER tag.
1873 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1874 * destination is specified.
1875 * @param node [i] The CENTER tag node is specified.
1876 * @return The conversion result is returned.
1879 s_chtml10_end_center_tag(void *pdoc, Node *UNUSED(child))
1885 chtml10 = GET_CHTML10(pdoc);
1891 return chtml10->out;
1896 * It is a handler who processes the HR tag.
1898 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1899 * destination is specified.
1900 * @param node [i] The HR tag node is specified.
1901 * @return The conversion result is returned.
1904 s_chtml10_start_hr_tag(void *pdoc, Node *node)
1911 chtml10 = GET_CHTML10(pdoc);
1917 for (attr = qs_get_attr(doc,node);
1919 attr = qs_get_next_attr(doc,attr)) {
1924 name = qs_get_attr_name (doc,attr);
1925 value = qs_get_attr_value(doc,attr);
1930 if (strcasecmp(name, "align") == 0) {
1931 /*--------------------------------------------------------------------*/
1933 /*--------------------------------------------------------------------*/
1942 if (strcasecmp(name, "size") == 0) {
1943 /*--------------------------------------------------------------------*/
1945 /*--------------------------------------------------------------------*/
1954 if (strcasecmp(name, "width") == 0) {
1955 /*--------------------------------------------------------------------*/
1957 /*--------------------------------------------------------------------*/
1966 if (strcasecmp(name, "noshade") == 0) {
1967 /*--------------------------------------------------------------------*/
1969 /*--------------------------------------------------------------------*/
1976 if (strcasecmp(name, "color") == 0) {
1977 /*--------------------------------------------------------------------*/
1979 /*--------------------------------------------------------------------*/
1990 return chtml10->out;
1995 * It is a handler who processes the HR tag.
1997 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1998 * destination is specified.
1999 * @param node [i] The HR tag node is specified.
2000 * @return The conversion result is returned.
2003 s_chtml10_end_hr_tag(void *pdoc, Node *UNUSED(child))
2007 chtml10 = GET_CHTML10(pdoc);
2009 return chtml10->out;
2014 * It is a handler who processes the IMG tag.
2016 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2017 * destination is specified.
2018 * @param node [i] The IMG tag node is specified.
2019 * @return The conversion result is returned.
2022 s_chtml10_start_img_tag(void *pdoc, Node *node)
2028 #ifndef IMG_NOT_CONVERT_FILENAME
2032 chtml10 = GET_CHTML10(pdoc);
2033 #ifndef IMG_NOT_CONVERT_FILENAME
2034 spec = chtml10->spec;
2041 /*--------------------------------------------------------------------------*/
2042 /* Get Attributes */
2043 /*--------------------------------------------------------------------------*/
2044 for (attr = qs_get_attr(doc,node);
2046 attr = qs_get_next_attr(doc,attr)) {
2051 name = qs_get_attr_name (doc,attr);
2052 value = qs_get_attr_value(doc,attr);
2057 if (strcasecmp(name, "src") == 0) {
2058 /*--------------------------------------------------------------------*/
2060 /*--------------------------------------------------------------------*/
2061 #ifdef IMG_NOT_CONVERT_FILENAME
2062 value = chxj_encoding_parameter(r, value);
2063 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2065 value = apr_psprintf(r->pool,
2068 (strchr(value, '?')) ? '&' : '?',
2069 CHXJ_COOKIE_NOUPDATE_PARAM);
2075 value = chxj_img_conv(r, spec, value);
2076 value = chxj_encoding_parameter(r, value);
2077 value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
2079 value = apr_psprintf(r->pool,
2082 (strchr(value, '?')) ? '&' : '?',
2083 CHXJ_COOKIE_NOUPDATE_PARAM);
2094 if (strcasecmp(name, "align" ) == 0) {
2095 /*--------------------------------------------------------------------*/
2097 /*--------------------------------------------------------------------*/
2098 /*--------------------------------------------------------------------*/
2100 /*--------------------------------------------------------------------*/
2106 if (strcasecmp(name, "alt" ) == 0) {
2107 /*--------------------------------------------------------------------*/
2109 /*--------------------------------------------------------------------*/
2118 if (strcasecmp(name, "width" ) == 0) {
2119 /*--------------------------------------------------------------------*/
2121 /*--------------------------------------------------------------------*/
2130 if (strcasecmp(name, "height") == 0) {
2131 /*--------------------------------------------------------------------*/
2133 /*--------------------------------------------------------------------*/
2139 if (strcasecmp(name, "hspace") == 0) {
2140 /*--------------------------------------------------------------------*/
2142 /*--------------------------------------------------------------------*/
2151 if (strcasecmp(name, "vspace") == 0) {
2152 /*--------------------------------------------------------------------*/
2154 /*--------------------------------------------------------------------*/
2167 return chtml10->out;
2172 * It is a handler who processes the IMG tag.
2174 * @param chtml10 [i/o] The pointer to the CHTML structure at the output
2175 * destination is specified.
2176 * @param node [i] The IMG tag node is specified.
2177 * @return The conversion result is returned.
2180 s_chtml10_end_img_tag(void *pdoc, Node *UNUSED(child))
2184 chtml10 = GET_CHTML10(pdoc);
2186 return chtml10->out;
2191 * It is a handler who processes the SELECT tag.
2193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2194 * destination is specified.
2195 * @param node [i] The SELECT tag node is specified.
2196 * @return The conversion result is returned.
2199 s_chtml10_start_select_tag(void *pdoc, Node *child)
2209 chtml10 = GET_CHTML10(pdoc);
2217 for (attr = qs_get_attr(doc,child);
2219 attr = qs_get_next_attr(doc,attr)) {
2223 nm = qs_get_attr_name (doc,attr);
2224 val = qs_get_attr_value(doc,attr);
2229 if (strcasecmp(nm, "size") == 0) {
2230 /*--------------------------------------------------------------------*/
2231 /* CHTML 1.0 version 2.0 */
2232 /*--------------------------------------------------------------------*/
2233 size = apr_pstrdup(r->pool, val);
2239 if (strcasecmp(nm, "name") == 0) {
2240 /*--------------------------------------------------------------------*/
2241 /* CHTML 1.0 version 2.0 */
2242 /*--------------------------------------------------------------------*/
2243 name = apr_pstrdup(r->pool, val);
2249 if (strcasecmp(nm, "multiple") == 0) {
2250 /*--------------------------------------------------------------------*/
2251 /* CHTML 1.0 version 2.0 */
2252 /*--------------------------------------------------------------------*/
2276 return chtml10->out;
2281 * It is a handler who processes the SELECT tag.
2283 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2284 * destination is specified.
2285 * @param node [i] The SELECT tag node is specified.
2286 * @return The conversion result is returned.
2289 s_chtml10_end_select_tag(void *pdoc, Node *UNUSED(child))
2295 chtml10 = GET_CHTML10(pdoc);
2301 return chtml10->out;
2306 * It is a handler who processes the OPTION tag.
2308 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2309 * destination is specified.
2310 * @param node [i] The OPTION tag node is specified.
2311 * @return The conversion result is returned.
2314 s_chtml10_start_option_tag(void *pdoc, Node *child)
2324 chtml10 = GET_CHTML10(pdoc);
2332 for (attr = qs_get_attr(doc,child);
2334 attr = qs_get_next_attr(doc,attr)) {
2338 nm = qs_get_attr_name (doc,attr);
2339 val = qs_get_attr_value(doc,attr);
2344 if (strcasecmp(nm, "selected") == 0) {
2345 /*--------------------------------------------------------------------*/
2346 /* CHTML 1.0 version 2.0 */
2347 /*--------------------------------------------------------------------*/
2348 selected = apr_pstrdup(r->pool, val);
2354 if (strcasecmp(nm, "value") == 0) {
2355 /*--------------------------------------------------------------------*/
2356 /* CHTML 1.0 version 2.0 */
2357 /*--------------------------------------------------------------------*/
2358 value = apr_pstrdup(r->pool, val);
2382 return chtml10->out;
2387 * It is a handler who processes the OPTION tag.
2389 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2390 * destination is specified.
2391 * @param node [i] The OPTION tag node is specified.
2392 * @return The conversion result is returned.
2395 s_chtml10_end_option_tag(void *pdoc, Node *UNUSED(child))
2399 chtml10 = GET_CHTML10(pdoc);
2403 return chtml10->out;
2408 * It is a handler who processes the DIV tag.
2410 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2411 * destination is specified.
2412 * @param node [i] The DIV tag node is specified.
2413 * @return The conversion result is returned.
2416 s_chtml10_start_div_tag(void *pdoc, Node *child)
2424 chtml10 = GET_CHTML10(pdoc);
2431 for (attr = qs_get_attr(doc,child);
2433 attr = qs_get_next_attr(doc,attr)) {
2438 nm = qs_get_attr_name(doc,attr);
2439 val = qs_get_attr_value(doc,attr);
2441 if (STRCASEEQ('a','A',"align",nm)) {
2442 /*----------------------------------------------------------------------*/
2443 /* CHTML 1.0 (W3C version 3.2) */
2444 /*----------------------------------------------------------------------*/
2445 align = apr_pstrdup(r->pool, val);
2457 return chtml10->out;
2462 * It is a handler who processes the DIV tag.
2464 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2465 * destination is specified.
2466 * @param node [i] The DIV tag node is specified.
2467 * @return The conversion result is returned.
2470 s_chtml10_end_div_tag(void *pdoc, Node *UNUSED(child))
2476 chtml10 = GET_CHTML10(pdoc);
2482 return chtml10->out;
2487 * It is a handler who processes the CHXJ:IF tag.
2489 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2490 * destination is specified.
2491 * @param node [i] The CHXJ:IF tag node is specified.
2492 * @return The conversion result is returned.
2495 s_chtml10_chxjif_tag(void *pdoc, Node *node)
2502 chtml10 = GET_CHTML10(pdoc);
2506 for (child = qs_get_child_node(doc, node);
2508 child = qs_get_next_node(doc, child)) {
2510 s_chtml10_chxjif_tag(chtml10, child);
2513 return chtml10->out;
2518 * It is a handler who processes the PRE tag.
2520 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2521 * destination is specified.
2522 * @param node [i] The PRE tag node is specified.
2523 * @return The conversion result is returned.
2526 s_chtml10_start_pre_tag(void *pdoc, Node *UNUSED(node))
2532 chtml10 = GET_CHTML10(pdoc);
2536 chtml10->pre_flag++;
2539 return chtml10->out;
2544 * It is a handler who processes the PRE tag.
2546 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2547 * destination is specified.
2548 * @param node [i] The PRE tag node is specified.
2549 * @return The conversion result is returned.
2552 s_chtml10_end_pre_tag(void *pdoc, Node *UNUSED(child))
2558 chtml10 = GET_CHTML10(pdoc);
2563 chtml10->pre_flag--;
2565 return chtml10->out;
2570 * It is a handler who processes the P tag.
2572 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2573 * destination is specified.
2574 * @param node [i] The P tag node is specified.
2575 * @return The conversion result is returned.
2578 s_chtml10_start_p_tag(void *pdoc, Node *UNUSED(node))
2584 chtml10 = GET_CHTML10(pdoc);
2590 return chtml10->out;
2595 * It is a handler who processes the P tag.
2597 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2598 * destination is specified.
2599 * @param node [i] The P tag node is specified.
2600 * @return The conversion result is returned.
2603 s_chtml10_end_p_tag(void *pdoc, Node *UNUSED(child))
2609 chtml10 = GET_CHTML10(pdoc);
2615 return chtml10->out;
2620 * It is a handler who processes the TEXTARE tag.
2622 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2623 * destination is specified.
2624 * @param node [i] The TEXTAREA tag node is specified.
2625 * @return The conversion result is returned.
2628 s_chtml10_start_textarea_tag(void *pdoc, Node *node)
2635 chtml10 = GET_CHTML10(pdoc);
2640 chtml10->textarea_flag++;
2643 for (attr = qs_get_attr(doc,node);
2645 attr = qs_get_next_attr(doc,attr)) {
2650 name = qs_get_attr_name (doc,attr);
2651 value = qs_get_attr_value(doc,attr);
2656 if (strcasecmp(name, "name") == 0) {
2665 if (strcasecmp(name, "rows") == 0) {
2674 if (strcasecmp(name, "cols") == 0) {
2688 return chtml10->out;
2693 * It is a handler who processes the TEXTAREA tag.
2695 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2696 * destination is specified.
2697 * @param node [i] The TEXTAREA tag node is specified.
2698 * @return The conversion result is returned.
2701 s_chtml10_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2707 chtml10 = GET_CHTML10(pdoc);
2711 W_L("</textarea>\r\n");
2712 chtml10->textarea_flag--;
2714 return chtml10->out;
2719 s_chtml10_text(void *pdoc, Node *child)
2731 chtml10 = GET_CHTML10(pdoc);
2735 textval = qs_get_node_value(doc,child);
2736 textval = qs_trim_string(r->pool, textval);
2738 if (strlen(textval) == 0)
2739 return chtml10->out;
2741 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2742 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2744 tdst = qs_alloc_zero_byte_string(r);
2745 memset(one_byte, 0, sizeof(one_byte));
2748 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2749 if (is_sjis_kanji(textval[ii])) {
2750 one_byte[0] = textval[ii+0];
2751 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2752 one_byte[0] = textval[ii+1];
2753 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2757 if (chtml10->pre_flag) {
2758 one_byte[0] = textval[ii+0];
2759 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2762 if (chtml10->textarea_flag) {
2763 one_byte[0] = textval[ii+0];
2764 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2767 if (textval[ii] != '\r' && textval[ii] != '\n') {
2768 one_byte[0] = textval[ii+0];
2769 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2775 return chtml10->out;
2781 * It is a handler who processes the DL tag.
2783 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2784 * destination is specified.
2785 * @param node [i] The DL tag node is specified.
2786 * @return The conversion result is returned.
2789 s_chtml10_start_dl_tag(void *pdoc, Node *UNUSED(child))
2795 chtml10 = GET_CHTML10(pdoc);
2801 return chtml10->out;
2806 * It is a handler who processes the DLtag.
2808 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2809 * destination is specified.
2810 * @param node [i] The DL tag node is specified.
2811 * @return The conversion result is returned.
2814 s_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
2819 chtml10 = GET_CHTML10(pdoc);
2824 return chtml10->out;
2829 * It is a handler who processes the DT tag.
2831 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2832 * destination is specified.
2833 * @param node [i] The DT tag node is specified.
2834 * @return The conversion result is returned.
2837 s_chtml10_start_dt_tag(void *pdoc, Node *UNUSED(child))
2842 chtml10 = GET_CHTML10(pdoc);
2847 return chtml10->out;
2852 * It is a handler who processes the DT tag.
2854 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2855 * destination is specified.
2856 * @param node [i] The DT tag node is specified.
2857 * @return The conversion result is returned.
2860 s_chtml10_end_dt_tag(void *pdoc, Node *UNUSED(child))
2865 chtml10 = GET_CHTML10(pdoc);
2870 return chtml10->out;
2875 * It is a handler who processes the DD tag.
2877 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2878 * destination is specified.
2879 * @param node [i] The DD tag node is specified.
2880 * @return The conversion result is returned.
2883 s_chtml10_start_dd_tag(void *pdoc, Node *UNUSED(child))
2888 chtml10 = GET_CHTML10(pdoc);
2893 return chtml10->out;
2898 * It is a handler who processes the DD tag.
2900 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2901 * destination is specified.
2902 * @param node [i] The DD tag node is specified.
2903 * @return The conversion result is returned.
2906 s_chtml10_end_dd_tag(void *pdoc, Node *UNUSED(child))
2912 chtml10 = GET_CHTML10(pdoc);
2918 return chtml10->out;