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 char *unused = NULL;
1359 q = strchr(attr_action, '?');
1361 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &unused, CHXJ_FALSE, CHXJ_FALSE);
1362 if (new_hidden_tag) {
1381 if (new_hidden_tag) {
1382 W_V(new_hidden_tag);
1389 * It is a handler who processes the FORM tag.
1391 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1392 * destination is specified.
1393 * @param node [i] The FORM tag node is specified.
1394 * @return The conversion result is returned.
1397 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1399 xhtml_t *xhtml = GET_XHTML(pdoc);
1400 Doc *doc = xhtml->doc;
1409 * It is a handler who processes the INPUT tag.
1411 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1412 * destination is specified.
1413 * @param node [i] The INPUT tag node is specified.
1414 * @return The conversion result is returned.
1417 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1419 xhtml_t *xhtml = GET_XHTML(pdoc);
1420 Doc *doc = xhtml->doc;
1421 request_rec *r = doc->r;
1422 char *max_length = NULL;
1426 char *istyle = NULL;
1428 char *checked = NULL;
1429 char *accesskey = NULL;
1432 /*--------------------------------------------------------------------------*/
1433 /* Get Attributes */
1434 /*--------------------------------------------------------------------------*/
1435 type = qs_get_type_attr(doc, node, doc->buf.pool);
1436 name = qs_get_name_attr(doc, node, doc->buf.pool);
1437 value = qs_get_value_attr(doc,node, doc->buf.pool);
1438 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1439 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1440 checked = qs_get_checked_attr(doc,node, doc->buf.pool);
1441 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1442 size = qs_get_size_attr(doc, node, doc->buf.pool);
1445 type = qs_trim_string(doc->buf.pool, type);
1446 if (type && (STRCASEEQ('t','T',"text", type) ||
1447 STRCASEEQ('p','P',"password",type) ||
1448 STRCASEEQ('c','C',"checkbox",type) ||
1449 STRCASEEQ('r','R',"radio", type) ||
1450 STRCASEEQ('h','H',"hidden", type) ||
1451 STRCASEEQ('s','S',"submit", type) ||
1452 STRCASEEQ('r','R',"reset", type))) {
1458 if (size && *size) {
1463 if (name && *name) {
1468 if (value && *value) {
1470 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1473 if (accesskey && *accesskey) {
1474 W_L(" accesskey=\"");
1478 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1479 char *fmt = qs_conv_istyle_to_format(r,istyle);
1480 if (max_length && *max_length) {
1482 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1483 if (max_length[ii] < '0' || max_length[ii] > '9') {
1484 max_length = apr_psprintf(r->pool, "0");
1489 if (strcmp(max_length, "0")) {
1490 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1502 if (max_length && *max_length) {
1503 if (chxj_chk_numeric(max_length) != 0) {
1504 max_length = apr_psprintf(r->pool, "0");
1506 if (strcmp(max_length, "0")) {
1507 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1512 /*--------------------------------------------------------------------------*/
1513 /* The figure is default for the password. */
1514 /*--------------------------------------------------------------------------*/
1515 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1522 W_L(" FORMAT=\"*N\"");
1526 W_L(" checked=\"checked\"");
1535 * It is a handler who processes the INPUT tag.
1537 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1538 * destination is specified.
1539 * @param node [i] The INPUT tag node is specified.
1540 * @return The conversion result is returned.
1543 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1545 xhtml_t *xhtml = GET_XHTML(pdoc);
1552 * It is a handler who processes the CENTER tag.
1554 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1555 * destination is specified.
1556 * @param node [i] The CENTER tag node is specified.
1557 * @return The conversion result is returned.
1560 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1562 xhtml_t *xhtml = GET_XHTML(pdoc);
1563 Doc *doc = xhtml->doc;
1571 * It is a handler who processes the CENTER tag.
1573 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1574 * destination is specified.
1575 * @param node [i] The CENTER tag node is specified.
1576 * @return The conversion result is returned.
1579 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1581 xhtml_t *xhtml = GET_XHTML(pdoc);
1582 Doc *doc = xhtml->doc;
1590 * It is a handler who processes the HR tag.
1592 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1593 * destination is specified.
1594 * @param node [i] The HR tag node is specified.
1595 * @return The conversion result is returned.
1598 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1600 xhtml_t *xhtml = GET_XHTML(pdoc);
1601 Doc *doc = xhtml->doc;
1606 for (attr = qs_get_attr(doc,node);
1608 attr = qs_get_next_attr(doc,attr)) {
1609 char *name = qs_get_attr_name(doc,attr);
1610 char *value = qs_get_attr_value(doc,attr);
1611 if (STRCASEEQ('a','A',"align", name)) {
1612 /*----------------------------------------------------------------------*/
1614 /*----------------------------------------------------------------------*/
1615 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1621 else if (STRCASEEQ('s','S',"size", name)) {
1622 /*----------------------------------------------------------------------*/
1624 /*----------------------------------------------------------------------*/
1625 if (value && *value) {
1631 else if (STRCASEEQ('w','W',"width", name)) {
1632 /*----------------------------------------------------------------------*/
1634 /*----------------------------------------------------------------------*/
1635 if (value && *value) {
1641 else if (STRCASEEQ('n','N',"noshade", name)) {
1642 /*----------------------------------------------------------------------*/
1644 /*----------------------------------------------------------------------*/
1647 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1648 /*----------------------------------------------------------------------*/
1650 /*----------------------------------------------------------------------*/
1662 * It is a handler who processes the HR tag.
1664 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1665 * destination is specified.
1666 * @param node [i] The HR tag node is specified.
1667 * @return The conversion result is returned.
1670 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1672 xhtml_t *xhtml = GET_XHTML(pdoc);
1679 * It is a handler who processes the PRE tag.
1681 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1682 * destination is specified.
1683 * @param node [i] The PRE tag node is specified.
1684 * @return The conversion result is returned.
1687 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1689 xhtml_t *xhtml = GET_XHTML(pdoc);
1690 Doc *doc = xhtml->doc;
1699 * It is a handler who processes the PRE tag.
1701 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1702 * destination is specified.
1703 * @param node [i] The PRE tag node is specified.
1704 * @return The conversion result is returned.
1707 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1709 xhtml_t *xhtml = GET_XHTML(pdoc);
1710 Doc *doc = xhtml->doc;
1720 * It is a handler who processes the P tag.
1722 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1723 * destination is specified.
1724 * @param node [i] The P tag node is specified.
1725 * @return The conversion result is returned.
1728 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1730 xhtml_t *xhtml = GET_XHTML(pdoc);
1731 Doc *doc = xhtml->doc;
1736 for (attr = qs_get_attr(doc,node);
1738 attr = qs_get_next_attr(doc,attr)) {
1739 char *nm = qs_get_attr_name(doc,attr);
1740 char *val = qs_get_attr_value(doc,attr);
1741 if (STRCASEEQ('a','A',"align", nm)) {
1742 /*----------------------------------------------------------------------*/
1743 /* CHTML 1.0 (W3C version 3.2) */
1744 /*----------------------------------------------------------------------*/
1745 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1746 align = apr_pstrdup(doc->buf.pool, val);
1762 * It is a handler who processes the P tag.
1764 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1765 * destination is specified.
1766 * @param node [i] The P tag node is specified.
1767 * @return The conversion result is returned.
1770 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1772 xhtml_t *xhtml = GET_XHTML(pdoc);
1773 Doc *doc = xhtml->doc;
1781 * It is a handler who processes the UL tag.
1783 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1784 * destination is specified.
1785 * @param node [i] The UL tag node is specified.
1786 * @return The conversion result is returned.
1789 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1791 xhtml_t *xhtml = GET_XHTML(pdoc);
1792 Doc *doc = xhtml->doc;
1795 /*--------------------------------------------------------------------------*/
1796 /* Get Attributes */
1797 /*--------------------------------------------------------------------------*/
1798 for (attr = qs_get_attr(doc,node);
1800 attr = qs_get_next_attr(doc,attr)) {
1801 char *name = qs_get_attr_name(doc,attr);
1802 char *value = qs_get_attr_value(doc,attr);
1803 if (STRCASEEQ('t','T',"type",name)) {
1804 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1817 * It is a handler who processes the UL tag.
1819 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1820 * destination is specified.
1821 * @param node [i] The UL tag node is specified.
1822 * @return The conversion result is returned.
1825 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1827 xhtml_t *xhtml = GET_XHTML(pdoc);
1828 Doc *doc = xhtml->doc;
1836 * It is a handler who processes the H1 tag.
1838 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1839 * destination is specified.
1840 * @param node [i] The H1 tag node is specified.
1841 * @return The conversion result is returned.
1844 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1846 xhtml_t *xhtml = GET_XHTML(pdoc);
1847 Doc *doc = xhtml->doc;
1851 for (attr = qs_get_attr(doc,node);
1853 attr = qs_get_next_attr(doc,attr)) {
1856 name = qs_get_attr_name(doc,attr);
1857 value = qs_get_attr_value(doc,attr);
1858 if (STRCASEEQ('a','A',"align", name)) {
1860 if (STRCASEEQ('l','L',"left",value)) {
1862 W_L("text-align:left");
1865 else if (STRCASEEQ('r','R',"right",value)) {
1867 W_L("text-align:right");
1870 else if (STRCASEEQ('c','C',"center",value)) {
1872 W_L("text-align:center");
1885 * It is a handler who processes the H1 tag.
1887 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1888 * destination is specified.
1889 * @param node [i] The H1 tag node is specified.
1890 * @return The conversion result is returned.
1893 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1895 xhtml_t *xhtml = GET_XHTML(pdoc);
1896 Doc *doc = xhtml->doc;
1904 * It is a handler who processes the H2 tag.
1906 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1907 * destination is specified.
1908 * @param node [i] The H2 tag node is specified.
1909 * @return The conversion result is returned.
1912 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1914 xhtml_t *xhtml = GET_XHTML(pdoc);
1915 Doc *doc = xhtml->doc;
1919 for (attr = qs_get_attr(doc,node);
1921 attr = qs_get_next_attr(doc,attr)) {
1924 name = qs_get_attr_name(doc,attr);
1925 value = qs_get_attr_value(doc,attr);
1926 if (STRCASEEQ('a','A',"align", name)) {
1928 if (STRCASEEQ('l','L',"left",value)) {
1930 W_L("text-align:left");
1933 else if (STRCASEEQ('r','R',"right",value)) {
1935 W_L("text-align:right");
1938 else if (STRCASEEQ('c','C',"center",value)) {
1940 W_L("text-align:center");
1953 * It is a handler who processes the H2 tag.
1955 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1956 * destination is specified.
1957 * @param node [i] The H2 tag node is specified.
1958 * @return The conversion result is returned.
1961 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1963 xhtml_t *xhtml = GET_XHTML(pdoc);
1964 Doc *doc = xhtml->doc;
1972 * It is a handler who processes the H3 tag.
1974 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1975 * destination is specified.
1976 * @param node [i] The H3 tag node is specified.
1977 * @return The conversion result is returned.
1980 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1982 xhtml_t *xhtml = GET_XHTML(pdoc);
1983 Doc *doc = xhtml->doc;
1987 for (attr = qs_get_attr(doc,node);
1989 attr = qs_get_next_attr(doc,attr)) {
1992 name = qs_get_attr_name(doc,attr);
1993 value = qs_get_attr_value(doc,attr);
1994 if (STRCASEEQ('a','A',"align", name)) {
1996 if (STRCASEEQ('l','L',"left",value)) {
1998 W_L("text-align:left");
2001 else if (STRCASEEQ('r','R',"right",value)) {
2003 W_L("text-align:right");
2006 else if (STRCASEEQ('c','C',"center",value)) {
2008 W_L("text-align:center");
2021 * It is a handler who processes the H3 tag.
2023 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2024 * destination is specified.
2025 * @param node [i] The H3 tag node is specified.
2026 * @return The conversion result is returned.
2029 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
2031 xhtml_t *xhtml = GET_XHTML(pdoc);
2032 Doc *doc = xhtml->doc;
2040 * It is a handler who processes the H4 tag.
2042 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2043 * destination is specified.
2044 * @param node [i] The H4 tag node is specified.
2045 * @return The conversion result is returned.
2048 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
2050 xhtml_t *xhtml = GET_XHTML(pdoc);
2051 Doc *doc = xhtml->doc;
2055 for (attr = qs_get_attr(doc,node);
2057 attr = qs_get_next_attr(doc,attr)) {
2060 name = qs_get_attr_name(doc,attr);
2061 value = qs_get_attr_value(doc,attr);
2062 if (STRCASEEQ('a','A',"align", name)) {
2064 if (STRCASEEQ('l','L',"left",value)) {
2066 W_L("text-align:left");
2069 else if (STRCASEEQ('r','R',"right",value)) {
2071 W_L("text-align:right");
2074 else if (STRCASEEQ('c','C',"center",value)) {
2076 W_L("text-align:center");
2089 * It is a handler who processes the H4 tag.
2091 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2092 * destination is specified.
2093 * @param node [i] The H4 tag node is specified.
2094 * @return The conversion result is returned.
2097 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2099 xhtml_t *xhtml = GET_XHTML(pdoc);
2100 Doc *doc = xhtml->doc;
2108 * It is a handler who processes the H5 tag.
2110 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2111 * destination is specified.
2112 * @param node [i] The H5 tag node is specified.
2113 * @return The conversion result is returned.
2116 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2118 xhtml_t *xhtml = GET_XHTML(pdoc);
2119 Doc *doc = xhtml->doc;
2123 for (attr = qs_get_attr(doc,node);
2125 attr = qs_get_next_attr(doc,attr)) {
2128 name = qs_get_attr_name(doc,attr);
2129 value = qs_get_attr_value(doc,attr);
2130 if (STRCASEEQ('a','A',"align", name)) {
2132 if (STRCASEEQ('l','L',"left",value)) {
2134 W_L("text-align:left");
2137 else if (STRCASEEQ('r','R',"right",value)) {
2139 W_L("text-align:right");
2142 else if (STRCASEEQ('c','C',"center",value)) {
2144 W_L("text-align:center");
2157 * It is a handler who processes the H5 tag.
2159 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2160 * destination is specified.
2161 * @param node [i] The H5 tag node is specified.
2162 * @return The conversion result is returned.
2165 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2167 xhtml_t *xhtml = GET_XHTML(pdoc);
2168 Doc *doc = xhtml->doc;
2176 * It is a handler who processes the H6 tag.
2178 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2179 * destination is specified.
2180 * @param node [i] The H6 tag node is specified.
2181 * @return The conversion result is returned.
2184 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2186 xhtml_t *xhtml = GET_XHTML(pdoc);
2187 Doc *doc = xhtml->doc;
2191 for (attr = qs_get_attr(doc,node);
2193 attr = qs_get_next_attr(doc,attr)) {
2196 name = qs_get_attr_name(doc,attr);
2197 value = qs_get_attr_value(doc,attr);
2198 if (STRCASEEQ('a','A',"align", name)) {
2200 if (STRCASEEQ('l','L',"left",value)) {
2202 W_L("text-align:left");
2205 else if (STRCASEEQ('r','R',"right",value)) {
2207 W_L("text-align:right");
2210 else if (STRCASEEQ('c','C',"center",value)) {
2212 W_L("text-align:center");
2225 * It is a handler who processes the H6 tag.
2227 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2228 * destination is specified.
2229 * @param node [i] The H6 tag node is specified.
2230 * @return The conversion result is returned.
2233 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2235 xhtml_t *xhtml = GET_XHTML(pdoc);
2236 Doc *doc = xhtml->doc;
2244 * It is a handler who processes the OL tag.
2246 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2247 * destination is specified.
2248 * @param node [i] The OL tag node is specified.
2249 * @return The conversion result is returned.
2252 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2254 xhtml_t *xhtml = GET_XHTML(pdoc);
2255 Doc *doc = xhtml->doc;
2259 /*--------------------------------------------------------------------------*/
2260 /* Get Attributes */
2261 /*--------------------------------------------------------------------------*/
2262 for (attr = qs_get_attr(doc,node);
2264 attr = qs_get_next_attr(doc,attr)) {
2265 char *name = qs_get_attr_name(doc,attr);
2266 char *value = qs_get_attr_value(doc,attr);
2267 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2272 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2284 * It is a handler who processes the OL tag.
2286 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2287 * destination is specified.
2288 * @param node [i] The OL tag node is specified.
2289 * @return The conversion result is returned.
2292 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2294 xhtml_t *xhtml = GET_XHTML(pdoc);
2295 Doc *doc = xhtml->doc;
2303 * It is a handler who processes the LI tag.
2305 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2306 * destination is specified.
2307 * @param node [i] The LI tag node is specified.
2308 * @return The conversion result is returned.
2311 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2313 xhtml_t *xhtml = GET_XHTML(pdoc);
2314 Doc *doc = xhtml->doc;
2318 /*--------------------------------------------------------------------------*/
2319 /* Get Attributes */
2320 /*--------------------------------------------------------------------------*/
2321 for (attr = qs_get_attr(doc,node);
2323 attr = qs_get_next_attr(doc,attr)) {
2324 char *name = qs_get_attr_name(doc,attr);
2325 char *value = qs_get_attr_value(doc,attr);
2326 if (STRCASEEQ('t','T',"type",name)) {
2327 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2333 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2345 ** It is a handler who processes the LI tag.
2347 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2348 * destination is specified.
2349 * @param node [i] The LI tag node is specified.
2350 * @return The conversion result is returned.
2353 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2355 xhtml_t *xhtml = GET_XHTML(pdoc);
2356 Doc *doc = xhtml->doc;
2363 * It is a handler who processes the IMG tag.
2365 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2366 * destination is specified.
2367 * @param node [i] The IMG tag node is specified.
2368 * @return The conversion result is returned.
2371 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2373 xhtml_t *xhtml = GET_XHTML(pdoc);
2374 Doc *doc = xhtml->doc;
2375 request_rec *r = doc->r;
2378 #ifndef IMG_NOT_CONVERT_FILENAME
2379 device_table *spec = xhtml->spec;
2383 /*--------------------------------------------------------------------------*/
2384 /* Get Attributes */
2385 /*--------------------------------------------------------------------------*/
2386 for (attr = qs_get_attr(doc,node);
2388 attr = qs_get_next_attr(doc,attr)) {
2389 char *name = qs_get_attr_name(doc,attr);
2390 char *value = qs_get_attr_value(doc,attr);
2392 if (STRCASEEQ('s','S',"src",name)) {
2393 value = chxj_encoding_parameter(r, value);
2394 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2395 value = chxj_add_cookie_no_update_parameter(r, value);
2396 #ifdef IMG_NOT_CONVERT_FILENAME
2406 char *vv = chxj_img_conv(r,spec,value);
2414 if (STRCASEEQ('a','A',"align",name)) {
2416 if (STRCASEEQ('t','T',"top", value) ||
2417 STRCASEEQ('m','M',"middle",value) ||
2418 STRCASEEQ('b','B',"bottom",value) ||
2419 STRCASEEQ('l','L',"left", value) ||
2420 STRCASEEQ('r','R',"right", value)) {
2425 else if (STRCASEEQ('c','C',"center", value)) {
2432 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2437 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2442 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2447 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2452 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2464 * It is a handler who processes the IMG tag.
2466 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2467 * destination is specified.
2468 * @param node [i] The IMG tag node is specified.
2469 * @return The conversion result is returned.
2472 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2474 xhtml_t *xhtml = GET_XHTML(pdoc);
2481 * It is a handler who processes the SELECT tag.
2483 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2484 * destination is specified.
2485 * @param node [i] The SELECT tag node is specified.
2486 * @return The conversion result is returned.
2489 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2491 xhtml_t *xhtml = GET_XHTML(pdoc);
2492 Doc *doc = xhtml->doc;
2495 char *multiple = NULL;
2500 for (attr = qs_get_attr(doc,child);
2502 attr = qs_get_next_attr(doc,attr)) {
2503 char *nm = qs_get_attr_name(doc,attr);
2504 char *val = qs_get_attr_value(doc,attr);
2505 if (STRCASEEQ('s','S',"size",nm)) {
2506 /*----------------------------------------------------------------------*/
2507 /* CHTML 1.0 version 2.0 */
2508 /*----------------------------------------------------------------------*/
2509 size = apr_pstrdup(doc->buf.pool, val);
2511 else if (STRCASEEQ('n','N',"name",nm)) {
2512 /*----------------------------------------------------------------------*/
2513 /* CHTML 1.0 version 2.0 */
2514 /*----------------------------------------------------------------------*/
2515 name = apr_pstrdup(doc->buf.pool, val);
2517 else if (STRCASEEQ('m','M',"multiple",nm)) {
2518 /*----------------------------------------------------------------------*/
2519 /* CHTML 1.0 version 2.0 */
2520 /*----------------------------------------------------------------------*/
2521 multiple = apr_pstrdup(doc->buf.pool, val);
2524 if (size && *size) {
2529 if (name && *name) {
2535 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2536 W_L(" multiple=\"true\"");
2544 * It is a handler who processes the SELECT tag.
2546 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2547 * destination is specified.
2548 * @param node [i] The SELECT tag node is specified.
2549 * @return The conversion result is returned.
2552 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2554 xhtml_t *xhtml = GET_XHTML(pdoc);
2555 Doc *doc = xhtml->doc;
2563 * It is a handler who processes the OPTION tag.
2565 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2566 * destination is specified.
2567 * @param node [i] The OPTION tag node is specified.
2568 * @return The conversion result is returned.
2571 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2573 xhtml_t *xhtml = GET_XHTML(pdoc);
2574 Doc *doc = xhtml->doc;
2577 char *selected = NULL;
2581 for (attr = qs_get_attr(doc,child);
2583 attr = qs_get_next_attr(doc,attr)) {
2584 char *nm = qs_get_attr_name(doc,attr);
2585 char *val = qs_get_attr_value(doc,attr);
2586 if (STRCASEEQ('s','S',"selected",nm)) {
2587 /* CHTML version 2.0 */
2588 selected = apr_pstrdup(doc->buf.pool, val);
2590 else if (STRCASEEQ('v','V',"value",nm)) {
2591 /* CHTML version 2.0 */
2592 value = apr_pstrdup(doc->buf.pool, val);
2601 W_L(" selected=\"selected\"");
2609 * It is a handler who processes the OPTION tag.
2611 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2612 * destination is specified.
2613 * @param node [i] The OPTION tag node is specified.
2614 * @return The conversion result is returned.
2617 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2619 xhtml_t *xhtml = GET_XHTML(pdoc);
2620 Doc *doc = xhtml->doc;
2628 * It is a handler who processes the DIV tag.
2630 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2631 * destination is specified.
2632 * @param node [i] The DIV tag node is specified.
2633 * @return The conversion result is returned.
2636 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2638 xhtml_t *xhtml = GET_XHTML(pdoc);
2639 Doc *doc = xhtml->doc;
2644 for (attr = qs_get_attr(doc,child);
2646 attr = qs_get_next_attr(doc,attr)) {
2647 char *nm = qs_get_attr_name(doc,attr);
2648 char *val = qs_get_attr_value(doc,attr);
2649 if (STRCASEEQ('a','A',"align",nm)) {
2650 /*=====================================================================*/
2651 /* CHTML version 3.2 */
2652 /*=====================================================================*/
2653 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2654 align = apr_pstrdup(doc->buf.pool, val);
2669 * It is a handler who processes the DIV tag.
2671 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2672 * destination is specified.
2673 * @param node [i] The DIV tag node is specified.
2674 * @return The conversion result is returned.
2677 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2679 xhtml_t *xhtml = GET_XHTML(pdoc);
2680 Doc *doc = xhtml->doc;
2687 * It is a handler who processes the B tag.
2689 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2690 * destination is specified.
2691 * @param node [i] The B tag node is specified.
2692 * @return The conversion result is returned.
2695 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2697 xhtml_t *xhtml = GET_XHTML(pdoc);
2698 Doc *doc = xhtml->doc;
2700 W_L("<div style=\"font-weight:bold\">");
2706 * It is a handler who processes the B tag.
2708 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2709 * destination is specified.
2710 * @param node [i] The B tag node is specified.
2711 * @return The conversion result is returned.
2714 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2716 xhtml_t *xhtml = GET_XHTML(pdoc);
2717 Doc *doc = xhtml->doc;
2725 * It is a handler who processes the CHXJ:IF tag.
2727 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2728 * destination is specified.
2729 * @param node [i] The CHXJ:IF tag node is specified.
2732 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2734 xhtml_t *xhtml = GET_XHTML(pdoc);
2735 Doc *doc = xhtml->doc;
2738 for (child = qs_get_child_node(doc, node);
2740 child = qs_get_next_node(doc, child)) {
2742 s_xhtml_1_0_chxjif_tag(xhtml, child);
2750 * It is a handler who processes the TEXTARE tag.
2752 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2753 * destination is specified.
2754 * @param node [i] The TEXTAREA tag node is specified.
2755 * @return The conversion result is returned.
2758 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2760 xhtml_t *xhtml = GET_XHTML(pdoc);
2761 Doc *doc = xhtml->doc;
2764 xhtml->textarea_flag++;
2766 for (attr = qs_get_attr(doc,node);
2768 attr = qs_get_next_attr(doc,attr)) {
2769 char *name = qs_get_attr_name(doc,attr);
2770 char *value = qs_get_attr_value(doc,attr);
2771 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2776 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2781 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2786 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2787 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2792 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2793 W_L(" accesskey=\"");
2804 * It is a handler who processes the TEXTAREA tag.
2806 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2807 * destination is specified.
2808 * @param node [i] The TEXTAREA tag node is specified.
2809 * @return The conversion result is returned.
2812 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2814 xhtml_t *xhtml = GET_XHTML(pdoc);
2815 Doc *doc = xhtml->doc;
2818 xhtml->textarea_flag--;
2824 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2826 xhtml_t *xhtml = GET_XHTML(pdoc);
2827 Doc *doc = xhtml->doc;
2828 request_rec *r = doc->r;
2836 textval = qs_get_node_value(doc,child);
2837 if (strlen(textval) == 0) {
2841 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2842 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2844 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2845 memset(one_byte, 0, sizeof(one_byte));
2848 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2850 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2852 DBG(r,"[%s][%d]", out, rtn);
2853 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2857 if (is_sjis_kanji(textval[ii])) {
2858 one_byte[0] = textval[ii+0];
2859 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2860 one_byte[0] = textval[ii+1];
2861 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2864 else if (xhtml->pre_flag) {
2865 one_byte[0] = textval[ii+0];
2866 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2868 else if (xhtml->textarea_flag) {
2869 one_byte[0] = textval[ii+0];
2870 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2872 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2873 one_byte[0] = textval[ii+0];
2874 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2883 * It is a handler who processes the BLOCKQUOTE tag.
2885 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2886 * destination is specified.
2887 * @param node [i] The BLOCKQUOTE tag node is specified.
2888 * @return The conversion result is returned.
2891 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2893 xhtml_t *xhtml = GET_XHTML(pdoc);
2894 Doc *doc = xhtml->doc;
2895 W_L("<blockquote>");
2901 * It is a handler who processes the BLOCKQUOTE tag.
2903 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2904 * destination is specified.
2905 * @param node [i] The BLOCKQUOTE tag node is specified.
2906 * @return The conversion result is returned.
2909 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2911 xhtml_t *xhtml = GET_XHTML(pdoc);
2912 Doc *doc = xhtml->doc;
2913 W_L("</blockquote>");
2919 * It is a handler who processes the DIR tag.
2921 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2922 * destination is specified.
2923 * @param node [i] The DIR tag node is specified.
2924 * @return The conversion result is returned.
2927 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2929 xhtml_t *xhtml = GET_XHTML(pdoc);
2930 Doc *doc = xhtml->doc;
2933 for (attr = qs_get_attr(doc,node);
2935 attr = qs_get_next_attr(doc,attr)) {
2936 char *name = qs_get_attr_name(doc,attr);
2937 char *value = qs_get_attr_value(doc,attr);
2938 if (STRCASEEQ('t','T',"type",name)) {
2939 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2952 * It is a handler who processes the DIR tag.
2954 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2955 * destination is specified.
2956 * @param node [i] The DIR tag node is specified.
2957 * @return The conversion result is returned.
2960 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2962 xhtml_t *xhtml = GET_XHTML(pdoc);
2963 Doc *doc = xhtml->doc;
2970 * It is a handler who processes the DL tag.
2972 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2973 * destination is specified.
2974 * @param node [i] The DL tag node is specified.
2975 * @return The conversion result is returned.
2978 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2980 xhtml_t *xhtml = GET_XHTML(pdoc);
2981 Doc *doc = xhtml->doc;
2988 * It is a handler who processes the DL tag.
2990 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2991 * destination is specified.
2992 * @param node [i] The DL tag node is specified.
2993 * @return The conversion result is returned.
2996 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2998 xhtml_t *xhtml = GET_XHTML(pdoc);
2999 Doc *doc = xhtml->doc;
3006 * It is a handter who processes the DT tag.
3008 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3009 * destination is specified.
3010 * @param node [i] The DT tag node is specified.
3011 * @return The conversion result is returned.
3014 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
3016 xhtml_t *xhtml = GET_XHTML(pdoc);
3017 Doc *doc = xhtml->doc;
3024 * It is a handter who processes the DT tag.
3026 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3027 * destination is specified.
3028 * @param node [i] The DT tag node is specified.
3029 * @return The conversion result is returned.
3032 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
3034 xhtml_t *xhtml = GET_XHTML(pdoc);
3035 Doc *doc = xhtml->doc;
3042 * It is a handder who processes the DD tag.
3044 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3045 * destination is specified.
3046 * @param node [i] The DD tag node is specified.
3047 * @return The conversion result is returned.
3050 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
3052 xhtml_t *xhtml = GET_XHTML(pdoc);
3053 Doc *doc = xhtml->doc;
3060 * It is a handder who processes the DD tag.
3062 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3063 * destination is specified.
3064 * @param node [i] The DD tag node is specified.
3065 * @return The conversion result is returned.
3068 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
3070 xhtml_t *xhtml = GET_XHTML(pdoc);
3071 Doc *doc = xhtml->doc;
3078 * It is a handler who processes the MENU tag.
3080 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3081 * destination is specified.
3082 * @param node [i] The MENU tag node is specified.
3083 * @return The conversion result is returned.
3086 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
3088 xhtml_t *xhtml = GET_XHTML(pdoc);
3089 Doc *doc = xhtml->doc;
3092 /*--------------------------------------------------------------------------*/
3093 /* Get Attributes */
3094 /*--------------------------------------------------------------------------*/
3095 for (attr = qs_get_attr(doc,node);
3097 attr = qs_get_next_attr(doc,attr)) {
3098 char *name = qs_get_attr_name(doc,attr);
3099 char *value = qs_get_attr_value(doc,attr);
3100 if (STRCASEEQ('t','T',"type",name)) {
3101 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3114 * It is a hanmenuer who processes the MENU tag.
3116 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3117 * destination is specified.
3118 * @param node [i] The MENU tag node is specified.
3119 * @return The conversion result is returned.
3122 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3124 xhtml_t *xhtml = GET_XHTML(pdoc);
3125 Doc *doc = xhtml->doc;
3132 * It is a handler who processes the PLAINTEXT tag.
3134 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3135 * destination is specified.
3136 * @param node [i] The PLAINTEXT tag node is specified.
3137 * @return The conversion result is returned.
3140 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3142 xhtml_t *xhtml = GET_XHTML(pdoc);
3143 Doc *doc = xhtml->doc;
3145 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3150 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3152 xhtml_t *xhtml = GET_XHTML(pdoc);
3153 Doc *doc = xhtml->doc;
3155 for (child = qs_get_child_node(doc, node);
3157 child = qs_get_next_node(doc, child)) {
3159 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3166 * It is a handler who processes the PLAINTEXT tag.
3168 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3169 * destination is specified.
3170 * @param node [i] The PLAINTEXT tag node is specified.
3171 * @return The conversion result is returned.
3174 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3176 xhtml_t *xhtml = GET_XHTML(pdoc);
3177 Doc *doc = xhtml->doc;
3178 W_L("</plaintext>");
3184 * It is a hanblinker who processes the BLINK tag.
3186 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3187 * destination is specified.
3188 * @param node [i] The BLINK tag node is specified.
3189 * @return The conversion result is returned.
3192 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3194 xhtml_t *xhtml = GET_XHTML(pdoc);
3195 Doc *doc = xhtml->doc;
3202 * It is a hanblinker who processes the BLINK tag.
3204 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3205 * destination is specified.
3206 * @param node [i] The BLINK tag node is specified.
3207 * @return The conversion result is returned.
3210 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3212 xhtml_t *xhtml = GET_XHTML(pdoc);
3213 Doc *doc = xhtml->doc;
3220 * It is a handler who processes the MARQUEE tag.
3222 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3223 * destination is specified.
3224 * @param node [i] The MARQUEE tag node is specified.
3225 * @return The conversion result is returned.
3228 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3230 xhtml_t *xhtml = GET_XHTML(pdoc);
3231 Doc *doc = xhtml->doc;
3234 /*--------------------------------------------------------------------------*/
3235 /* Get Attributes */
3236 /*--------------------------------------------------------------------------*/
3237 for (attr = qs_get_attr(doc,node);
3239 attr = qs_get_next_attr(doc,attr)) {
3240 char *name = qs_get_attr_name(doc,attr);
3241 char *value = qs_get_attr_value(doc,attr);
3242 if (STRCASEEQ('d','D',"direction", name)) {
3243 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3244 W_L(" direction=\"");
3249 else if (STRCASEEQ('b','B',"behavior",name)) {
3250 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3251 W_L(" behavior=\"");
3256 else if (STRCASEEQ('l','L',"loop",name)) {
3257 if (value && *value) {
3263 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3264 if (value && *value) {
3277 * It is a handler who processes the MARQUEE tag.
3279 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3280 * destination is specified.
3281 * @param node [i] The MARQUEE tag node is specified.
3282 * @return The conversion result is returned.
3285 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3287 xhtml_t *xhtml = GET_XHTML(pdoc);
3288 Doc *doc = xhtml->doc;
3295 * It is handler who processes the New Line Code.
3298 s_xhtml_1_0_newline_mark(void *pdoc, Node *UNUSED(node))
3300 xhtml_t *xhtml = GET_XHTML(pdoc);
3301 Doc *doc = xhtml->doc;