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_encoding.h"
19 #include "chxj_xhtml_mobile_1_0.h"
20 #include "chxj_hdml.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_str_util.h"
27 #define GET_XHTML(X) ((xhtml_t*)(X))
30 #define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(xhtml->conf); W_V(nlcode); } while (0)
36 static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
37 static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
38 static char *s_xhtml_1_0_start_p_tag (void *pdoc, Node *node);
39 static char *s_xhtml_1_0_end_p_tag (void *pdoc, Node *node);
40 static char *s_xhtml_1_0_start_pre_tag (void *pdoc, Node *node);
41 static char *s_xhtml_1_0_end_pre_tag (void *pdoc, Node *node);
42 static char *s_xhtml_1_0_start_ul_tag (void *pdoc, Node *node);
43 static char *s_xhtml_1_0_end_ul_tag (void *pdoc, Node *node);
44 static char *s_xhtml_1_0_start_h1_tag (void *pdoc, Node *node);
45 static char *s_xhtml_1_0_end_h1_tag (void *pdoc, Node *node);
46 static char *s_xhtml_1_0_start_h2_tag (void *pdoc, Node *node);
47 static char *s_xhtml_1_0_end_h2_tag (void *pdoc, Node *node);
48 static char *s_xhtml_1_0_start_h3_tag (void *pdoc, Node *node);
49 static char *s_xhtml_1_0_end_h3_tag (void *pdoc, Node *node);
50 static char *s_xhtml_1_0_start_h4_tag (void *pdoc, Node *node);
51 static char *s_xhtml_1_0_end_h4_tag (void *pdoc, Node *node);
52 static char *s_xhtml_1_0_start_h5_tag (void *pdoc, Node *node);
53 static char *s_xhtml_1_0_end_h5_tag (void *pdoc, Node *node);
54 static char *s_xhtml_1_0_start_h6_tag (void *pdoc, Node *node);
55 static char *s_xhtml_1_0_end_h6_tag (void *pdoc, Node *node);
56 static char *s_xhtml_1_0_start_ol_tag (void *pdoc, Node *node);
57 static char *s_xhtml_1_0_end_ol_tag (void *pdoc, Node *node);
58 static char *s_xhtml_1_0_start_li_tag (void *pdoc, Node *node);
59 static char *s_xhtml_1_0_end_li_tag (void *pdoc, Node *node);
60 static char *s_xhtml_1_0_start_meta_tag (void *pdoc, Node *node);
61 static char *s_xhtml_1_0_end_meta_tag (void *pdoc, Node *node);
62 static char *s_xhtml_1_0_start_head_tag (void *pdoc, Node *node);
63 static char *s_xhtml_1_0_end_head_tag (void *pdoc, Node *node);
64 static char *s_xhtml_1_0_start_title_tag (void *pdoc, Node *node);
65 static char *s_xhtml_1_0_end_title_tag (void *pdoc, Node *node);
66 static char *s_xhtml_1_0_start_base_tag (void *pdoc, Node *node);
67 static char *s_xhtml_1_0_end_base_tag (void *pdoc, Node *node);
68 static char *s_xhtml_1_0_start_body_tag (void *pdoc, Node *node);
69 static char *s_xhtml_1_0_end_body_tag (void *pdoc, Node *node);
70 static char *s_xhtml_1_0_start_a_tag (void *pdoc, Node *node);
71 static char *s_xhtml_1_0_end_a_tag (void *pdoc, Node *node);
72 static char *s_xhtml_1_0_start_br_tag (void *pdoc, Node *node);
73 static char *s_xhtml_1_0_end_br_tag (void *pdoc, Node *node);
74 static char *s_xhtml_1_0_start_tr_tag (void *pdoc, Node *node);
75 static char *s_xhtml_1_0_end_tr_tag (void *pdoc, Node *node);
76 static char *s_xhtml_1_0_start_font_tag (void *pdoc, Node *node);
77 static char *s_xhtml_1_0_end_font_tag (void *pdoc, Node *node);
78 static char *s_xhtml_1_0_start_form_tag (void *pdoc, Node *node);
79 static char *s_xhtml_1_0_end_form_tag (void *pdoc, Node *node);
80 static char *s_xhtml_1_0_start_input_tag (void *pdoc, Node *node);
81 static char *s_xhtml_1_0_end_input_tag (void *pdoc, Node *node);
82 static char *s_xhtml_1_0_start_center_tag (void *pdoc, Node *node);
83 static char *s_xhtml_1_0_end_center_tag (void *pdoc, Node *node);
84 static char *s_xhtml_1_0_start_hr_tag (void *pdoc, Node *node);
85 static char *s_xhtml_1_0_end_hr_tag (void *pdoc, Node *node);
86 static char *s_xhtml_1_0_start_img_tag (void *pdoc, Node *node);
87 static char *s_xhtml_1_0_end_img_tag (void *pdoc, Node *node);
88 static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
89 static char *s_xhtml_1_0_end_select_tag (void *pdoc, Node *node);
90 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
91 static char *s_xhtml_1_0_end_option_tag (void *pdoc, Node *node);
92 static char *s_xhtml_1_0_start_div_tag (void *pdoc, Node *node);
93 static char *s_xhtml_1_0_end_div_tag (void *pdoc, Node *node);
94 static char *s_xhtml_1_0_start_textarea_tag (void *pdoc, Node *node);
95 static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
96 static char *s_xhtml_1_0_start_b_tag (void *pdoc, Node *node);
97 static char *s_xhtml_1_0_end_b_tag (void *pdoc, Node *node);
98 static char *s_xhtml_1_0_chxjif_tag (void *pdoc, Node *node);
99 static char *s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *node);
100 static char *s_xhtml_1_0_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_xhtml_1_0_start_dir_tag (void *pdoc, Node *node);
102 static char *s_xhtml_1_0_end_dir_tag (void *pdoc, Node *node);
103 static char *s_xhtml_1_0_start_dl_tag (void *pdoc, Node *node);
104 static char *s_xhtml_1_0_end_dl_tag (void *pdoc, Node *node);
105 static char *s_xhtml_1_0_start_dt_tag (void *pdoc, Node *node);
106 static char *s_xhtml_1_0_end_dt_tag (void *pdoc, Node *node);
107 static char *s_xhtml_1_0_start_dd_tag (void *pdoc, Node *node);
108 static char *s_xhtml_1_0_end_dd_tag (void *pdoc, Node *node);
109 static char *s_xhtml_1_0_start_menu_tag (void *pdoc, Node *node);
110 static char *s_xhtml_1_0_end_menu_tag (void *pdoc, Node *node);
111 static char *s_xhtml_1_0_start_plaintext_tag (void *pdoc, Node *node);
112 static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
113 static char *s_xhtml_1_0_end_plaintext_tag (void *pdoc, Node *node);
114 static char *s_xhtml_1_0_start_blink_tag (void *pdoc, Node *node);
115 static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
116 static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
117 static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
118 static char *s_xhtml_1_0_newline_mark (void *pdoc, Node *node);
120 static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
122 static char *s_xhtml_1_0_text_tag(void *pdoc, Node *child);
125 tag_handler xhtml_handler[] = {
128 s_xhtml_1_0_start_html_tag,
129 s_xhtml_1_0_end_html_tag,
133 s_xhtml_1_0_start_meta_tag,
134 s_xhtml_1_0_end_meta_tag,
138 s_xhtml_1_0_start_textarea_tag,
139 s_xhtml_1_0_end_textarea_tag,
143 s_xhtml_1_0_start_p_tag,
144 s_xhtml_1_0_end_p_tag,
148 s_xhtml_1_0_start_pre_tag,
149 s_xhtml_1_0_end_pre_tag,
153 s_xhtml_1_0_start_ul_tag,
154 s_xhtml_1_0_end_ul_tag,
158 s_xhtml_1_0_start_li_tag,
159 s_xhtml_1_0_end_li_tag,
163 s_xhtml_1_0_start_ol_tag,
164 s_xhtml_1_0_end_ol_tag,
168 s_xhtml_1_0_start_h1_tag,
169 s_xhtml_1_0_end_h1_tag,
173 s_xhtml_1_0_start_h2_tag,
174 s_xhtml_1_0_end_h2_tag,
178 s_xhtml_1_0_start_h3_tag,
179 s_xhtml_1_0_end_h3_tag,
183 s_xhtml_1_0_start_h4_tag,
184 s_xhtml_1_0_end_h4_tag,
188 s_xhtml_1_0_start_h5_tag,
189 s_xhtml_1_0_end_h5_tag,
193 s_xhtml_1_0_start_h6_tag,
194 s_xhtml_1_0_end_h6_tag,
198 s_xhtml_1_0_start_head_tag,
199 s_xhtml_1_0_end_head_tag,
203 s_xhtml_1_0_start_title_tag,
204 s_xhtml_1_0_end_title_tag,
208 s_xhtml_1_0_start_base_tag,
209 s_xhtml_1_0_end_base_tag,
213 s_xhtml_1_0_start_body_tag,
214 s_xhtml_1_0_end_body_tag,
218 s_xhtml_1_0_start_a_tag,
219 s_xhtml_1_0_end_a_tag,
223 s_xhtml_1_0_start_br_tag,
224 s_xhtml_1_0_end_br_tag,
233 s_xhtml_1_0_start_tr_tag,
234 s_xhtml_1_0_end_tr_tag,
248 s_xhtml_1_0_start_font_tag,
249 s_xhtml_1_0_end_font_tag,
253 s_xhtml_1_0_start_form_tag,
254 s_xhtml_1_0_end_form_tag,
258 s_xhtml_1_0_start_input_tag,
259 s_xhtml_1_0_end_input_tag,
263 s_xhtml_1_0_start_center_tag,
264 s_xhtml_1_0_end_center_tag,
268 s_xhtml_1_0_start_hr_tag,
269 s_xhtml_1_0_end_hr_tag,
273 s_xhtml_1_0_start_img_tag,
274 s_xhtml_1_0_end_img_tag,
278 s_xhtml_1_0_start_select_tag,
279 s_xhtml_1_0_end_select_tag,
283 s_xhtml_1_0_start_option_tag,
284 s_xhtml_1_0_end_option_tag,
288 s_xhtml_1_0_start_div_tag,
289 s_xhtml_1_0_end_div_tag,
293 s_xhtml_1_0_chxjif_tag,
318 s_xhtml_1_0_text_tag,
328 s_xhtml_1_0_start_b_tag,
329 s_xhtml_1_0_end_b_tag,
338 s_xhtml_1_0_start_dt_tag,
339 s_xhtml_1_0_end_dt_tag,
353 s_xhtml_1_0_start_blockquote_tag,
354 s_xhtml_1_0_end_blockquote_tag,
358 s_xhtml_1_0_start_dir_tag,
359 s_xhtml_1_0_end_dir_tag,
363 s_xhtml_1_0_start_dl_tag,
364 s_xhtml_1_0_end_dl_tag,
368 s_xhtml_1_0_start_dd_tag,
369 s_xhtml_1_0_end_dd_tag,
373 s_xhtml_1_0_start_menu_tag,
374 s_xhtml_1_0_end_menu_tag,
378 s_xhtml_1_0_start_plaintext_tag,
379 s_xhtml_1_0_end_plaintext_tag,
383 s_xhtml_1_0_start_blink_tag,
384 s_xhtml_1_0_end_blink_tag,
388 s_xhtml_1_0_start_marquee_tag,
389 s_xhtml_1_0_end_marquee_tag,
393 s_xhtml_1_0_newline_mark,
399 * converts from CHTML to XHTML.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_xhtml_mobile_1_0(
414 chxjconvrule_entry *entryp,
423 DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
424 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
428 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
430 DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
434 /*--------------------------------------------------------------------------*/
435 /* The XHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_xhtml(&xhtml, &doc, r, spec);
439 xhtml.entryp = entryp;
440 xhtml.cookie = cookie;
442 chxj_set_content_type(r, "text/html; charset=Windows-31J");
444 /*--------------------------------------------------------------------------*/
445 /* The character string of the input is analyzed. */
446 /*--------------------------------------------------------------------------*/
447 qs_init_malloc(&doc);
448 qs_init_root_node(&doc);
450 ss = apr_pcalloc(r->pool, srclen + 1);
451 memset(ss, 0, srclen + 1);
452 memcpy(ss, src, srclen);
455 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
457 qs_parse_string(&doc,ss, strlen(ss));
459 chxj_buffered_write_init(r->pool, &doc.buf);
460 /*--------------------------------------------------------------------------*/
461 /* It converts it from CHTML to XHTML. */
462 /*--------------------------------------------------------------------------*/
463 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
464 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
465 dst = apr_pstrdup(r->pool, xhtml.out);
466 chxj_buffered_write_terminate(&doc.buf);
468 qs_all_free(&doc,QX_LOGMARK);
471 return apr_pstrdup(r->pool,ss);
475 dst = apr_psprintf(r->pool, "\n");
477 *dstlen = strlen(dst);
480 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
483 DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
489 * The XHTML structure is initialized.
491 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
492 * initialized is specified.
493 * @param doc [i] The Doc structure that should be set to the initialized
494 * HDML structure is specified.
495 * @param r [i] To use POOL, the pointer to request_rec is specified.
496 * @param spec [i] The pointer to the device_table
499 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
501 memset(doc, 0, sizeof(Doc));
502 memset(xhtml, 0, sizeof(xhtml_t));
507 xhtml->out = qs_alloc_zero_byte_string(r->pool);
508 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
509 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
514 * Corresponding EMOJI to a current character-code is retrieved.
515 * The substitution character string is stored in the rslt pointer if agreeing.
517 * @param xhtml [i] The pointer to the XHTML structure is specified.
518 * @param txt [i] The character string to want to examine whether it is
519 * EMOJI is specified.
520 * @param rslt [o] The pointer to the pointer that stores the result is
522 * @return When corresponding EMOJI exists, it returns it excluding 0.
525 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
538 DBG(r,"spec is NULL");
541 for (ee = xhtml->conf->emoji;
544 unsigned char hex1byte;
545 unsigned char hex2byte;
547 DBG(r,"emoji->imode is NULL");
551 if (ee->imode->string != NULL
552 && strlen(ee->imode->string) > 0
553 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
554 if (spec == NULL || spec->emoji_type == NULL) {
555 *rslt = apr_psprintf(r->pool,
558 return strlen(ee->imode->string);
561 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
562 *rslt = apr_psprintf(r->pool,
565 return strlen(ee->imode->string);
568 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
569 *rslt = apr_psprintf(r->pool,
572 return strlen(ee->imode->string);
575 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
576 *rslt = apr_psprintf(r->pool,
579 return strlen(ee->imode->string);
582 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
583 *rslt = apr_psprintf(r->pool,
586 return strlen(ee->imode->string);
589 *rslt = apr_psprintf(r->pool,
592 return strlen(ee->imode->string);
596 hex1byte = ee->imode->hex1byte & 0xff;
597 hex2byte = ee->imode->hex2byte & 0xff;
599 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
600 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
601 if (spec == NULL || spec->emoji_type == NULL) {
602 *rslt = apr_psprintf(r->pool,
603 "<img localsrc=\"%s\">",
608 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
609 *rslt = apr_psprintf(r->pool,
610 "<img localsrc=\"%s\">",
615 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
616 *rslt = apr_psprintf(r->pool,
617 "<img localsrc=\"%s\">",
622 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
623 *rslt = apr_psprintf(r->pool,
624 "<img localsrc=\"%s\">",
629 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
630 *rslt = apr_psprintf(r->pool,
631 "<img localsrc=\"%s\">",
636 *rslt = apr_psprintf(r->pool,
637 "<img localsrc=\"%s\">",
649 * It is a handler who processes the HTML tag.
651 * @param pdoc [i/o] The pointer to the XHTML structure at the output
652 * destination is specified.
653 * @param node [i] The HTML tag node is specified.
654 * @return The conversion result is returned.
657 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
659 xhtml_t *xhtml = GET_XHTML(pdoc);
661 Doc *doc = xhtml->doc;
663 /*--------------------------------------------------------------------------*/
664 /* Add XML Declare */
665 /*--------------------------------------------------------------------------*/
666 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>");
668 /*--------------------------------------------------------------------------*/
670 /*--------------------------------------------------------------------------*/
671 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"");
673 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">");
675 /*--------------------------------------------------------------------------*/
677 /*--------------------------------------------------------------------------*/
678 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
679 /*--------------------------------------------------------------------------*/
681 /*--------------------------------------------------------------------------*/
682 for (attr = qs_get_attr(doc,node);
684 attr = qs_get_next_attr(doc,attr)) {
685 char* name = qs_get_attr_name(doc,attr);
686 char* value = qs_get_attr_value(doc,attr);
687 if (STRCASEEQ('l','L',"lang", name)) {
692 else if (STRCASEEQ('v','V',"version", name)) {
693 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
702 * It is a handler who processes the HTML tag.
704 * @param pdoc [i/o] The pointer to the XHTML structure at the output
705 * destination is specified.
706 * @param node [i] The HTML tag node is specified.
707 * @return The conversion result is returned.
710 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
712 xhtml_t *xhtml = GET_XHTML(pdoc);
713 Doc *doc = xhtml->doc;
720 * It is a handler who processes the META tag.
722 * @param pdoc [i/o] The pointer to the XHTML structure at the output
723 * destination is specified.
724 * @param node [i] The META tag node is specified.
725 * @return The conversion result is returned.
728 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
730 xhtml_t *xhtml = GET_XHTML(pdoc);
732 Doc *doc = xhtml->doc;
733 int content_type_flag = 0;
736 /*--------------------------------------------------------------------------*/
738 /*--------------------------------------------------------------------------*/
739 for (attr = qs_get_attr(doc,node);
741 attr = qs_get_next_attr(doc,attr)) {
742 char *name = qs_get_attr_name(doc,attr);
743 char *value = qs_get_attr_value(doc,attr);
744 if (STRCASEEQ('n','N',"name", name) && value && *value) {
751 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
757 if (STRCASEEQ('c','C', "content-type", value)) {
758 content_type_flag = 1;
761 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
762 if (content_type_flag) {
766 W_L("text/html; charset=Windows-31J");
784 * It is a handler who processes the META tag.
786 * @param pdoc [i/o] The pointer to the XHTML structure at the output
787 * destination is specified.
788 * @param node [i] The META tag node is specified.
789 * @return The conversion result is returned.
792 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
794 xhtml_t *xhtml = GET_XHTML(pdoc);
801 * It is a handler who processes the HEAD tag.
803 * @param pdoc [i/o] The pointer to the XHTML structure at the output
804 * destination is specified.
805 * @param node [i] The HEAD tag node is specified.
806 * @return The conversion result is returned.
809 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
811 xhtml_t *xhtml = GET_XHTML(pdoc);
812 Doc *doc = xhtml->doc;
820 * It is a handler who processes the HEAD tag.
822 * @param pdoc [i/o] The pointer to the XHTML structure at the output
823 * destination is specified.
824 * @param node [i] The HEAD tag node is specified.
825 * @return The conversion result is returned.
828 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
830 xhtml_t *xhtml = GET_XHTML(pdoc);
831 Doc *doc = xhtml->doc;
839 * It is a handler who processes the TITLE tag.
841 * @param pdoc [i/o] The pointer to the XHTML structure at the output
842 * destination is specified.
843 * @param node [i] The TITLE tag node is specified.
844 * @return The conversion result is returned.
847 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
849 xhtml_t *xhtml = GET_XHTML(pdoc);
850 Doc *doc = xhtml->doc;
858 * It is a handler who processes the TITLE tag.
860 * @param pdoc [i/o] The pointer to the XHTML structure at the output
861 * destination is specified.
862 * @param node [i] The TITLE tag node is specified.
863 * @return The conversion result is returned.
866 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
868 xhtml_t *xhtml = GET_XHTML(pdoc);
869 Doc *doc = xhtml->doc;
878 * It is a handler who processes the BASE tag.
880 * @param pdoc [i/o] The pointer to the XHTML structure at the output
881 * destination is specified.
882 * @param node [i] The BASE tag node is specified.
883 * @return The conversion result is returned.
886 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
888 xhtml_t *xhtml = GET_XHTML(pdoc);
890 Doc *doc = xhtml->doc;
893 /*--------------------------------------------------------------------------*/
895 /*--------------------------------------------------------------------------*/
896 for (attr = qs_get_attr(doc,node);
898 attr = qs_get_next_attr(doc,attr)) {
899 char *name = qs_get_attr_name(doc,attr);
900 char *value = qs_get_attr_value(doc,attr);
901 if (STRCASEEQ('h','H',"href",name)) {
915 * It is a handler who processes the BASE tag.
917 * @param pdoc [i/o] The pointer to the XHTML structure at the output
918 * destination is specified.
919 * @param node [i] The BASE tag node is specified.
920 * @return The conversion result is returned.
923 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
925 xhtml_t *xhtml = GET_XHTML(pdoc);
932 * It is a handler who processes the BODY tag.
934 * @param pdoc [i/o] The pointer to the XHTML structure at the output
935 * destination is specified.
936 * @param node [i] The BODY tag node is specified.
937 * @return The conversion result is returned.
940 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
942 xhtml_t *xhtml = GET_XHTML(pdoc);
943 Doc *doc = xhtml->doc;
947 /*--------------------------------------------------------------------------*/
949 /*--------------------------------------------------------------------------*/
950 for (attr = qs_get_attr(doc,node);
952 attr = qs_get_next_attr(doc,attr)) {
953 char *name = qs_get_attr_name(doc,attr);
954 char *value = qs_get_attr_value(doc,attr);
955 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
960 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
965 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
970 else if (STRCASEEQ('a','A',"alink", name)) {
973 else if (STRCASEEQ('v','V',"vlink",name)) {
983 * It is a handler who processes the BODY tag.
985 * @param pdoc [i/o] The pointer to the XHTML structure at the output
986 * destination is specified.
987 * @param node [i] The BODY tag node is specified.
988 * @return The conversion result is returned.
991 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
993 xhtml_t *xhtml = GET_XHTML(pdoc);
994 Doc *doc = xhtml->doc;
1002 * It is a handler who processes the A tag.
1004 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1005 * destination is specified.
1006 * @param node [i] The A tag node is specified.
1007 * @return The conversion result is returned.
1010 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
1012 xhtml_t *xhtml = GET_XHTML(pdoc);
1013 Doc *doc = xhtml->doc;
1014 request_rec *r = doc->r;
1018 /*--------------------------------------------------------------------------*/
1019 /* Get Attributes */
1020 /*--------------------------------------------------------------------------*/
1021 for (attr = qs_get_attr(doc,node);
1023 attr = qs_get_next_attr(doc,attr)) {
1024 char* name = qs_get_attr_name(doc,attr);
1025 char* value = qs_get_attr_value(doc,attr);
1026 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1031 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1032 value = chxj_encoding_parameter(r, value);
1033 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1034 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1040 else if (STRCASEEQ('a','A',"accesskey", name)) {
1041 W_L(" accesskey=\"");
1045 else if (STRCASEEQ('c','C',"cti",name)) {
1048 else if (STRCASEEQ('i','I',"ijam", name)) {
1051 else if (STRCASEEQ('u','U',"utn", name)) {
1054 else if (STRCASEEQ('t','T',"telbook",name)) {
1057 else if (STRCASEEQ('k','K',"kana",name)) {
1060 else if (STRCASEEQ('e','E',"email",name)) {
1063 else if (STRCASEEQ('i','I',"ista",name)) {
1066 else if (STRCASEEQ('i','I',"ilet",name)) {
1069 else if (STRCASEEQ('i','I',"iswf",name)) {
1072 else if (STRCASEEQ('i','I',"irst",name)) {
1082 * It is a handler who processes the A tag.
1084 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1085 * destination is specified.
1086 * @param node [i] The A tag node is specified.
1087 * @return The conversion result is returned.
1090 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1092 xhtml_t *xhtml = GET_XHTML(pdoc);
1093 Doc *doc = xhtml->doc;
1102 * It is a handler who processes the BR tag.
1104 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1105 * destination is specified.
1106 * @param node [i] The BR tag node is specified.
1107 * @return The conversion result is returned.
1110 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1112 xhtml_t *xhtml = GET_XHTML(pdoc);
1113 Doc *doc = xhtml->doc;
1117 /*--------------------------------------------------------------------------*/
1118 /* Get Attributes */
1119 /*--------------------------------------------------------------------------*/
1120 for (attr = qs_get_attr(doc,node);
1122 attr = qs_get_next_attr(doc,attr)) {
1123 char *name = qs_get_attr_name(doc,attr);
1124 char *value = qs_get_attr_value(doc,attr);
1125 if (STRCASEEQ('c','C',"clear",name)) {
1126 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1140 * It is a handler who processes the BR tag.
1142 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1143 * destination is specified.
1144 * @param node [i] The BR tag node is specified.
1145 * @return The conversion result is returned.
1148 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1150 xhtml_t *xhtml = GET_XHTML(pdoc);
1157 * It is a handler who processes the TR tag.
1159 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1160 * destination is specified.
1161 * @param node [i] The TR tag node is specified.
1162 * @return The conversion result is returned.
1165 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1167 xhtml_t *xhtml = GET_XHTML(pdoc);
1168 Doc *doc = xhtml->doc;
1177 * It is a handler who processes the TR tag.
1179 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1180 * destination is specified.
1181 * @param node [i] The TR tag node is specified.
1182 * @return The conversion result is returned.
1185 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1187 xhtml_t *xhtml = GET_XHTML(pdoc);
1194 * It is a handler who processes the FONT tag.
1196 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1197 * destination is specified.
1198 * @param node [i] The FONT tag node is specified.
1199 * @return The conversion result is returned.
1202 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1204 xhtml_t *xhtml = GET_XHTML(pdoc);
1205 Doc *doc = xhtml->doc;
1210 /*=========================================================================*/
1211 /* Get Attributes */
1212 /*=========================================================================*/
1213 for (attr = qs_get_attr(doc,node);
1215 attr = qs_get_next_attr(doc,attr)) {
1216 char *name = qs_get_attr_name(doc,attr);
1217 char *value = qs_get_attr_value(doc,attr);
1218 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1219 color = apr_pstrdup(doc->buf.pool, value);
1221 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1222 size = apr_pstrdup(doc->buf.pool, value);
1226 W_L("<font color=\"");
1229 xhtml->font_color_flag++;
1232 xhtml->font_size_flag++;
1234 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1235 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1236 case '3': W_L("<span style=\"font-size: small\">"); break;
1237 case '4': W_L("<span style=\"font-size: medium\">"); break;
1238 case '5': W_L("<span style=\"font-size: large\">"); break;
1239 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1240 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1242 if (*(size + 1) == '1') {
1243 W_L("<span style=\"font-size: small\">");
1246 if (*(size + 1) == '2') {
1247 W_L("<span style=\"font-size: x-small\">");
1250 if (*(size + 1) == '3') {
1251 W_L("<span style=\"font-size: xx-small\">");
1254 xhtml->font_size_flag--;
1258 if (*(size + 1) == '1') {
1259 W_L("<span style=\"font-size: large\">");
1262 if (*(size + 1) == '2') {
1263 W_L("<span style=\"font-size: x-large\">");
1266 if (*(size + 1) == '3') {
1267 W_L("<span style=\"font-size: xx-large\">");
1270 xhtml->font_size_flag--;
1274 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1275 xhtml->font_size_flag--;
1283 * It is a handler who processes the FONT tag.
1285 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1286 * destination is specified.
1287 * @param node [i] The FONT tag node is specified.
1288 * @return The conversion result is returned.
1291 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1293 xhtml_t *xhtml = GET_XHTML(pdoc);
1294 Doc *doc = xhtml->doc;
1296 if (xhtml->font_size_flag) {
1298 xhtml->font_size_flag--;
1300 if (xhtml->font_color_flag) {
1302 xhtml->font_color_flag--;
1309 * It is a handler who processes the FORM tag.
1311 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1312 * destination is specified.
1313 * @param node [i] The FORM tag node is specified.
1314 * @return The conversion result is returned.
1317 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1319 xhtml_t *xhtml = GET_XHTML(pdoc);
1320 Doc *doc = xhtml->doc;
1321 request_rec *r = doc->r;
1323 char *new_hidden_tag = NULL;
1324 char *attr_action = NULL;
1325 char *attr_method = NULL;
1326 char *attr_name = NULL;
1328 /*--------------------------------------------------------------------------*/
1329 /* Get Attributes */
1330 /*--------------------------------------------------------------------------*/
1331 for (attr = qs_get_attr(doc,node);
1333 attr = qs_get_next_attr(doc,attr)) {
1334 char *name = qs_get_attr_name(doc,attr);
1335 char *value = qs_get_attr_value(doc,attr);
1336 if (STRCASEEQ('a','A',"action",name)) {
1337 attr_action = chxj_encoding_parameter(r, value);
1338 attr_action = chxj_add_cookie_parameter(r, attr_action, xhtml->cookie);
1340 else if (STRCASEEQ('m','M',"method",name)) {
1341 attr_method = apr_pstrdup(doc->pool, value);
1343 else if (STRCASEEQ('u','U',"utn",name)) {
1346 else if (STRCASEEQ('n','N',"name",name)) {
1347 attr_name = apr_pstrdup(doc->pool, value);
1351 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1356 q = strchr(attr_action, '?');
1358 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
1359 if (new_hidden_tag) {
1378 if (new_hidden_tag) {
1379 W_V(new_hidden_tag);
1386 * It is a handler who processes the FORM tag.
1388 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1389 * destination is specified.
1390 * @param node [i] The FORM tag node is specified.
1391 * @return The conversion result is returned.
1394 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1396 xhtml_t *xhtml = GET_XHTML(pdoc);
1397 Doc *doc = xhtml->doc;
1406 * It is a handler who processes the INPUT tag.
1408 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1409 * destination is specified.
1410 * @param node [i] The INPUT tag node is specified.
1411 * @return The conversion result is returned.
1414 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1416 xhtml_t *xhtml = GET_XHTML(pdoc);
1417 Doc *doc = xhtml->doc;
1418 request_rec *r = doc->r;
1419 char *max_length = NULL;
1423 char *istyle = NULL;
1425 char *checked = NULL;
1426 char *accesskey = NULL;
1429 /*--------------------------------------------------------------------------*/
1430 /* Get Attributes */
1431 /*--------------------------------------------------------------------------*/
1432 type = qs_get_type_attr(doc, node, doc->buf.pool);
1433 name = qs_get_name_attr(doc, node, doc->buf.pool);
1434 value = qs_get_value_attr(doc,node, doc->buf.pool);
1435 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1436 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1437 checked = qs_get_checked_attr(doc,node, doc->buf.pool);
1438 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1439 size = qs_get_size_attr(doc, node, doc->buf.pool);
1442 type = qs_trim_string(doc->buf.pool, type);
1443 if (type && (STRCASEEQ('t','T',"text", type) ||
1444 STRCASEEQ('p','P',"password",type) ||
1445 STRCASEEQ('c','C',"checkbox",type) ||
1446 STRCASEEQ('r','R',"radio", type) ||
1447 STRCASEEQ('h','H',"hidden", type) ||
1448 STRCASEEQ('s','S',"submit", type) ||
1449 STRCASEEQ('r','R',"reset", type))) {
1455 if (size && *size) {
1460 if (name && *name) {
1465 if (value && *value) {
1467 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1470 if (accesskey && *accesskey) {
1471 W_L(" accesskey=\"");
1475 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1476 char *fmt = qs_conv_istyle_to_format(r,istyle);
1477 if (max_length && *max_length) {
1479 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1480 if (max_length[ii] < '0' || max_length[ii] > '9') {
1481 max_length = apr_psprintf(r->pool, "0");
1486 if (strcmp(max_length, "0")) {
1487 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1499 if (max_length && *max_length) {
1500 if (chxj_chk_numeric(max_length) != 0) {
1501 max_length = apr_psprintf(r->pool, "0");
1503 if (strcmp(max_length, "0")) {
1504 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1509 /*--------------------------------------------------------------------------*/
1510 /* The figure is default for the password. */
1511 /*--------------------------------------------------------------------------*/
1512 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1519 W_L(" FORMAT=\"*N\"");
1523 W_L(" checked=\"checked\"");
1532 * It is a handler who processes the INPUT tag.
1534 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1535 * destination is specified.
1536 * @param node [i] The INPUT tag node is specified.
1537 * @return The conversion result is returned.
1540 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1542 xhtml_t *xhtml = GET_XHTML(pdoc);
1549 * It is a handler who processes the CENTER tag.
1551 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1552 * destination is specified.
1553 * @param node [i] The CENTER tag node is specified.
1554 * @return The conversion result is returned.
1557 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1559 xhtml_t *xhtml = GET_XHTML(pdoc);
1560 Doc *doc = xhtml->doc;
1568 * It is a handler who processes the CENTER tag.
1570 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1571 * destination is specified.
1572 * @param node [i] The CENTER tag node is specified.
1573 * @return The conversion result is returned.
1576 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1578 xhtml_t *xhtml = GET_XHTML(pdoc);
1579 Doc *doc = xhtml->doc;
1587 * It is a handler who processes the HR tag.
1589 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1590 * destination is specified.
1591 * @param node [i] The HR tag node is specified.
1592 * @return The conversion result is returned.
1595 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1597 xhtml_t *xhtml = GET_XHTML(pdoc);
1598 Doc *doc = xhtml->doc;
1603 for (attr = qs_get_attr(doc,node);
1605 attr = qs_get_next_attr(doc,attr)) {
1606 char *name = qs_get_attr_name(doc,attr);
1607 char *value = qs_get_attr_value(doc,attr);
1608 if (STRCASEEQ('a','A',"align", name)) {
1609 /*----------------------------------------------------------------------*/
1611 /*----------------------------------------------------------------------*/
1612 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1618 else if (STRCASEEQ('s','S',"size", name)) {
1619 /*----------------------------------------------------------------------*/
1621 /*----------------------------------------------------------------------*/
1622 if (value && *value) {
1628 else if (STRCASEEQ('w','W',"width", name)) {
1629 /*----------------------------------------------------------------------*/
1631 /*----------------------------------------------------------------------*/
1632 if (value && *value) {
1638 else if (STRCASEEQ('n','N',"noshade", name)) {
1639 /*----------------------------------------------------------------------*/
1641 /*----------------------------------------------------------------------*/
1644 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1645 /*----------------------------------------------------------------------*/
1647 /*----------------------------------------------------------------------*/
1659 * It is a handler who processes the HR tag.
1661 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1662 * destination is specified.
1663 * @param node [i] The HR tag node is specified.
1664 * @return The conversion result is returned.
1667 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1669 xhtml_t *xhtml = GET_XHTML(pdoc);
1676 * It is a handler who processes the PRE tag.
1678 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1679 * destination is specified.
1680 * @param node [i] The PRE tag node is specified.
1681 * @return The conversion result is returned.
1684 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1686 xhtml_t *xhtml = GET_XHTML(pdoc);
1687 Doc *doc = xhtml->doc;
1696 * It is a handler who processes the PRE tag.
1698 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1699 * destination is specified.
1700 * @param node [i] The PRE tag node is specified.
1701 * @return The conversion result is returned.
1704 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1706 xhtml_t *xhtml = GET_XHTML(pdoc);
1707 Doc *doc = xhtml->doc;
1717 * It is a handler who processes the P tag.
1719 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1720 * destination is specified.
1721 * @param node [i] The P tag node is specified.
1722 * @return The conversion result is returned.
1725 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1727 xhtml_t *xhtml = GET_XHTML(pdoc);
1728 Doc *doc = xhtml->doc;
1733 for (attr = qs_get_attr(doc,node);
1735 attr = qs_get_next_attr(doc,attr)) {
1736 char *nm = qs_get_attr_name(doc,attr);
1737 char *val = qs_get_attr_value(doc,attr);
1738 if (STRCASEEQ('a','A',"align", nm)) {
1739 /*----------------------------------------------------------------------*/
1740 /* CHTML 1.0 (W3C version 3.2) */
1741 /*----------------------------------------------------------------------*/
1742 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1743 align = apr_pstrdup(doc->buf.pool, val);
1759 * It is a handler who processes the P tag.
1761 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1762 * destination is specified.
1763 * @param node [i] The P tag node is specified.
1764 * @return The conversion result is returned.
1767 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1769 xhtml_t *xhtml = GET_XHTML(pdoc);
1770 Doc *doc = xhtml->doc;
1778 * It is a handler who processes the UL tag.
1780 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1781 * destination is specified.
1782 * @param node [i] The UL tag node is specified.
1783 * @return The conversion result is returned.
1786 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1788 xhtml_t *xhtml = GET_XHTML(pdoc);
1789 Doc *doc = xhtml->doc;
1792 /*--------------------------------------------------------------------------*/
1793 /* Get Attributes */
1794 /*--------------------------------------------------------------------------*/
1795 for (attr = qs_get_attr(doc,node);
1797 attr = qs_get_next_attr(doc,attr)) {
1798 char *name = qs_get_attr_name(doc,attr);
1799 char *value = qs_get_attr_value(doc,attr);
1800 if (STRCASEEQ('t','T',"type",name)) {
1801 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1814 * It is a handler who processes the UL tag.
1816 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1817 * destination is specified.
1818 * @param node [i] The UL tag node is specified.
1819 * @return The conversion result is returned.
1822 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1824 xhtml_t *xhtml = GET_XHTML(pdoc);
1825 Doc *doc = xhtml->doc;
1833 * It is a handler who processes the H1 tag.
1835 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1836 * destination is specified.
1837 * @param node [i] The H1 tag node is specified.
1838 * @return The conversion result is returned.
1841 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1843 xhtml_t *xhtml = GET_XHTML(pdoc);
1844 Doc *doc = xhtml->doc;
1848 for (attr = qs_get_attr(doc,node);
1850 attr = qs_get_next_attr(doc,attr)) {
1853 name = qs_get_attr_name(doc,attr);
1854 value = qs_get_attr_value(doc,attr);
1855 if (STRCASEEQ('a','A',"align", name)) {
1857 if (STRCASEEQ('l','L',"left",value)) {
1859 W_L("text-align:left");
1862 else if (STRCASEEQ('r','R',"right",value)) {
1864 W_L("text-align:right");
1867 else if (STRCASEEQ('c','C',"center",value)) {
1869 W_L("text-align:center");
1882 * It is a handler who processes the H1 tag.
1884 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1885 * destination is specified.
1886 * @param node [i] The H1 tag node is specified.
1887 * @return The conversion result is returned.
1890 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1892 xhtml_t *xhtml = GET_XHTML(pdoc);
1893 Doc *doc = xhtml->doc;
1901 * It is a handler who processes the H2 tag.
1903 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1904 * destination is specified.
1905 * @param node [i] The H2 tag node is specified.
1906 * @return The conversion result is returned.
1909 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1911 xhtml_t *xhtml = GET_XHTML(pdoc);
1912 Doc *doc = xhtml->doc;
1916 for (attr = qs_get_attr(doc,node);
1918 attr = qs_get_next_attr(doc,attr)) {
1921 name = qs_get_attr_name(doc,attr);
1922 value = qs_get_attr_value(doc,attr);
1923 if (STRCASEEQ('a','A',"align", name)) {
1925 if (STRCASEEQ('l','L',"left",value)) {
1927 W_L("text-align:left");
1930 else if (STRCASEEQ('r','R',"right",value)) {
1932 W_L("text-align:right");
1935 else if (STRCASEEQ('c','C',"center",value)) {
1937 W_L("text-align:center");
1950 * It is a handler who processes the H2 tag.
1952 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1953 * destination is specified.
1954 * @param node [i] The H2 tag node is specified.
1955 * @return The conversion result is returned.
1958 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1960 xhtml_t *xhtml = GET_XHTML(pdoc);
1961 Doc *doc = xhtml->doc;
1969 * It is a handler who processes the H3 tag.
1971 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1972 * destination is specified.
1973 * @param node [i] The H3 tag node is specified.
1974 * @return The conversion result is returned.
1977 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1979 xhtml_t *xhtml = GET_XHTML(pdoc);
1980 Doc *doc = xhtml->doc;
1984 for (attr = qs_get_attr(doc,node);
1986 attr = qs_get_next_attr(doc,attr)) {
1989 name = qs_get_attr_name(doc,attr);
1990 value = qs_get_attr_value(doc,attr);
1991 if (STRCASEEQ('a','A',"align", name)) {
1993 if (STRCASEEQ('l','L',"left",value)) {
1995 W_L("text-align:left");
1998 else if (STRCASEEQ('r','R',"right",value)) {
2000 W_L("text-align:right");
2003 else if (STRCASEEQ('c','C',"center",value)) {
2005 W_L("text-align:center");
2018 * It is a handler who processes the H3 tag.
2020 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2021 * destination is specified.
2022 * @param node [i] The H3 tag node is specified.
2023 * @return The conversion result is returned.
2026 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
2028 xhtml_t *xhtml = GET_XHTML(pdoc);
2029 Doc *doc = xhtml->doc;
2037 * It is a handler who processes the H4 tag.
2039 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2040 * destination is specified.
2041 * @param node [i] The H4 tag node is specified.
2042 * @return The conversion result is returned.
2045 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
2047 xhtml_t *xhtml = GET_XHTML(pdoc);
2048 Doc *doc = xhtml->doc;
2052 for (attr = qs_get_attr(doc,node);
2054 attr = qs_get_next_attr(doc,attr)) {
2057 name = qs_get_attr_name(doc,attr);
2058 value = qs_get_attr_value(doc,attr);
2059 if (STRCASEEQ('a','A',"align", name)) {
2061 if (STRCASEEQ('l','L',"left",value)) {
2063 W_L("text-align:left");
2066 else if (STRCASEEQ('r','R',"right",value)) {
2068 W_L("text-align:right");
2071 else if (STRCASEEQ('c','C',"center",value)) {
2073 W_L("text-align:center");
2086 * It is a handler who processes the H4 tag.
2088 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2089 * destination is specified.
2090 * @param node [i] The H4 tag node is specified.
2091 * @return The conversion result is returned.
2094 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2096 xhtml_t *xhtml = GET_XHTML(pdoc);
2097 Doc *doc = xhtml->doc;
2105 * It is a handler who processes the H5 tag.
2107 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2108 * destination is specified.
2109 * @param node [i] The H5 tag node is specified.
2110 * @return The conversion result is returned.
2113 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2115 xhtml_t *xhtml = GET_XHTML(pdoc);
2116 Doc *doc = xhtml->doc;
2120 for (attr = qs_get_attr(doc,node);
2122 attr = qs_get_next_attr(doc,attr)) {
2125 name = qs_get_attr_name(doc,attr);
2126 value = qs_get_attr_value(doc,attr);
2127 if (STRCASEEQ('a','A',"align", name)) {
2129 if (STRCASEEQ('l','L',"left",value)) {
2131 W_L("text-align:left");
2134 else if (STRCASEEQ('r','R',"right",value)) {
2136 W_L("text-align:right");
2139 else if (STRCASEEQ('c','C',"center",value)) {
2141 W_L("text-align:center");
2154 * It is a handler who processes the H5 tag.
2156 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2157 * destination is specified.
2158 * @param node [i] The H5 tag node is specified.
2159 * @return The conversion result is returned.
2162 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2164 xhtml_t *xhtml = GET_XHTML(pdoc);
2165 Doc *doc = xhtml->doc;
2173 * It is a handler who processes the H6 tag.
2175 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2176 * destination is specified.
2177 * @param node [i] The H6 tag node is specified.
2178 * @return The conversion result is returned.
2181 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2183 xhtml_t *xhtml = GET_XHTML(pdoc);
2184 Doc *doc = xhtml->doc;
2188 for (attr = qs_get_attr(doc,node);
2190 attr = qs_get_next_attr(doc,attr)) {
2193 name = qs_get_attr_name(doc,attr);
2194 value = qs_get_attr_value(doc,attr);
2195 if (STRCASEEQ('a','A',"align", name)) {
2197 if (STRCASEEQ('l','L',"left",value)) {
2199 W_L("text-align:left");
2202 else if (STRCASEEQ('r','R',"right",value)) {
2204 W_L("text-align:right");
2207 else if (STRCASEEQ('c','C',"center",value)) {
2209 W_L("text-align:center");
2222 * It is a handler who processes the H6 tag.
2224 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2225 * destination is specified.
2226 * @param node [i] The H6 tag node is specified.
2227 * @return The conversion result is returned.
2230 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2232 xhtml_t *xhtml = GET_XHTML(pdoc);
2233 Doc *doc = xhtml->doc;
2241 * It is a handler who processes the OL tag.
2243 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2244 * destination is specified.
2245 * @param node [i] The OL tag node is specified.
2246 * @return The conversion result is returned.
2249 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2251 xhtml_t *xhtml = GET_XHTML(pdoc);
2252 Doc *doc = xhtml->doc;
2256 /*--------------------------------------------------------------------------*/
2257 /* Get Attributes */
2258 /*--------------------------------------------------------------------------*/
2259 for (attr = qs_get_attr(doc,node);
2261 attr = qs_get_next_attr(doc,attr)) {
2262 char *name = qs_get_attr_name(doc,attr);
2263 char *value = qs_get_attr_value(doc,attr);
2264 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2269 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2281 * It is a handler who processes the OL tag.
2283 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2284 * destination is specified.
2285 * @param node [i] The OL tag node is specified.
2286 * @return The conversion result is returned.
2289 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2291 xhtml_t *xhtml = GET_XHTML(pdoc);
2292 Doc *doc = xhtml->doc;
2300 * It is a handler who processes the LI tag.
2302 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2303 * destination is specified.
2304 * @param node [i] The LI tag node is specified.
2305 * @return The conversion result is returned.
2308 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2310 xhtml_t *xhtml = GET_XHTML(pdoc);
2311 Doc *doc = xhtml->doc;
2315 /*--------------------------------------------------------------------------*/
2316 /* Get Attributes */
2317 /*--------------------------------------------------------------------------*/
2318 for (attr = qs_get_attr(doc,node);
2320 attr = qs_get_next_attr(doc,attr)) {
2321 char *name = qs_get_attr_name(doc,attr);
2322 char *value = qs_get_attr_value(doc,attr);
2323 if (STRCASEEQ('t','T',"type",name)) {
2324 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2330 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2342 ** It is a handler who processes the LI tag.
2344 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2345 * destination is specified.
2346 * @param node [i] The LI tag node is specified.
2347 * @return The conversion result is returned.
2350 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2352 xhtml_t *xhtml = GET_XHTML(pdoc);
2353 Doc *doc = xhtml->doc;
2360 * It is a handler who processes the IMG tag.
2362 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2363 * destination is specified.
2364 * @param node [i] The IMG tag node is specified.
2365 * @return The conversion result is returned.
2368 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2370 xhtml_t *xhtml = GET_XHTML(pdoc);
2371 Doc *doc = xhtml->doc;
2372 request_rec *r = doc->r;
2375 #ifndef IMG_NOT_CONVERT_FILENAME
2376 device_table *spec = xhtml->spec;
2380 /*--------------------------------------------------------------------------*/
2381 /* Get Attributes */
2382 /*--------------------------------------------------------------------------*/
2383 for (attr = qs_get_attr(doc,node);
2385 attr = qs_get_next_attr(doc,attr)) {
2386 char *name = qs_get_attr_name(doc,attr);
2387 char *value = qs_get_attr_value(doc,attr);
2389 if (STRCASEEQ('s','S',"src",name)) {
2390 value = chxj_encoding_parameter(r, value);
2391 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2393 value = apr_psprintf(r->pool,
2396 (strchr(value, '?')) ? '&' : '?',
2397 CHXJ_COOKIE_NOUPDATE_PARAM);
2399 #ifdef IMG_NOT_CONVERT_FILENAME
2409 char *vv = chxj_img_conv(r,spec,value);
2417 if (STRCASEEQ('a','A',"align",name)) {
2419 if (STRCASEEQ('t','T',"top", value) ||
2420 STRCASEEQ('m','M',"middle",value) ||
2421 STRCASEEQ('b','B',"bottom",value) ||
2422 STRCASEEQ('l','L',"left", value) ||
2423 STRCASEEQ('r','R',"right", value)) {
2428 else if (STRCASEEQ('c','C',"center", value)) {
2435 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2440 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2445 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2450 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2455 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2467 * It is a handler who processes the IMG tag.
2469 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2470 * destination is specified.
2471 * @param node [i] The IMG tag node is specified.
2472 * @return The conversion result is returned.
2475 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2477 xhtml_t *xhtml = GET_XHTML(pdoc);
2484 * It is a handler who processes the SELECT tag.
2486 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2487 * destination is specified.
2488 * @param node [i] The SELECT tag node is specified.
2489 * @return The conversion result is returned.
2492 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2494 xhtml_t *xhtml = GET_XHTML(pdoc);
2495 Doc *doc = xhtml->doc;
2498 char *multiple = NULL;
2503 for (attr = qs_get_attr(doc,child);
2505 attr = qs_get_next_attr(doc,attr)) {
2506 char *nm = qs_get_attr_name(doc,attr);
2507 char *val = qs_get_attr_value(doc,attr);
2508 if (STRCASEEQ('s','S',"size",nm)) {
2509 /*----------------------------------------------------------------------*/
2510 /* CHTML 1.0 version 2.0 */
2511 /*----------------------------------------------------------------------*/
2512 size = apr_pstrdup(doc->buf.pool, val);
2514 else if (STRCASEEQ('n','N',"name",nm)) {
2515 /*----------------------------------------------------------------------*/
2516 /* CHTML 1.0 version 2.0 */
2517 /*----------------------------------------------------------------------*/
2518 name = apr_pstrdup(doc->buf.pool, val);
2520 else if (STRCASEEQ('m','M',"multiple",nm)) {
2521 /*----------------------------------------------------------------------*/
2522 /* CHTML 1.0 version 2.0 */
2523 /*----------------------------------------------------------------------*/
2524 multiple = apr_pstrdup(doc->buf.pool, val);
2527 if (size && *size) {
2532 if (name && *name) {
2538 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2539 W_L(" multiple=\"true\"");
2547 * It is a handler who processes the SELECT tag.
2549 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2550 * destination is specified.
2551 * @param node [i] The SELECT tag node is specified.
2552 * @return The conversion result is returned.
2555 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2557 xhtml_t *xhtml = GET_XHTML(pdoc);
2558 Doc *doc = xhtml->doc;
2566 * It is a handler who processes the OPTION tag.
2568 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2569 * destination is specified.
2570 * @param node [i] The OPTION tag node is specified.
2571 * @return The conversion result is returned.
2574 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2576 xhtml_t *xhtml = GET_XHTML(pdoc);
2577 Doc *doc = xhtml->doc;
2580 char *selected = NULL;
2584 for (attr = qs_get_attr(doc,child);
2586 attr = qs_get_next_attr(doc,attr)) {
2587 char *nm = qs_get_attr_name(doc,attr);
2588 char *val = qs_get_attr_value(doc,attr);
2589 if (STRCASEEQ('s','S',"selected",nm)) {
2590 /* CHTML version 2.0 */
2591 selected = apr_pstrdup(doc->buf.pool, val);
2593 else if (STRCASEEQ('v','V',"value",nm)) {
2594 /* CHTML version 2.0 */
2595 value = apr_pstrdup(doc->buf.pool, val);
2598 if (value && *value) {
2604 W_L(" selected=\"selected\"");
2612 * It is a handler who processes the OPTION tag.
2614 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2615 * destination is specified.
2616 * @param node [i] The OPTION tag node is specified.
2617 * @return The conversion result is returned.
2620 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2622 xhtml_t *xhtml = GET_XHTML(pdoc);
2623 Doc *doc = xhtml->doc;
2631 * It is a handler who processes the DIV tag.
2633 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2634 * destination is specified.
2635 * @param node [i] The DIV tag node is specified.
2636 * @return The conversion result is returned.
2639 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2641 xhtml_t *xhtml = GET_XHTML(pdoc);
2642 Doc *doc = xhtml->doc;
2647 for (attr = qs_get_attr(doc,child);
2649 attr = qs_get_next_attr(doc,attr)) {
2650 char *nm = qs_get_attr_name(doc,attr);
2651 char *val = qs_get_attr_value(doc,attr);
2652 if (STRCASEEQ('a','A',"align",nm)) {
2653 /*=====================================================================*/
2654 /* CHTML version 3.2 */
2655 /*=====================================================================*/
2656 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2657 align = apr_pstrdup(doc->buf.pool, val);
2672 * It is a handler who processes the DIV tag.
2674 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2675 * destination is specified.
2676 * @param node [i] The DIV tag node is specified.
2677 * @return The conversion result is returned.
2680 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2682 xhtml_t *xhtml = GET_XHTML(pdoc);
2683 Doc *doc = xhtml->doc;
2690 * It is a handler who processes the B tag.
2692 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2693 * destination is specified.
2694 * @param node [i] The B tag node is specified.
2695 * @return The conversion result is returned.
2698 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2700 xhtml_t *xhtml = GET_XHTML(pdoc);
2701 Doc *doc = xhtml->doc;
2703 W_L("<div style=\"font-weight:bold\">");
2709 * It is a handler who processes the B tag.
2711 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2712 * destination is specified.
2713 * @param node [i] The B tag node is specified.
2714 * @return The conversion result is returned.
2717 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2719 xhtml_t *xhtml = GET_XHTML(pdoc);
2720 Doc *doc = xhtml->doc;
2728 * It is a handler who processes the CHXJ:IF tag.
2730 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2731 * destination is specified.
2732 * @param node [i] The CHXJ:IF tag node is specified.
2735 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2737 xhtml_t *xhtml = GET_XHTML(pdoc);
2738 Doc *doc = xhtml->doc;
2741 for (child = qs_get_child_node(doc, node);
2743 child = qs_get_next_node(doc, child)) {
2745 s_xhtml_1_0_chxjif_tag(xhtml, 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_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2763 xhtml_t *xhtml = GET_XHTML(pdoc);
2764 Doc *doc = xhtml->doc;
2767 xhtml->textarea_flag++;
2769 for (attr = qs_get_attr(doc,node);
2771 attr = qs_get_next_attr(doc,attr)) {
2772 char *name = qs_get_attr_name(doc,attr);
2773 char *value = qs_get_attr_value(doc,attr);
2774 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2779 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2784 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2789 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2790 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2795 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2796 W_L(" accesskey=\"");
2807 * It is a handler who processes the TEXTAREA tag.
2809 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2810 * destination is specified.
2811 * @param node [i] The TEXTAREA tag node is specified.
2812 * @return The conversion result is returned.
2815 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2817 xhtml_t *xhtml = GET_XHTML(pdoc);
2818 Doc *doc = xhtml->doc;
2821 xhtml->textarea_flag--;
2827 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2829 xhtml_t *xhtml = GET_XHTML(pdoc);
2830 Doc *doc = xhtml->doc;
2831 request_rec *r = doc->r;
2839 textval = qs_get_node_value(doc,child);
2840 if (strlen(textval) == 0) {
2844 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2845 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2847 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2848 memset(one_byte, 0, sizeof(one_byte));
2851 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2853 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2855 DBG(r,"[%s][%d]", out, rtn);
2856 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2860 if (is_sjis_kanji(textval[ii])) {
2861 one_byte[0] = textval[ii+0];
2862 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2863 one_byte[0] = textval[ii+1];
2864 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2867 else if (xhtml->pre_flag) {
2868 one_byte[0] = textval[ii+0];
2869 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2871 else if (xhtml->textarea_flag) {
2872 one_byte[0] = textval[ii+0];
2873 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2875 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2876 one_byte[0] = textval[ii+0];
2877 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2886 * It is a handler who processes the BLOCKQUOTE tag.
2888 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2889 * destination is specified.
2890 * @param node [i] The BLOCKQUOTE tag node is specified.
2891 * @return The conversion result is returned.
2894 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2896 xhtml_t *xhtml = GET_XHTML(pdoc);
2897 Doc *doc = xhtml->doc;
2898 W_L("<blockquote>");
2904 * It is a handler who processes the BLOCKQUOTE tag.
2906 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2907 * destination is specified.
2908 * @param node [i] The BLOCKQUOTE tag node is specified.
2909 * @return The conversion result is returned.
2912 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2914 xhtml_t *xhtml = GET_XHTML(pdoc);
2915 Doc *doc = xhtml->doc;
2916 W_L("</blockquote>");
2922 * It is a handler who processes the DIR tag.
2924 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2925 * destination is specified.
2926 * @param node [i] The DIR tag node is specified.
2927 * @return The conversion result is returned.
2930 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2932 xhtml_t *xhtml = GET_XHTML(pdoc);
2933 Doc *doc = xhtml->doc;
2936 for (attr = qs_get_attr(doc,node);
2938 attr = qs_get_next_attr(doc,attr)) {
2939 char *name = qs_get_attr_name(doc,attr);
2940 char *value = qs_get_attr_value(doc,attr);
2941 if (STRCASEEQ('t','T',"type",name)) {
2942 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2955 * It is a handler who processes the DIR tag.
2957 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2958 * destination is specified.
2959 * @param node [i] The DIR tag node is specified.
2960 * @return The conversion result is returned.
2963 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2965 xhtml_t *xhtml = GET_XHTML(pdoc);
2966 Doc *doc = xhtml->doc;
2973 * It is a handler who processes the DL tag.
2975 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2976 * destination is specified.
2977 * @param node [i] The DL tag node is specified.
2978 * @return The conversion result is returned.
2981 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2983 xhtml_t *xhtml = GET_XHTML(pdoc);
2984 Doc *doc = xhtml->doc;
2991 * It is a handler who processes the DL tag.
2993 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2994 * destination is specified.
2995 * @param node [i] The DL tag node is specified.
2996 * @return The conversion result is returned.
2999 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
3001 xhtml_t *xhtml = GET_XHTML(pdoc);
3002 Doc *doc = xhtml->doc;
3009 * It is a handter who processes the DT tag.
3011 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3012 * destination is specified.
3013 * @param node [i] The DT tag node is specified.
3014 * @return The conversion result is returned.
3017 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
3019 xhtml_t *xhtml = GET_XHTML(pdoc);
3020 Doc *doc = xhtml->doc;
3027 * It is a handter who processes the DT tag.
3029 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3030 * destination is specified.
3031 * @param node [i] The DT tag node is specified.
3032 * @return The conversion result is returned.
3035 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
3037 xhtml_t *xhtml = GET_XHTML(pdoc);
3038 Doc *doc = xhtml->doc;
3045 * It is a handder who processes the DD tag.
3047 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3048 * destination is specified.
3049 * @param node [i] The DD tag node is specified.
3050 * @return The conversion result is returned.
3053 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
3055 xhtml_t *xhtml = GET_XHTML(pdoc);
3056 Doc *doc = xhtml->doc;
3063 * It is a handder who processes the DD tag.
3065 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3066 * destination is specified.
3067 * @param node [i] The DD tag node is specified.
3068 * @return The conversion result is returned.
3071 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
3073 xhtml_t *xhtml = GET_XHTML(pdoc);
3074 Doc *doc = xhtml->doc;
3081 * It is a handler who processes the MENU tag.
3083 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3084 * destination is specified.
3085 * @param node [i] The MENU tag node is specified.
3086 * @return The conversion result is returned.
3089 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
3091 xhtml_t *xhtml = GET_XHTML(pdoc);
3092 Doc *doc = xhtml->doc;
3095 /*--------------------------------------------------------------------------*/
3096 /* Get Attributes */
3097 /*--------------------------------------------------------------------------*/
3098 for (attr = qs_get_attr(doc,node);
3100 attr = qs_get_next_attr(doc,attr)) {
3101 char *name = qs_get_attr_name(doc,attr);
3102 char *value = qs_get_attr_value(doc,attr);
3103 if (STRCASEEQ('t','T',"type",name)) {
3104 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3117 * It is a hanmenuer who processes the MENU tag.
3119 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3120 * destination is specified.
3121 * @param node [i] The MENU tag node is specified.
3122 * @return The conversion result is returned.
3125 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3127 xhtml_t *xhtml = GET_XHTML(pdoc);
3128 Doc *doc = xhtml->doc;
3135 * It is a handler who processes the PLAINTEXT tag.
3137 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3138 * destination is specified.
3139 * @param node [i] The PLAINTEXT tag node is specified.
3140 * @return The conversion result is returned.
3143 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3145 xhtml_t *xhtml = GET_XHTML(pdoc);
3146 Doc *doc = xhtml->doc;
3148 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3153 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3155 xhtml_t *xhtml = GET_XHTML(pdoc);
3156 Doc *doc = xhtml->doc;
3158 for (child = qs_get_child_node(doc, node);
3160 child = qs_get_next_node(doc, child)) {
3162 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3169 * It is a handler who processes the PLAINTEXT tag.
3171 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The PLAINTEXT tag node is specified.
3174 * @return The conversion result is returned.
3177 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3179 xhtml_t *xhtml = GET_XHTML(pdoc);
3180 Doc *doc = xhtml->doc;
3181 W_L("</plaintext>");
3187 * It is a hanblinker who processes the BLINK tag.
3189 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3190 * destination is specified.
3191 * @param node [i] The BLINK tag node is specified.
3192 * @return The conversion result is returned.
3195 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3197 xhtml_t *xhtml = GET_XHTML(pdoc);
3198 Doc *doc = xhtml->doc;
3205 * It is a hanblinker who processes the BLINK tag.
3207 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3208 * destination is specified.
3209 * @param node [i] The BLINK tag node is specified.
3210 * @return The conversion result is returned.
3213 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3215 xhtml_t *xhtml = GET_XHTML(pdoc);
3216 Doc *doc = xhtml->doc;
3223 * It is a handler who processes the MARQUEE tag.
3225 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3226 * destination is specified.
3227 * @param node [i] The MARQUEE tag node is specified.
3228 * @return The conversion result is returned.
3231 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3233 xhtml_t *xhtml = GET_XHTML(pdoc);
3234 Doc *doc = xhtml->doc;
3237 /*--------------------------------------------------------------------------*/
3238 /* Get Attributes */
3239 /*--------------------------------------------------------------------------*/
3240 for (attr = qs_get_attr(doc,node);
3242 attr = qs_get_next_attr(doc,attr)) {
3243 char *name = qs_get_attr_name(doc,attr);
3244 char *value = qs_get_attr_value(doc,attr);
3245 if (STRCASEEQ('d','D',"direction", name)) {
3246 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3247 W_L(" direction=\"");
3252 else if (STRCASEEQ('b','B',"behavior",name)) {
3253 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3254 W_L(" behavior=\"");
3259 else if (STRCASEEQ('l','L',"loop",name)) {
3260 if (value && *value) {
3266 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3267 if (value && *value) {
3280 * It is a handler who processes the MARQUEE tag.
3282 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3283 * destination is specified.
3284 * @param node [i] The MARQUEE tag node is specified.
3285 * @return The conversion result is returned.
3288 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3290 xhtml_t *xhtml = GET_XHTML(pdoc);
3291 Doc *doc = xhtml->doc;
3298 * It is handler who processes the New Line Code.
3301 s_xhtml_1_0_newline_mark(void *pdoc, Node *UNUSED(node))
3303 xhtml_t *xhtml = GET_XHTML(pdoc);
3304 Doc *doc = xhtml->doc;