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"
26 #include "chxj_header_inf.h"
28 #define GET_XHTML(X) ((xhtml_t*)(X))
31 #define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(xhtml->conf); W_V(nlcode); } while (0)
37 static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
38 static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
39 static char *s_xhtml_1_0_start_p_tag (void *pdoc, Node *node);
40 static char *s_xhtml_1_0_end_p_tag (void *pdoc, Node *node);
41 static char *s_xhtml_1_0_start_pre_tag (void *pdoc, Node *node);
42 static char *s_xhtml_1_0_end_pre_tag (void *pdoc, Node *node);
43 static char *s_xhtml_1_0_start_ul_tag (void *pdoc, Node *node);
44 static char *s_xhtml_1_0_end_ul_tag (void *pdoc, Node *node);
45 static char *s_xhtml_1_0_start_h1_tag (void *pdoc, Node *node);
46 static char *s_xhtml_1_0_end_h1_tag (void *pdoc, Node *node);
47 static char *s_xhtml_1_0_start_h2_tag (void *pdoc, Node *node);
48 static char *s_xhtml_1_0_end_h2_tag (void *pdoc, Node *node);
49 static char *s_xhtml_1_0_start_h3_tag (void *pdoc, Node *node);
50 static char *s_xhtml_1_0_end_h3_tag (void *pdoc, Node *node);
51 static char *s_xhtml_1_0_start_h4_tag (void *pdoc, Node *node);
52 static char *s_xhtml_1_0_end_h4_tag (void *pdoc, Node *node);
53 static char *s_xhtml_1_0_start_h5_tag (void *pdoc, Node *node);
54 static char *s_xhtml_1_0_end_h5_tag (void *pdoc, Node *node);
55 static char *s_xhtml_1_0_start_h6_tag (void *pdoc, Node *node);
56 static char *s_xhtml_1_0_end_h6_tag (void *pdoc, Node *node);
57 static char *s_xhtml_1_0_start_ol_tag (void *pdoc, Node *node);
58 static char *s_xhtml_1_0_end_ol_tag (void *pdoc, Node *node);
59 static char *s_xhtml_1_0_start_li_tag (void *pdoc, Node *node);
60 static char *s_xhtml_1_0_end_li_tag (void *pdoc, Node *node);
61 static char *s_xhtml_1_0_start_meta_tag (void *pdoc, Node *node);
62 static char *s_xhtml_1_0_end_meta_tag (void *pdoc, Node *node);
63 static char *s_xhtml_1_0_start_head_tag (void *pdoc, Node *node);
64 static char *s_xhtml_1_0_end_head_tag (void *pdoc, Node *node);
65 static char *s_xhtml_1_0_start_title_tag (void *pdoc, Node *node);
66 static char *s_xhtml_1_0_end_title_tag (void *pdoc, Node *node);
67 static char *s_xhtml_1_0_start_base_tag (void *pdoc, Node *node);
68 static char *s_xhtml_1_0_end_base_tag (void *pdoc, Node *node);
69 static char *s_xhtml_1_0_start_body_tag (void *pdoc, Node *node);
70 static char *s_xhtml_1_0_end_body_tag (void *pdoc, Node *node);
71 static char *s_xhtml_1_0_start_a_tag (void *pdoc, Node *node);
72 static char *s_xhtml_1_0_end_a_tag (void *pdoc, Node *node);
73 static char *s_xhtml_1_0_start_br_tag (void *pdoc, Node *node);
74 static char *s_xhtml_1_0_end_br_tag (void *pdoc, Node *node);
75 static char *s_xhtml_1_0_start_tr_tag (void *pdoc, Node *node);
76 static char *s_xhtml_1_0_end_tr_tag (void *pdoc, Node *node);
77 static char *s_xhtml_1_0_start_font_tag (void *pdoc, Node *node);
78 static char *s_xhtml_1_0_end_font_tag (void *pdoc, Node *node);
79 static char *s_xhtml_1_0_start_form_tag (void *pdoc, Node *node);
80 static char *s_xhtml_1_0_end_form_tag (void *pdoc, Node *node);
81 static char *s_xhtml_1_0_start_input_tag (void *pdoc, Node *node);
82 static char *s_xhtml_1_0_end_input_tag (void *pdoc, Node *node);
83 static char *s_xhtml_1_0_start_center_tag (void *pdoc, Node *node);
84 static char *s_xhtml_1_0_end_center_tag (void *pdoc, Node *node);
85 static char *s_xhtml_1_0_start_hr_tag (void *pdoc, Node *node);
86 static char *s_xhtml_1_0_end_hr_tag (void *pdoc, Node *node);
87 static char *s_xhtml_1_0_start_img_tag (void *pdoc, Node *node);
88 static char *s_xhtml_1_0_end_img_tag (void *pdoc, Node *node);
89 static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
90 static char *s_xhtml_1_0_end_select_tag (void *pdoc, Node *node);
91 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
92 static char *s_xhtml_1_0_end_option_tag (void *pdoc, Node *node);
93 static char *s_xhtml_1_0_start_div_tag (void *pdoc, Node *node);
94 static char *s_xhtml_1_0_end_div_tag (void *pdoc, Node *node);
95 static char *s_xhtml_1_0_start_textarea_tag (void *pdoc, Node *node);
96 static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
97 static char *s_xhtml_1_0_start_b_tag (void *pdoc, Node *node);
98 static char *s_xhtml_1_0_end_b_tag (void *pdoc, Node *node);
99 static char *s_xhtml_1_0_chxjif_tag (void *pdoc, Node *node);
100 static char *s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *node);
101 static char *s_xhtml_1_0_end_blockquote_tag (void *pdoc, Node *node);
102 static char *s_xhtml_1_0_start_dir_tag (void *pdoc, Node *node);
103 static char *s_xhtml_1_0_end_dir_tag (void *pdoc, Node *node);
104 static char *s_xhtml_1_0_start_dl_tag (void *pdoc, Node *node);
105 static char *s_xhtml_1_0_end_dl_tag (void *pdoc, Node *node);
106 static char *s_xhtml_1_0_start_dt_tag (void *pdoc, Node *node);
107 static char *s_xhtml_1_0_end_dt_tag (void *pdoc, Node *node);
108 static char *s_xhtml_1_0_start_dd_tag (void *pdoc, Node *node);
109 static char *s_xhtml_1_0_end_dd_tag (void *pdoc, Node *node);
110 static char *s_xhtml_1_0_start_menu_tag (void *pdoc, Node *node);
111 static char *s_xhtml_1_0_end_menu_tag (void *pdoc, Node *node);
112 static char *s_xhtml_1_0_start_plaintext_tag (void *pdoc, Node *node);
113 static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
114 static char *s_xhtml_1_0_end_plaintext_tag (void *pdoc, Node *node);
115 static char *s_xhtml_1_0_start_blink_tag (void *pdoc, Node *node);
116 static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
117 static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
118 static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
119 static char *s_xhtml_1_0_newline_mark (void *pdoc, Node *node);
121 static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
122 static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
123 static char *s_xhtml_1_0_text_tag(void *pdoc, Node *child);
126 tag_handler xhtml_handler[] = {
129 s_xhtml_1_0_start_html_tag,
130 s_xhtml_1_0_end_html_tag,
134 s_xhtml_1_0_start_meta_tag,
135 s_xhtml_1_0_end_meta_tag,
139 s_xhtml_1_0_start_textarea_tag,
140 s_xhtml_1_0_end_textarea_tag,
144 s_xhtml_1_0_start_p_tag,
145 s_xhtml_1_0_end_p_tag,
149 s_xhtml_1_0_start_pre_tag,
150 s_xhtml_1_0_end_pre_tag,
154 s_xhtml_1_0_start_ul_tag,
155 s_xhtml_1_0_end_ul_tag,
159 s_xhtml_1_0_start_li_tag,
160 s_xhtml_1_0_end_li_tag,
164 s_xhtml_1_0_start_ol_tag,
165 s_xhtml_1_0_end_ol_tag,
169 s_xhtml_1_0_start_h1_tag,
170 s_xhtml_1_0_end_h1_tag,
174 s_xhtml_1_0_start_h2_tag,
175 s_xhtml_1_0_end_h2_tag,
179 s_xhtml_1_0_start_h3_tag,
180 s_xhtml_1_0_end_h3_tag,
184 s_xhtml_1_0_start_h4_tag,
185 s_xhtml_1_0_end_h4_tag,
189 s_xhtml_1_0_start_h5_tag,
190 s_xhtml_1_0_end_h5_tag,
194 s_xhtml_1_0_start_h6_tag,
195 s_xhtml_1_0_end_h6_tag,
199 s_xhtml_1_0_start_head_tag,
200 s_xhtml_1_0_end_head_tag,
204 s_xhtml_1_0_start_title_tag,
205 s_xhtml_1_0_end_title_tag,
209 s_xhtml_1_0_start_base_tag,
210 s_xhtml_1_0_end_base_tag,
214 s_xhtml_1_0_start_body_tag,
215 s_xhtml_1_0_end_body_tag,
219 s_xhtml_1_0_start_a_tag,
220 s_xhtml_1_0_end_a_tag,
224 s_xhtml_1_0_start_br_tag,
225 s_xhtml_1_0_end_br_tag,
234 s_xhtml_1_0_start_tr_tag,
235 s_xhtml_1_0_end_tr_tag,
249 s_xhtml_1_0_start_font_tag,
250 s_xhtml_1_0_end_font_tag,
254 s_xhtml_1_0_start_form_tag,
255 s_xhtml_1_0_end_form_tag,
259 s_xhtml_1_0_start_input_tag,
260 s_xhtml_1_0_end_input_tag,
264 s_xhtml_1_0_start_center_tag,
265 s_xhtml_1_0_end_center_tag,
269 s_xhtml_1_0_start_hr_tag,
270 s_xhtml_1_0_end_hr_tag,
274 s_xhtml_1_0_start_img_tag,
275 s_xhtml_1_0_end_img_tag,
279 s_xhtml_1_0_start_select_tag,
280 s_xhtml_1_0_end_select_tag,
284 s_xhtml_1_0_start_option_tag,
285 s_xhtml_1_0_end_option_tag,
289 s_xhtml_1_0_start_div_tag,
290 s_xhtml_1_0_end_div_tag,
294 s_xhtml_1_0_chxjif_tag,
319 s_xhtml_1_0_text_tag,
329 s_xhtml_1_0_start_b_tag,
330 s_xhtml_1_0_end_b_tag,
339 s_xhtml_1_0_start_dt_tag,
340 s_xhtml_1_0_end_dt_tag,
354 s_xhtml_1_0_start_blockquote_tag,
355 s_xhtml_1_0_end_blockquote_tag,
359 s_xhtml_1_0_start_dir_tag,
360 s_xhtml_1_0_end_dir_tag,
364 s_xhtml_1_0_start_dl_tag,
365 s_xhtml_1_0_end_dl_tag,
369 s_xhtml_1_0_start_dd_tag,
370 s_xhtml_1_0_end_dd_tag,
374 s_xhtml_1_0_start_menu_tag,
375 s_xhtml_1_0_end_menu_tag,
379 s_xhtml_1_0_start_plaintext_tag,
380 s_xhtml_1_0_end_plaintext_tag,
384 s_xhtml_1_0_start_blink_tag,
385 s_xhtml_1_0_end_blink_tag,
389 s_xhtml_1_0_start_marquee_tag,
390 s_xhtml_1_0_end_marquee_tag,
394 s_xhtml_1_0_newline_mark,
400 * converts from CHTML to XHTML.
402 * @param r [i] Requet_rec is appointed.
403 * @param spec [i] The result of the device specification processing which
404 * was done in advance is appointed.
405 * @param src [i] The character string before the converting is appointed.
406 * @return The character string after the converting is returned.
409 chxj_convert_xhtml_mobile_1_0(
415 chxjconvrule_entry *entryp,
424 DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
425 /*--------------------------------------------------------------------------*/
427 /*--------------------------------------------------------------------------*/
429 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
431 DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
435 /*--------------------------------------------------------------------------*/
436 /* The XHTML structure is initialized. */
437 /*--------------------------------------------------------------------------*/
438 s_init_xhtml(&xhtml, &doc, r, spec);
440 xhtml.entryp = entryp;
441 xhtml.cookie = cookie;
443 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
445 /*--------------------------------------------------------------------------*/
446 /* The character string of the input is analyzed. */
447 /*--------------------------------------------------------------------------*/
448 qs_init_malloc(&doc);
449 qs_init_root_node(&doc);
451 ss = apr_pcalloc(r->pool, srclen + 1);
452 memset(ss, 0, srclen + 1);
453 memcpy(ss, src, srclen);
456 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
458 qs_parse_string(&doc,ss, strlen(ss));
460 chxj_buffered_write_init(r->pool, &doc.buf);
461 /*--------------------------------------------------------------------------*/
462 /* It converts it from CHTML to XHTML. */
463 /*--------------------------------------------------------------------------*/
464 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
465 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
466 dst = apr_pstrdup(r->pool, xhtml.out);
467 chxj_buffered_write_terminate(&doc.buf);
469 qs_all_free(&doc,QX_LOGMARK);
472 return apr_pstrdup(r->pool,ss);
476 dst = apr_psprintf(r->pool, "\n");
478 *dstlen = strlen(dst);
481 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
484 DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
490 * The XHTML structure is initialized.
492 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
493 * initialized is specified.
494 * @param doc [i] The Doc structure that should be set to the initialized
495 * HDML structure is specified.
496 * @param r [i] To use POOL, the pointer to request_rec is specified.
497 * @param spec [i] The pointer to the device_table
500 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
502 memset(doc, 0, sizeof(Doc));
503 memset(xhtml, 0, sizeof(xhtml_t));
508 xhtml->out = qs_alloc_zero_byte_string(r->pool);
509 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
510 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
515 * Corresponding EMOJI to a current character-code is retrieved.
516 * The substitution character string is stored in the rslt pointer if agreeing.
518 * @param xhtml [i] The pointer to the XHTML structure is specified.
519 * @param txt [i] The character string to want to examine whether it is
520 * EMOJI is specified.
521 * @param rslt [o] The pointer to the pointer that stores the result is
523 * @return When corresponding EMOJI exists, it returns it excluding 0.
526 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
539 DBG(r,"spec is NULL");
542 for (ee = xhtml->conf->emoji;
545 unsigned char hex1byte;
546 unsigned char hex2byte;
548 DBG(r,"emoji->imode is NULL");
552 if (ee->imode->string != NULL
553 && strlen(ee->imode->string) > 0
554 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
555 if (spec == NULL || spec->emoji_type == NULL) {
556 *rslt = apr_psprintf(r->pool,
559 return strlen(ee->imode->string);
562 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
563 *rslt = apr_psprintf(r->pool,
566 return strlen(ee->imode->string);
569 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
570 *rslt = apr_psprintf(r->pool,
573 return strlen(ee->imode->string);
576 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
577 *rslt = apr_psprintf(r->pool,
580 return strlen(ee->imode->string);
583 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
584 *rslt = apr_psprintf(r->pool,
587 return strlen(ee->imode->string);
590 *rslt = apr_psprintf(r->pool,
593 return strlen(ee->imode->string);
597 hex1byte = ee->imode->hex1byte & 0xff;
598 hex2byte = ee->imode->hex2byte & 0xff;
600 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
601 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
602 if (spec == NULL || spec->emoji_type == NULL) {
603 *rslt = apr_psprintf(r->pool,
604 "<img localsrc=\"%s\">",
609 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
610 *rslt = apr_psprintf(r->pool,
611 "<img localsrc=\"%s\">",
616 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
617 *rslt = apr_psprintf(r->pool,
618 "<img localsrc=\"%s\">",
623 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
624 *rslt = apr_psprintf(r->pool,
625 "<img localsrc=\"%s\">",
630 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
631 *rslt = apr_psprintf(r->pool,
632 "<img localsrc=\"%s\">",
637 *rslt = apr_psprintf(r->pool,
638 "<img localsrc=\"%s\">",
650 * It is a handler who processes the HTML tag.
652 * @param pdoc [i/o] The pointer to the XHTML structure at the output
653 * destination is specified.
654 * @param node [i] The HTML tag node is specified.
655 * @return The conversion result is returned.
658 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
660 xhtml_t *xhtml = GET_XHTML(pdoc);
662 Doc *doc = xhtml->doc;
664 /*--------------------------------------------------------------------------*/
665 /* Add XML Declare */
666 /*--------------------------------------------------------------------------*/
667 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>");
669 /*--------------------------------------------------------------------------*/
671 /*--------------------------------------------------------------------------*/
672 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"");
674 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">");
676 /*--------------------------------------------------------------------------*/
678 /*--------------------------------------------------------------------------*/
679 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
680 /*--------------------------------------------------------------------------*/
682 /*--------------------------------------------------------------------------*/
683 for (attr = qs_get_attr(doc,node);
685 attr = qs_get_next_attr(doc,attr)) {
686 char* name = qs_get_attr_name(doc,attr);
687 char* value = qs_get_attr_value(doc,attr);
688 if (STRCASEEQ('l','L',"lang", name)) {
693 else if (STRCASEEQ('v','V',"version", name)) {
694 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
703 * It is a handler who processes the HTML tag.
705 * @param pdoc [i/o] The pointer to the XHTML structure at the output
706 * destination is specified.
707 * @param node [i] The HTML tag node is specified.
708 * @return The conversion result is returned.
711 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
713 xhtml_t *xhtml = GET_XHTML(pdoc);
714 Doc *doc = xhtml->doc;
721 * It is a handler who processes the META tag.
723 * @param pdoc [i/o] The pointer to the XHTML structure at the output
724 * destination is specified.
725 * @param node [i] The META tag node is specified.
726 * @return The conversion result is returned.
729 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
731 xhtml_t *xhtml = GET_XHTML(pdoc);
733 Doc *doc = xhtml->doc;
734 int content_type_flag = 0;
735 request_rec *r = doc->r;
738 /*--------------------------------------------------------------------------*/
740 /*--------------------------------------------------------------------------*/
741 for (attr = qs_get_attr(doc,node);
743 attr = qs_get_next_attr(doc,attr)) {
744 char *name = qs_get_attr_name(doc,attr);
745 char *value = qs_get_attr_value(doc,attr);
746 if (STRCASEEQ('n','N',"name", name) && value && *value) {
753 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
759 if (STRCASEEQ('c','C', "content-type", value)) {
760 content_type_flag = 1;
763 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
764 if (content_type_flag) {
768 W_V(chxj_header_inf_set_content_type(r, "text/html; charset=Windows-31J"));
786 * It is a handler who processes the META tag.
788 * @param pdoc [i/o] The pointer to the XHTML structure at the output
789 * destination is specified.
790 * @param node [i] The META tag node is specified.
791 * @return The conversion result is returned.
794 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
796 xhtml_t *xhtml = GET_XHTML(pdoc);
803 * It is a handler who processes the HEAD tag.
805 * @param pdoc [i/o] The pointer to the XHTML structure at the output
806 * destination is specified.
807 * @param node [i] The HEAD tag node is specified.
808 * @return The conversion result is returned.
811 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
813 xhtml_t *xhtml = GET_XHTML(pdoc);
814 Doc *doc = xhtml->doc;
822 * It is a handler who processes the HEAD tag.
824 * @param pdoc [i/o] The pointer to the XHTML structure at the output
825 * destination is specified.
826 * @param node [i] The HEAD tag node is specified.
827 * @return The conversion result is returned.
830 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
832 xhtml_t *xhtml = GET_XHTML(pdoc);
833 Doc *doc = xhtml->doc;
841 * It is a handler who processes the TITLE tag.
843 * @param pdoc [i/o] The pointer to the XHTML structure at the output
844 * destination is specified.
845 * @param node [i] The TITLE tag node is specified.
846 * @return The conversion result is returned.
849 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
851 xhtml_t *xhtml = GET_XHTML(pdoc);
852 Doc *doc = xhtml->doc;
860 * It is a handler who processes the TITLE tag.
862 * @param pdoc [i/o] The pointer to the XHTML structure at the output
863 * destination is specified.
864 * @param node [i] The TITLE tag node is specified.
865 * @return The conversion result is returned.
868 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
870 xhtml_t *xhtml = GET_XHTML(pdoc);
871 Doc *doc = xhtml->doc;
880 * It is a handler who processes the BASE tag.
882 * @param pdoc [i/o] The pointer to the XHTML structure at the output
883 * destination is specified.
884 * @param node [i] The BASE tag node is specified.
885 * @return The conversion result is returned.
888 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
890 xhtml_t *xhtml = GET_XHTML(pdoc);
892 Doc *doc = xhtml->doc;
895 /*--------------------------------------------------------------------------*/
897 /*--------------------------------------------------------------------------*/
898 for (attr = qs_get_attr(doc,node);
900 attr = qs_get_next_attr(doc,attr)) {
901 char *name = qs_get_attr_name(doc,attr);
902 char *value = qs_get_attr_value(doc,attr);
903 if (STRCASEEQ('h','H',"href",name)) {
917 * It is a handler who processes the BASE tag.
919 * @param pdoc [i/o] The pointer to the XHTML structure at the output
920 * destination is specified.
921 * @param node [i] The BASE tag node is specified.
922 * @return The conversion result is returned.
925 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
927 xhtml_t *xhtml = GET_XHTML(pdoc);
934 * It is a handler who processes the BODY tag.
936 * @param pdoc [i/o] The pointer to the XHTML structure at the output
937 * destination is specified.
938 * @param node [i] The BODY tag node is specified.
939 * @return The conversion result is returned.
942 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
944 xhtml_t *xhtml = GET_XHTML(pdoc);
945 Doc *doc = xhtml->doc;
949 /*--------------------------------------------------------------------------*/
951 /*--------------------------------------------------------------------------*/
952 for (attr = qs_get_attr(doc,node);
954 attr = qs_get_next_attr(doc,attr)) {
955 char *name = qs_get_attr_name(doc,attr);
956 char *value = qs_get_attr_value(doc,attr);
957 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
962 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
967 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
972 else if (STRCASEEQ('a','A',"alink", name)) {
975 else if (STRCASEEQ('v','V',"vlink",name)) {
985 * It is a handler who processes the BODY tag.
987 * @param pdoc [i/o] The pointer to the XHTML structure at the output
988 * destination is specified.
989 * @param node [i] The BODY tag node is specified.
990 * @return The conversion result is returned.
993 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
995 xhtml_t *xhtml = GET_XHTML(pdoc);
996 Doc *doc = xhtml->doc;
1004 * It is a handler who processes the A tag.
1006 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1007 * destination is specified.
1008 * @param node [i] The A tag node is specified.
1009 * @return The conversion result is returned.
1012 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
1014 xhtml_t *xhtml = GET_XHTML(pdoc);
1015 Doc *doc = xhtml->doc;
1016 request_rec *r = doc->r;
1020 /*--------------------------------------------------------------------------*/
1021 /* Get Attributes */
1022 /*--------------------------------------------------------------------------*/
1023 for (attr = qs_get_attr(doc,node);
1025 attr = qs_get_next_attr(doc,attr)) {
1026 char* name = qs_get_attr_name(doc,attr);
1027 char* value = qs_get_attr_value(doc,attr);
1028 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1033 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1034 value = chxj_encoding_parameter(r, value);
1035 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "telto:")) {
1036 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1042 else if (STRCASEEQ('a','A',"accesskey", name)) {
1043 W_L(" accesskey=\"");
1047 else if (STRCASEEQ('c','C',"cti",name)) {
1050 else if (STRCASEEQ('i','I',"ijam", name)) {
1053 else if (STRCASEEQ('u','U',"utn", name)) {
1056 else if (STRCASEEQ('t','T',"telbook",name)) {
1059 else if (STRCASEEQ('k','K',"kana",name)) {
1062 else if (STRCASEEQ('e','E',"email",name)) {
1065 else if (STRCASEEQ('i','I',"ista",name)) {
1068 else if (STRCASEEQ('i','I',"ilet",name)) {
1071 else if (STRCASEEQ('i','I',"iswf",name)) {
1074 else if (STRCASEEQ('i','I',"irst",name)) {
1084 * It is a handler who processes the A tag.
1086 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1087 * destination is specified.
1088 * @param node [i] The A tag node is specified.
1089 * @return The conversion result is returned.
1092 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1094 xhtml_t *xhtml = GET_XHTML(pdoc);
1095 Doc *doc = xhtml->doc;
1104 * It is a handler who processes the BR tag.
1106 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1107 * destination is specified.
1108 * @param node [i] The BR tag node is specified.
1109 * @return The conversion result is returned.
1112 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1114 xhtml_t *xhtml = GET_XHTML(pdoc);
1115 Doc *doc = xhtml->doc;
1119 /*--------------------------------------------------------------------------*/
1120 /* Get Attributes */
1121 /*--------------------------------------------------------------------------*/
1122 for (attr = qs_get_attr(doc,node);
1124 attr = qs_get_next_attr(doc,attr)) {
1125 char *name = qs_get_attr_name(doc,attr);
1126 char *value = qs_get_attr_value(doc,attr);
1127 if (STRCASEEQ('c','C',"clear",name)) {
1128 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1142 * It is a handler who processes the BR tag.
1144 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1145 * destination is specified.
1146 * @param node [i] The BR tag node is specified.
1147 * @return The conversion result is returned.
1150 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1152 xhtml_t *xhtml = GET_XHTML(pdoc);
1159 * It is a handler who processes the TR tag.
1161 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1162 * destination is specified.
1163 * @param node [i] The TR tag node is specified.
1164 * @return The conversion result is returned.
1167 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1169 xhtml_t *xhtml = GET_XHTML(pdoc);
1170 Doc *doc = xhtml->doc;
1179 * It is a handler who processes the TR tag.
1181 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1182 * destination is specified.
1183 * @param node [i] The TR tag node is specified.
1184 * @return The conversion result is returned.
1187 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1189 xhtml_t *xhtml = GET_XHTML(pdoc);
1196 * It is a handler who processes the FONT tag.
1198 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1199 * destination is specified.
1200 * @param node [i] The FONT tag node is specified.
1201 * @return The conversion result is returned.
1204 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1206 xhtml_t *xhtml = GET_XHTML(pdoc);
1207 Doc *doc = xhtml->doc;
1212 /*=========================================================================*/
1213 /* Get Attributes */
1214 /*=========================================================================*/
1215 for (attr = qs_get_attr(doc,node);
1217 attr = qs_get_next_attr(doc,attr)) {
1218 char *name = qs_get_attr_name(doc,attr);
1219 char *value = qs_get_attr_value(doc,attr);
1220 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1221 color = apr_pstrdup(doc->buf.pool, value);
1223 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1224 size = apr_pstrdup(doc->buf.pool, value);
1228 W_L("<font color=\"");
1231 xhtml->font_color_flag++;
1234 xhtml->font_size_flag++;
1236 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1237 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1238 case '3': W_L("<span style=\"font-size: small\">"); break;
1239 case '4': W_L("<span style=\"font-size: medium\">"); break;
1240 case '5': W_L("<span style=\"font-size: large\">"); break;
1241 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1242 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1244 if (*(size + 1) == '1') {
1245 W_L("<span style=\"font-size: small\">");
1248 if (*(size + 1) == '2') {
1249 W_L("<span style=\"font-size: x-small\">");
1252 if (*(size + 1) == '3') {
1253 W_L("<span style=\"font-size: xx-small\">");
1256 xhtml->font_size_flag--;
1260 if (*(size + 1) == '1') {
1261 W_L("<span style=\"font-size: large\">");
1264 if (*(size + 1) == '2') {
1265 W_L("<span style=\"font-size: x-large\">");
1268 if (*(size + 1) == '3') {
1269 W_L("<span style=\"font-size: xx-large\">");
1272 xhtml->font_size_flag--;
1276 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1277 xhtml->font_size_flag--;
1285 * It is a handler who processes the FONT tag.
1287 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1288 * destination is specified.
1289 * @param node [i] The FONT tag node is specified.
1290 * @return The conversion result is returned.
1293 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1295 xhtml_t *xhtml = GET_XHTML(pdoc);
1296 Doc *doc = xhtml->doc;
1298 if (xhtml->font_size_flag) {
1300 xhtml->font_size_flag--;
1302 if (xhtml->font_color_flag) {
1304 xhtml->font_color_flag--;
1311 * It is a handler who processes the FORM tag.
1313 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1314 * destination is specified.
1315 * @param node [i] The FORM tag node is specified.
1316 * @return The conversion result is returned.
1319 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1321 xhtml_t *xhtml = GET_XHTML(pdoc);
1322 Doc *doc = xhtml->doc;
1323 request_rec *r = doc->r;
1325 char *new_hidden_tag = NULL;
1326 char *attr_action = NULL;
1327 char *attr_method = NULL;
1328 char *attr_name = NULL;
1330 /*--------------------------------------------------------------------------*/
1331 /* Get Attributes */
1332 /*--------------------------------------------------------------------------*/
1333 for (attr = qs_get_attr(doc,node);
1335 attr = qs_get_next_attr(doc,attr)) {
1336 char *name = qs_get_attr_name(doc,attr);
1337 char *value = qs_get_attr_value(doc,attr);
1338 if (STRCASEEQ('a','A',"action",name)) {
1339 attr_action = chxj_encoding_parameter(r, value);
1340 attr_action = chxj_add_cookie_parameter(r, attr_action, xhtml->cookie);
1342 else if (STRCASEEQ('m','M',"method",name)) {
1343 attr_method = apr_pstrdup(doc->pool, value);
1345 else if (STRCASEEQ('u','U',"utn",name)) {
1348 else if (STRCASEEQ('n','N',"name",name)) {
1349 attr_name = apr_pstrdup(doc->pool, value);
1353 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1358 q = strchr(attr_action, '?');
1360 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
1361 if (new_hidden_tag) {
1380 if (new_hidden_tag) {
1381 W_V(new_hidden_tag);
1388 * It is a handler who processes the FORM tag.
1390 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1391 * destination is specified.
1392 * @param node [i] The FORM tag node is specified.
1393 * @return The conversion result is returned.
1396 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1398 xhtml_t *xhtml = GET_XHTML(pdoc);
1399 Doc *doc = xhtml->doc;
1408 * It is a handler who processes the INPUT tag.
1410 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1411 * destination is specified.
1412 * @param node [i] The INPUT tag node is specified.
1413 * @return The conversion result is returned.
1416 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1418 xhtml_t *xhtml = GET_XHTML(pdoc);
1419 Doc *doc = xhtml->doc;
1420 request_rec *r = doc->r;
1421 char *max_length = NULL;
1425 char *istyle = NULL;
1427 char *checked = NULL;
1428 char *accesskey = NULL;
1431 /*--------------------------------------------------------------------------*/
1432 /* Get Attributes */
1433 /*--------------------------------------------------------------------------*/
1434 type = qs_get_type_attr(doc, node, doc->buf.pool);
1435 name = qs_get_name_attr(doc, node, doc->buf.pool);
1436 value = qs_get_value_attr(doc,node, doc->buf.pool);
1437 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1438 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1439 checked = qs_get_checked_attr(doc,node, doc->buf.pool);
1440 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1441 size = qs_get_size_attr(doc, node, doc->buf.pool);
1444 type = qs_trim_string(doc->buf.pool, type);
1445 if (type && (STRCASEEQ('t','T',"text", type) ||
1446 STRCASEEQ('p','P',"password",type) ||
1447 STRCASEEQ('c','C',"checkbox",type) ||
1448 STRCASEEQ('r','R',"radio", type) ||
1449 STRCASEEQ('h','H',"hidden", type) ||
1450 STRCASEEQ('s','S',"submit", type) ||
1451 STRCASEEQ('r','R',"reset", type))) {
1457 if (size && *size) {
1462 if (name && *name) {
1467 if (value && *value) {
1469 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1472 if (accesskey && *accesskey) {
1473 W_L(" accesskey=\"");
1477 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1478 char *fmt = qs_conv_istyle_to_format(r,istyle);
1479 if (max_length && *max_length) {
1481 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1482 if (max_length[ii] < '0' || max_length[ii] > '9') {
1483 max_length = apr_psprintf(r->pool, "0");
1488 if (strcmp(max_length, "0")) {
1489 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1501 if (max_length && *max_length) {
1502 if (chxj_chk_numeric(max_length) != 0) {
1503 max_length = apr_psprintf(r->pool, "0");
1505 if (strcmp(max_length, "0")) {
1506 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1511 /*--------------------------------------------------------------------------*/
1512 /* The figure is default for the password. */
1513 /*--------------------------------------------------------------------------*/
1514 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1521 W_L(" FORMAT=\"*N\"");
1525 W_L(" checked=\"checked\"");
1534 * It is a handler who processes the INPUT tag.
1536 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1537 * destination is specified.
1538 * @param node [i] The INPUT tag node is specified.
1539 * @return The conversion result is returned.
1542 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1544 xhtml_t *xhtml = GET_XHTML(pdoc);
1551 * It is a handler who processes the CENTER tag.
1553 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1554 * destination is specified.
1555 * @param node [i] The CENTER tag node is specified.
1556 * @return The conversion result is returned.
1559 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1561 xhtml_t *xhtml = GET_XHTML(pdoc);
1562 Doc *doc = xhtml->doc;
1570 * It is a handler who processes the CENTER tag.
1572 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1573 * destination is specified.
1574 * @param node [i] The CENTER tag node is specified.
1575 * @return The conversion result is returned.
1578 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1580 xhtml_t *xhtml = GET_XHTML(pdoc);
1581 Doc *doc = xhtml->doc;
1589 * It is a handler who processes the HR tag.
1591 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1592 * destination is specified.
1593 * @param node [i] The HR tag node is specified.
1594 * @return The conversion result is returned.
1597 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1599 xhtml_t *xhtml = GET_XHTML(pdoc);
1600 Doc *doc = xhtml->doc;
1605 for (attr = qs_get_attr(doc,node);
1607 attr = qs_get_next_attr(doc,attr)) {
1608 char *name = qs_get_attr_name(doc,attr);
1609 char *value = qs_get_attr_value(doc,attr);
1610 if (STRCASEEQ('a','A',"align", name)) {
1611 /*----------------------------------------------------------------------*/
1613 /*----------------------------------------------------------------------*/
1614 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1620 else if (STRCASEEQ('s','S',"size", name)) {
1621 /*----------------------------------------------------------------------*/
1623 /*----------------------------------------------------------------------*/
1624 if (value && *value) {
1630 else if (STRCASEEQ('w','W',"width", name)) {
1631 /*----------------------------------------------------------------------*/
1633 /*----------------------------------------------------------------------*/
1634 if (value && *value) {
1640 else if (STRCASEEQ('n','N',"noshade", name)) {
1641 /*----------------------------------------------------------------------*/
1643 /*----------------------------------------------------------------------*/
1646 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1647 /*----------------------------------------------------------------------*/
1649 /*----------------------------------------------------------------------*/
1661 * It is a handler who processes the HR tag.
1663 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1664 * destination is specified.
1665 * @param node [i] The HR tag node is specified.
1666 * @return The conversion result is returned.
1669 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1671 xhtml_t *xhtml = GET_XHTML(pdoc);
1678 * It is a handler who processes the PRE tag.
1680 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1681 * destination is specified.
1682 * @param node [i] The PRE tag node is specified.
1683 * @return The conversion result is returned.
1686 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1688 xhtml_t *xhtml = GET_XHTML(pdoc);
1689 Doc *doc = xhtml->doc;
1698 * It is a handler who processes the PRE tag.
1700 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1701 * destination is specified.
1702 * @param node [i] The PRE tag node is specified.
1703 * @return The conversion result is returned.
1706 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1708 xhtml_t *xhtml = GET_XHTML(pdoc);
1709 Doc *doc = xhtml->doc;
1719 * It is a handler who processes the P tag.
1721 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1722 * destination is specified.
1723 * @param node [i] The P tag node is specified.
1724 * @return The conversion result is returned.
1727 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1729 xhtml_t *xhtml = GET_XHTML(pdoc);
1730 Doc *doc = xhtml->doc;
1735 for (attr = qs_get_attr(doc,node);
1737 attr = qs_get_next_attr(doc,attr)) {
1738 char *nm = qs_get_attr_name(doc,attr);
1739 char *val = qs_get_attr_value(doc,attr);
1740 if (STRCASEEQ('a','A',"align", nm)) {
1741 /*----------------------------------------------------------------------*/
1742 /* CHTML 1.0 (W3C version 3.2) */
1743 /*----------------------------------------------------------------------*/
1744 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1745 align = apr_pstrdup(doc->buf.pool, val);
1761 * It is a handler who processes the P tag.
1763 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1764 * destination is specified.
1765 * @param node [i] The P tag node is specified.
1766 * @return The conversion result is returned.
1769 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1771 xhtml_t *xhtml = GET_XHTML(pdoc);
1772 Doc *doc = xhtml->doc;
1780 * It is a handler who processes the UL tag.
1782 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1783 * destination is specified.
1784 * @param node [i] The UL tag node is specified.
1785 * @return The conversion result is returned.
1788 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1790 xhtml_t *xhtml = GET_XHTML(pdoc);
1791 Doc *doc = xhtml->doc;
1794 /*--------------------------------------------------------------------------*/
1795 /* Get Attributes */
1796 /*--------------------------------------------------------------------------*/
1797 for (attr = qs_get_attr(doc,node);
1799 attr = qs_get_next_attr(doc,attr)) {
1800 char *name = qs_get_attr_name(doc,attr);
1801 char *value = qs_get_attr_value(doc,attr);
1802 if (STRCASEEQ('t','T',"type",name)) {
1803 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1816 * It is a handler who processes the UL tag.
1818 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1819 * destination is specified.
1820 * @param node [i] The UL tag node is specified.
1821 * @return The conversion result is returned.
1824 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1826 xhtml_t *xhtml = GET_XHTML(pdoc);
1827 Doc *doc = xhtml->doc;
1835 * It is a handler who processes the H1 tag.
1837 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1838 * destination is specified.
1839 * @param node [i] The H1 tag node is specified.
1840 * @return The conversion result is returned.
1843 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1845 xhtml_t *xhtml = GET_XHTML(pdoc);
1846 Doc *doc = xhtml->doc;
1850 for (attr = qs_get_attr(doc,node);
1852 attr = qs_get_next_attr(doc,attr)) {
1855 name = qs_get_attr_name(doc,attr);
1856 value = qs_get_attr_value(doc,attr);
1857 if (STRCASEEQ('a','A',"align", name)) {
1859 if (STRCASEEQ('l','L',"left",value)) {
1861 W_L("text-align:left");
1864 else if (STRCASEEQ('r','R',"right",value)) {
1866 W_L("text-align:right");
1869 else if (STRCASEEQ('c','C',"center",value)) {
1871 W_L("text-align:center");
1884 * It is a handler who processes the H1 tag.
1886 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1887 * destination is specified.
1888 * @param node [i] The H1 tag node is specified.
1889 * @return The conversion result is returned.
1892 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1894 xhtml_t *xhtml = GET_XHTML(pdoc);
1895 Doc *doc = xhtml->doc;
1903 * It is a handler who processes the H2 tag.
1905 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1906 * destination is specified.
1907 * @param node [i] The H2 tag node is specified.
1908 * @return The conversion result is returned.
1911 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1913 xhtml_t *xhtml = GET_XHTML(pdoc);
1914 Doc *doc = xhtml->doc;
1918 for (attr = qs_get_attr(doc,node);
1920 attr = qs_get_next_attr(doc,attr)) {
1923 name = qs_get_attr_name(doc,attr);
1924 value = qs_get_attr_value(doc,attr);
1925 if (STRCASEEQ('a','A',"align", name)) {
1927 if (STRCASEEQ('l','L',"left",value)) {
1929 W_L("text-align:left");
1932 else if (STRCASEEQ('r','R',"right",value)) {
1934 W_L("text-align:right");
1937 else if (STRCASEEQ('c','C',"center",value)) {
1939 W_L("text-align:center");
1952 * It is a handler who processes the H2 tag.
1954 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1955 * destination is specified.
1956 * @param node [i] The H2 tag node is specified.
1957 * @return The conversion result is returned.
1960 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1962 xhtml_t *xhtml = GET_XHTML(pdoc);
1963 Doc *doc = xhtml->doc;
1971 * It is a handler who processes the H3 tag.
1973 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1974 * destination is specified.
1975 * @param node [i] The H3 tag node is specified.
1976 * @return The conversion result is returned.
1979 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1981 xhtml_t *xhtml = GET_XHTML(pdoc);
1982 Doc *doc = xhtml->doc;
1986 for (attr = qs_get_attr(doc,node);
1988 attr = qs_get_next_attr(doc,attr)) {
1991 name = qs_get_attr_name(doc,attr);
1992 value = qs_get_attr_value(doc,attr);
1993 if (STRCASEEQ('a','A',"align", name)) {
1995 if (STRCASEEQ('l','L',"left",value)) {
1997 W_L("text-align:left");
2000 else if (STRCASEEQ('r','R',"right",value)) {
2002 W_L("text-align:right");
2005 else if (STRCASEEQ('c','C',"center",value)) {
2007 W_L("text-align:center");
2020 * It is a handler who processes the H3 tag.
2022 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2023 * destination is specified.
2024 * @param node [i] The H3 tag node is specified.
2025 * @return The conversion result is returned.
2028 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
2030 xhtml_t *xhtml = GET_XHTML(pdoc);
2031 Doc *doc = xhtml->doc;
2039 * It is a handler who processes the H4 tag.
2041 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2042 * destination is specified.
2043 * @param node [i] The H4 tag node is specified.
2044 * @return The conversion result is returned.
2047 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
2049 xhtml_t *xhtml = GET_XHTML(pdoc);
2050 Doc *doc = xhtml->doc;
2054 for (attr = qs_get_attr(doc,node);
2056 attr = qs_get_next_attr(doc,attr)) {
2059 name = qs_get_attr_name(doc,attr);
2060 value = qs_get_attr_value(doc,attr);
2061 if (STRCASEEQ('a','A',"align", name)) {
2063 if (STRCASEEQ('l','L',"left",value)) {
2065 W_L("text-align:left");
2068 else if (STRCASEEQ('r','R',"right",value)) {
2070 W_L("text-align:right");
2073 else if (STRCASEEQ('c','C',"center",value)) {
2075 W_L("text-align:center");
2088 * It is a handler who processes the H4 tag.
2090 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2091 * destination is specified.
2092 * @param node [i] The H4 tag node is specified.
2093 * @return The conversion result is returned.
2096 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2098 xhtml_t *xhtml = GET_XHTML(pdoc);
2099 Doc *doc = xhtml->doc;
2107 * It is a handler who processes the H5 tag.
2109 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2110 * destination is specified.
2111 * @param node [i] The H5 tag node is specified.
2112 * @return The conversion result is returned.
2115 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2117 xhtml_t *xhtml = GET_XHTML(pdoc);
2118 Doc *doc = xhtml->doc;
2122 for (attr = qs_get_attr(doc,node);
2124 attr = qs_get_next_attr(doc,attr)) {
2127 name = qs_get_attr_name(doc,attr);
2128 value = qs_get_attr_value(doc,attr);
2129 if (STRCASEEQ('a','A',"align", name)) {
2131 if (STRCASEEQ('l','L',"left",value)) {
2133 W_L("text-align:left");
2136 else if (STRCASEEQ('r','R',"right",value)) {
2138 W_L("text-align:right");
2141 else if (STRCASEEQ('c','C',"center",value)) {
2143 W_L("text-align:center");
2156 * It is a handler who processes the H5 tag.
2158 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2159 * destination is specified.
2160 * @param node [i] The H5 tag node is specified.
2161 * @return The conversion result is returned.
2164 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2166 xhtml_t *xhtml = GET_XHTML(pdoc);
2167 Doc *doc = xhtml->doc;
2175 * It is a handler who processes the H6 tag.
2177 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2178 * destination is specified.
2179 * @param node [i] The H6 tag node is specified.
2180 * @return The conversion result is returned.
2183 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2185 xhtml_t *xhtml = GET_XHTML(pdoc);
2186 Doc *doc = xhtml->doc;
2190 for (attr = qs_get_attr(doc,node);
2192 attr = qs_get_next_attr(doc,attr)) {
2195 name = qs_get_attr_name(doc,attr);
2196 value = qs_get_attr_value(doc,attr);
2197 if (STRCASEEQ('a','A',"align", name)) {
2199 if (STRCASEEQ('l','L',"left",value)) {
2201 W_L("text-align:left");
2204 else if (STRCASEEQ('r','R',"right",value)) {
2206 W_L("text-align:right");
2209 else if (STRCASEEQ('c','C',"center",value)) {
2211 W_L("text-align:center");
2224 * It is a handler who processes the H6 tag.
2226 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2227 * destination is specified.
2228 * @param node [i] The H6 tag node is specified.
2229 * @return The conversion result is returned.
2232 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2234 xhtml_t *xhtml = GET_XHTML(pdoc);
2235 Doc *doc = xhtml->doc;
2243 * It is a handler who processes the OL tag.
2245 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2246 * destination is specified.
2247 * @param node [i] The OL tag node is specified.
2248 * @return The conversion result is returned.
2251 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2253 xhtml_t *xhtml = GET_XHTML(pdoc);
2254 Doc *doc = xhtml->doc;
2258 /*--------------------------------------------------------------------------*/
2259 /* Get Attributes */
2260 /*--------------------------------------------------------------------------*/
2261 for (attr = qs_get_attr(doc,node);
2263 attr = qs_get_next_attr(doc,attr)) {
2264 char *name = qs_get_attr_name(doc,attr);
2265 char *value = qs_get_attr_value(doc,attr);
2266 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2271 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2283 * It is a handler who processes the OL tag.
2285 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2286 * destination is specified.
2287 * @param node [i] The OL tag node is specified.
2288 * @return The conversion result is returned.
2291 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2293 xhtml_t *xhtml = GET_XHTML(pdoc);
2294 Doc *doc = xhtml->doc;
2302 * It is a handler who processes the LI tag.
2304 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2305 * destination is specified.
2306 * @param node [i] The LI tag node is specified.
2307 * @return The conversion result is returned.
2310 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2312 xhtml_t *xhtml = GET_XHTML(pdoc);
2313 Doc *doc = xhtml->doc;
2317 /*--------------------------------------------------------------------------*/
2318 /* Get Attributes */
2319 /*--------------------------------------------------------------------------*/
2320 for (attr = qs_get_attr(doc,node);
2322 attr = qs_get_next_attr(doc,attr)) {
2323 char *name = qs_get_attr_name(doc,attr);
2324 char *value = qs_get_attr_value(doc,attr);
2325 if (STRCASEEQ('t','T',"type",name)) {
2326 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2332 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2344 ** It is a handler who processes the LI tag.
2346 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2347 * destination is specified.
2348 * @param node [i] The LI tag node is specified.
2349 * @return The conversion result is returned.
2352 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2354 xhtml_t *xhtml = GET_XHTML(pdoc);
2355 Doc *doc = xhtml->doc;
2362 * It is a handler who processes the IMG tag.
2364 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2365 * destination is specified.
2366 * @param node [i] The IMG tag node is specified.
2367 * @return The conversion result is returned.
2370 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2372 xhtml_t *xhtml = GET_XHTML(pdoc);
2373 Doc *doc = xhtml->doc;
2374 request_rec *r = doc->r;
2377 #ifndef IMG_NOT_CONVERT_FILENAME
2378 device_table *spec = xhtml->spec;
2382 /*--------------------------------------------------------------------------*/
2383 /* Get Attributes */
2384 /*--------------------------------------------------------------------------*/
2385 for (attr = qs_get_attr(doc,node);
2387 attr = qs_get_next_attr(doc,attr)) {
2388 char *name = qs_get_attr_name(doc,attr);
2389 char *value = qs_get_attr_value(doc,attr);
2391 if (STRCASEEQ('s','S',"src",name)) {
2392 value = chxj_encoding_parameter(r, value);
2393 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2395 value = apr_psprintf(r->pool,
2398 (strchr(value, '?')) ? '&' : '?',
2399 CHXJ_COOKIE_NOUPDATE_PARAM);
2401 #ifdef IMG_NOT_CONVERT_FILENAME
2411 char *vv = chxj_img_conv(r,spec,value);
2419 if (STRCASEEQ('a','A',"align",name)) {
2421 if (STRCASEEQ('t','T',"top", value) ||
2422 STRCASEEQ('m','M',"middle",value) ||
2423 STRCASEEQ('b','B',"bottom",value) ||
2424 STRCASEEQ('l','L',"left", value) ||
2425 STRCASEEQ('r','R',"right", value)) {
2430 else if (STRCASEEQ('c','C',"center", value)) {
2437 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2442 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2447 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2452 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2457 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2469 * It is a handler who processes the IMG tag.
2471 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2472 * destination is specified.
2473 * @param node [i] The IMG tag node is specified.
2474 * @return The conversion result is returned.
2477 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2479 xhtml_t *xhtml = GET_XHTML(pdoc);
2486 * It is a handler who processes the SELECT tag.
2488 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2489 * destination is specified.
2490 * @param node [i] The SELECT tag node is specified.
2491 * @return The conversion result is returned.
2494 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2496 xhtml_t *xhtml = GET_XHTML(pdoc);
2497 Doc *doc = xhtml->doc;
2500 char *multiple = NULL;
2505 for (attr = qs_get_attr(doc,child);
2507 attr = qs_get_next_attr(doc,attr)) {
2508 char *nm = qs_get_attr_name(doc,attr);
2509 char *val = qs_get_attr_value(doc,attr);
2510 if (STRCASEEQ('s','S',"size",nm)) {
2511 /*----------------------------------------------------------------------*/
2512 /* CHTML 1.0 version 2.0 */
2513 /*----------------------------------------------------------------------*/
2514 size = apr_pstrdup(doc->buf.pool, val);
2516 else if (STRCASEEQ('n','N',"name",nm)) {
2517 /*----------------------------------------------------------------------*/
2518 /* CHTML 1.0 version 2.0 */
2519 /*----------------------------------------------------------------------*/
2520 name = apr_pstrdup(doc->buf.pool, val);
2522 else if (STRCASEEQ('m','M',"multiple",nm)) {
2523 /*----------------------------------------------------------------------*/
2524 /* CHTML 1.0 version 2.0 */
2525 /*----------------------------------------------------------------------*/
2526 multiple = apr_pstrdup(doc->buf.pool, val);
2529 if (size && *size) {
2534 if (name && *name) {
2540 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2541 W_L(" multiple=\"true\"");
2549 * It is a handler who processes the SELECT tag.
2551 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2552 * destination is specified.
2553 * @param node [i] The SELECT tag node is specified.
2554 * @return The conversion result is returned.
2557 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2559 xhtml_t *xhtml = GET_XHTML(pdoc);
2560 Doc *doc = xhtml->doc;
2568 * It is a handler who processes the OPTION tag.
2570 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2571 * destination is specified.
2572 * @param node [i] The OPTION tag node is specified.
2573 * @return The conversion result is returned.
2576 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2578 xhtml_t *xhtml = GET_XHTML(pdoc);
2579 Doc *doc = xhtml->doc;
2582 char *selected = NULL;
2586 for (attr = qs_get_attr(doc,child);
2588 attr = qs_get_next_attr(doc,attr)) {
2589 char *nm = qs_get_attr_name(doc,attr);
2590 char *val = qs_get_attr_value(doc,attr);
2591 if (STRCASEEQ('s','S',"selected",nm)) {
2592 /* CHTML version 2.0 */
2593 selected = apr_pstrdup(doc->buf.pool, val);
2595 else if (STRCASEEQ('v','V',"value",nm)) {
2596 /* CHTML version 2.0 */
2597 value = apr_pstrdup(doc->buf.pool, val);
2600 if (value && *value) {
2606 W_L(" selected=\"selected\"");
2614 * It is a handler who processes the OPTION tag.
2616 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2617 * destination is specified.
2618 * @param node [i] The OPTION tag node is specified.
2619 * @return The conversion result is returned.
2622 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2624 xhtml_t *xhtml = GET_XHTML(pdoc);
2625 Doc *doc = xhtml->doc;
2633 * It is a handler who processes the DIV tag.
2635 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2636 * destination is specified.
2637 * @param node [i] The DIV tag node is specified.
2638 * @return The conversion result is returned.
2641 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2643 xhtml_t *xhtml = GET_XHTML(pdoc);
2644 Doc *doc = xhtml->doc;
2649 for (attr = qs_get_attr(doc,child);
2651 attr = qs_get_next_attr(doc,attr)) {
2652 char *nm = qs_get_attr_name(doc,attr);
2653 char *val = qs_get_attr_value(doc,attr);
2654 if (STRCASEEQ('a','A',"align",nm)) {
2655 /*=====================================================================*/
2656 /* CHTML version 3.2 */
2657 /*=====================================================================*/
2658 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2659 align = apr_pstrdup(doc->buf.pool, val);
2674 * It is a handler who processes the DIV tag.
2676 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2677 * destination is specified.
2678 * @param node [i] The DIV tag node is specified.
2679 * @return The conversion result is returned.
2682 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2684 xhtml_t *xhtml = GET_XHTML(pdoc);
2685 Doc *doc = xhtml->doc;
2692 * It is a handler who processes the B tag.
2694 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2695 * destination is specified.
2696 * @param node [i] The B tag node is specified.
2697 * @return The conversion result is returned.
2700 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2702 xhtml_t *xhtml = GET_XHTML(pdoc);
2703 Doc *doc = xhtml->doc;
2705 W_L("<div style=\"font-weight:bold\">");
2711 * It is a handler who processes the B tag.
2713 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2714 * destination is specified.
2715 * @param node [i] The B tag node is specified.
2716 * @return The conversion result is returned.
2719 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2721 xhtml_t *xhtml = GET_XHTML(pdoc);
2722 Doc *doc = xhtml->doc;
2730 * It is a handler who processes the CHXJ:IF tag.
2732 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2733 * destination is specified.
2734 * @param node [i] The CHXJ:IF tag node is specified.
2737 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2739 xhtml_t *xhtml = GET_XHTML(pdoc);
2740 Doc *doc = xhtml->doc;
2743 for (child = qs_get_child_node(doc, node);
2745 child = qs_get_next_node(doc, child)) {
2747 s_xhtml_1_0_chxjif_tag(xhtml, child);
2755 * It is a handler who processes the TEXTARE tag.
2757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2758 * destination is specified.
2759 * @param node [i] The TEXTAREA tag node is specified.
2760 * @return The conversion result is returned.
2763 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2765 xhtml_t *xhtml = GET_XHTML(pdoc);
2766 Doc *doc = xhtml->doc;
2769 xhtml->textarea_flag++;
2771 for (attr = qs_get_attr(doc,node);
2773 attr = qs_get_next_attr(doc,attr)) {
2774 char *name = qs_get_attr_name(doc,attr);
2775 char *value = qs_get_attr_value(doc,attr);
2776 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2781 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2786 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2791 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2792 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2797 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2798 W_L(" accesskey=\"");
2809 * It is a handler who processes the TEXTAREA tag.
2811 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2812 * destination is specified.
2813 * @param node [i] The TEXTAREA tag node is specified.
2814 * @return The conversion result is returned.
2817 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2819 xhtml_t *xhtml = GET_XHTML(pdoc);
2820 Doc *doc = xhtml->doc;
2823 xhtml->textarea_flag--;
2829 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2831 xhtml_t *xhtml = GET_XHTML(pdoc);
2832 Doc *doc = xhtml->doc;
2833 request_rec *r = doc->r;
2841 textval = qs_get_node_value(doc,child);
2842 if (strlen(textval) == 0) {
2846 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2847 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2849 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2850 memset(one_byte, 0, sizeof(one_byte));
2853 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2855 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2857 DBG(r,"[%s][%d]", out, rtn);
2858 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2862 if (is_sjis_kanji(textval[ii])) {
2863 one_byte[0] = textval[ii+0];
2864 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2865 one_byte[0] = textval[ii+1];
2866 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2869 else if (xhtml->pre_flag) {
2870 one_byte[0] = textval[ii+0];
2871 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2873 else if (xhtml->textarea_flag) {
2874 one_byte[0] = textval[ii+0];
2875 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2877 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2878 one_byte[0] = textval[ii+0];
2879 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2888 * It is a handler who processes the BLOCKQUOTE tag.
2890 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2891 * destination is specified.
2892 * @param node [i] The BLOCKQUOTE tag node is specified.
2893 * @return The conversion result is returned.
2896 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2898 xhtml_t *xhtml = GET_XHTML(pdoc);
2899 Doc *doc = xhtml->doc;
2900 W_L("<blockquote>");
2906 * It is a handler who processes the BLOCKQUOTE tag.
2908 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2909 * destination is specified.
2910 * @param node [i] The BLOCKQUOTE tag node is specified.
2911 * @return The conversion result is returned.
2914 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2916 xhtml_t *xhtml = GET_XHTML(pdoc);
2917 Doc *doc = xhtml->doc;
2918 W_L("</blockquote>");
2924 * It is a handler who processes the DIR tag.
2926 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2927 * destination is specified.
2928 * @param node [i] The DIR tag node is specified.
2929 * @return The conversion result is returned.
2932 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2934 xhtml_t *xhtml = GET_XHTML(pdoc);
2935 Doc *doc = xhtml->doc;
2938 for (attr = qs_get_attr(doc,node);
2940 attr = qs_get_next_attr(doc,attr)) {
2941 char *name = qs_get_attr_name(doc,attr);
2942 char *value = qs_get_attr_value(doc,attr);
2943 if (STRCASEEQ('t','T',"type",name)) {
2944 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2957 * It is a handler who processes the DIR tag.
2959 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2960 * destination is specified.
2961 * @param node [i] The DIR tag node is specified.
2962 * @return The conversion result is returned.
2965 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2967 xhtml_t *xhtml = GET_XHTML(pdoc);
2968 Doc *doc = xhtml->doc;
2975 * It is a handler who processes the DL tag.
2977 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2978 * destination is specified.
2979 * @param node [i] The DL tag node is specified.
2980 * @return The conversion result is returned.
2983 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2985 xhtml_t *xhtml = GET_XHTML(pdoc);
2986 Doc *doc = xhtml->doc;
2993 * It is a handler who processes the DL tag.
2995 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2996 * destination is specified.
2997 * @param node [i] The DL tag node is specified.
2998 * @return The conversion result is returned.
3001 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
3003 xhtml_t *xhtml = GET_XHTML(pdoc);
3004 Doc *doc = xhtml->doc;
3011 * It is a handter who processes the DT tag.
3013 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3014 * destination is specified.
3015 * @param node [i] The DT tag node is specified.
3016 * @return The conversion result is returned.
3019 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
3021 xhtml_t *xhtml = GET_XHTML(pdoc);
3022 Doc *doc = xhtml->doc;
3029 * It is a handter who processes the DT tag.
3031 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3032 * destination is specified.
3033 * @param node [i] The DT tag node is specified.
3034 * @return The conversion result is returned.
3037 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
3039 xhtml_t *xhtml = GET_XHTML(pdoc);
3040 Doc *doc = xhtml->doc;
3047 * It is a handder who processes the DD tag.
3049 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3050 * destination is specified.
3051 * @param node [i] The DD tag node is specified.
3052 * @return The conversion result is returned.
3055 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
3057 xhtml_t *xhtml = GET_XHTML(pdoc);
3058 Doc *doc = xhtml->doc;
3065 * It is a handder who processes the DD tag.
3067 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3068 * destination is specified.
3069 * @param node [i] The DD tag node is specified.
3070 * @return The conversion result is returned.
3073 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
3075 xhtml_t *xhtml = GET_XHTML(pdoc);
3076 Doc *doc = xhtml->doc;
3083 * It is a handler who processes the MENU tag.
3085 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3086 * destination is specified.
3087 * @param node [i] The MENU tag node is specified.
3088 * @return The conversion result is returned.
3091 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
3093 xhtml_t *xhtml = GET_XHTML(pdoc);
3094 Doc *doc = xhtml->doc;
3097 /*--------------------------------------------------------------------------*/
3098 /* Get Attributes */
3099 /*--------------------------------------------------------------------------*/
3100 for (attr = qs_get_attr(doc,node);
3102 attr = qs_get_next_attr(doc,attr)) {
3103 char *name = qs_get_attr_name(doc,attr);
3104 char *value = qs_get_attr_value(doc,attr);
3105 if (STRCASEEQ('t','T',"type",name)) {
3106 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3119 * It is a hanmenuer who processes the MENU tag.
3121 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3122 * destination is specified.
3123 * @param node [i] The MENU tag node is specified.
3124 * @return The conversion result is returned.
3127 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3129 xhtml_t *xhtml = GET_XHTML(pdoc);
3130 Doc *doc = xhtml->doc;
3137 * It is a handler who processes the PLAINTEXT tag.
3139 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3140 * destination is specified.
3141 * @param node [i] The PLAINTEXT tag node is specified.
3142 * @return The conversion result is returned.
3145 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3147 xhtml_t *xhtml = GET_XHTML(pdoc);
3148 Doc *doc = xhtml->doc;
3150 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3155 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3157 xhtml_t *xhtml = GET_XHTML(pdoc);
3158 Doc *doc = xhtml->doc;
3160 for (child = qs_get_child_node(doc, node);
3162 child = qs_get_next_node(doc, child)) {
3164 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3171 * It is a handler who processes the PLAINTEXT tag.
3173 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3174 * destination is specified.
3175 * @param node [i] The PLAINTEXT tag node is specified.
3176 * @return The conversion result is returned.
3179 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3181 xhtml_t *xhtml = GET_XHTML(pdoc);
3182 Doc *doc = xhtml->doc;
3183 W_L("</plaintext>");
3189 * It is a hanblinker who processes the BLINK tag.
3191 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3192 * destination is specified.
3193 * @param node [i] The BLINK tag node is specified.
3194 * @return The conversion result is returned.
3197 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3199 xhtml_t *xhtml = GET_XHTML(pdoc);
3200 Doc *doc = xhtml->doc;
3207 * It is a hanblinker who processes the BLINK tag.
3209 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3210 * destination is specified.
3211 * @param node [i] The BLINK tag node is specified.
3212 * @return The conversion result is returned.
3215 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3217 xhtml_t *xhtml = GET_XHTML(pdoc);
3218 Doc *doc = xhtml->doc;
3225 * It is a handler who processes the MARQUEE tag.
3227 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3228 * destination is specified.
3229 * @param node [i] The MARQUEE tag node is specified.
3230 * @return The conversion result is returned.
3233 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3235 xhtml_t *xhtml = GET_XHTML(pdoc);
3236 Doc *doc = xhtml->doc;
3239 /*--------------------------------------------------------------------------*/
3240 /* Get Attributes */
3241 /*--------------------------------------------------------------------------*/
3242 for (attr = qs_get_attr(doc,node);
3244 attr = qs_get_next_attr(doc,attr)) {
3245 char *name = qs_get_attr_name(doc,attr);
3246 char *value = qs_get_attr_value(doc,attr);
3247 if (STRCASEEQ('d','D',"direction", name)) {
3248 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3249 W_L(" direction=\"");
3254 else if (STRCASEEQ('b','B',"behavior",name)) {
3255 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3256 W_L(" behavior=\"");
3261 else if (STRCASEEQ('l','L',"loop",name)) {
3262 if (value && *value) {
3268 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3269 if (value && *value) {
3282 * It is a handler who processes the MARQUEE tag.
3284 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3285 * destination is specified.
3286 * @param node [i] The MARQUEE tag node is specified.
3287 * @return The conversion result is returned.
3290 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3292 xhtml_t *xhtml = GET_XHTML(pdoc);
3293 Doc *doc = xhtml->doc;
3300 * It is handler who processes the New Line Code.
3303 s_xhtml_1_0_newline_mark(void *pdoc, Node *UNUSED(node))
3305 xhtml_t *xhtml = GET_XHTML(pdoc);
3306 Doc *doc = xhtml->doc;