2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_encoding.h"
19 #include "chxj_xhtml_mobile_1_0.h"
20 #include "chxj_hdml.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_str_util.h"
27 #define GET_XHTML(X) ((xhtml_t*)(X))
30 #define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(xhtml->conf); W_V(nlcode); } while (0)
36 static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
37 static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
38 static char *s_xhtml_1_0_start_p_tag (void *pdoc, Node *node);
39 static char *s_xhtml_1_0_end_p_tag (void *pdoc, Node *node);
40 static char *s_xhtml_1_0_start_pre_tag (void *pdoc, Node *node);
41 static char *s_xhtml_1_0_end_pre_tag (void *pdoc, Node *node);
42 static char *s_xhtml_1_0_start_ul_tag (void *pdoc, Node *node);
43 static char *s_xhtml_1_0_end_ul_tag (void *pdoc, Node *node);
44 static char *s_xhtml_1_0_start_h1_tag (void *pdoc, Node *node);
45 static char *s_xhtml_1_0_end_h1_tag (void *pdoc, Node *node);
46 static char *s_xhtml_1_0_start_h2_tag (void *pdoc, Node *node);
47 static char *s_xhtml_1_0_end_h2_tag (void *pdoc, Node *node);
48 static char *s_xhtml_1_0_start_h3_tag (void *pdoc, Node *node);
49 static char *s_xhtml_1_0_end_h3_tag (void *pdoc, Node *node);
50 static char *s_xhtml_1_0_start_h4_tag (void *pdoc, Node *node);
51 static char *s_xhtml_1_0_end_h4_tag (void *pdoc, Node *node);
52 static char *s_xhtml_1_0_start_h5_tag (void *pdoc, Node *node);
53 static char *s_xhtml_1_0_end_h5_tag (void *pdoc, Node *node);
54 static char *s_xhtml_1_0_start_h6_tag (void *pdoc, Node *node);
55 static char *s_xhtml_1_0_end_h6_tag (void *pdoc, Node *node);
56 static char *s_xhtml_1_0_start_ol_tag (void *pdoc, Node *node);
57 static char *s_xhtml_1_0_end_ol_tag (void *pdoc, Node *node);
58 static char *s_xhtml_1_0_start_li_tag (void *pdoc, Node *node);
59 static char *s_xhtml_1_0_end_li_tag (void *pdoc, Node *node);
60 static char *s_xhtml_1_0_start_meta_tag (void *pdoc, Node *node);
61 static char *s_xhtml_1_0_end_meta_tag (void *pdoc, Node *node);
62 static char *s_xhtml_1_0_start_head_tag (void *pdoc, Node *node);
63 static char *s_xhtml_1_0_end_head_tag (void *pdoc, Node *node);
64 static char *s_xhtml_1_0_start_title_tag (void *pdoc, Node *node);
65 static char *s_xhtml_1_0_end_title_tag (void *pdoc, Node *node);
66 static char *s_xhtml_1_0_start_base_tag (void *pdoc, Node *node);
67 static char *s_xhtml_1_0_end_base_tag (void *pdoc, Node *node);
68 static char *s_xhtml_1_0_start_body_tag (void *pdoc, Node *node);
69 static char *s_xhtml_1_0_end_body_tag (void *pdoc, Node *node);
70 static char *s_xhtml_1_0_start_a_tag (void *pdoc, Node *node);
71 static char *s_xhtml_1_0_end_a_tag (void *pdoc, Node *node);
72 static char *s_xhtml_1_0_start_br_tag (void *pdoc, Node *node);
73 static char *s_xhtml_1_0_end_br_tag (void *pdoc, Node *node);
74 static char *s_xhtml_1_0_start_tr_tag (void *pdoc, Node *node);
75 static char *s_xhtml_1_0_end_tr_tag (void *pdoc, Node *node);
76 static char *s_xhtml_1_0_start_font_tag (void *pdoc, Node *node);
77 static char *s_xhtml_1_0_end_font_tag (void *pdoc, Node *node);
78 static char *s_xhtml_1_0_start_form_tag (void *pdoc, Node *node);
79 static char *s_xhtml_1_0_end_form_tag (void *pdoc, Node *node);
80 static char *s_xhtml_1_0_start_input_tag (void *pdoc, Node *node);
81 static char *s_xhtml_1_0_end_input_tag (void *pdoc, Node *node);
82 static char *s_xhtml_1_0_start_center_tag (void *pdoc, Node *node);
83 static char *s_xhtml_1_0_end_center_tag (void *pdoc, Node *node);
84 static char *s_xhtml_1_0_start_hr_tag (void *pdoc, Node *node);
85 static char *s_xhtml_1_0_end_hr_tag (void *pdoc, Node *node);
86 static char *s_xhtml_1_0_start_img_tag (void *pdoc, Node *node);
87 static char *s_xhtml_1_0_end_img_tag (void *pdoc, Node *node);
88 static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
89 static char *s_xhtml_1_0_end_select_tag (void *pdoc, Node *node);
90 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
91 static char *s_xhtml_1_0_end_option_tag (void *pdoc, Node *node);
92 static char *s_xhtml_1_0_start_div_tag (void *pdoc, Node *node);
93 static char *s_xhtml_1_0_end_div_tag (void *pdoc, Node *node);
94 static char *s_xhtml_1_0_start_textarea_tag (void *pdoc, Node *node);
95 static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
96 static char *s_xhtml_1_0_start_b_tag (void *pdoc, Node *node);
97 static char *s_xhtml_1_0_end_b_tag (void *pdoc, Node *node);
98 static char *s_xhtml_1_0_chxjif_tag (void *pdoc, Node *node);
99 static char *s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *node);
100 static char *s_xhtml_1_0_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_xhtml_1_0_start_dir_tag (void *pdoc, Node *node);
102 static char *s_xhtml_1_0_end_dir_tag (void *pdoc, Node *node);
103 static char *s_xhtml_1_0_start_dl_tag (void *pdoc, Node *node);
104 static char *s_xhtml_1_0_end_dl_tag (void *pdoc, Node *node);
105 static char *s_xhtml_1_0_start_dt_tag (void *pdoc, Node *node);
106 static char *s_xhtml_1_0_end_dt_tag (void *pdoc, Node *node);
107 static char *s_xhtml_1_0_start_dd_tag (void *pdoc, Node *node);
108 static char *s_xhtml_1_0_end_dd_tag (void *pdoc, Node *node);
109 static char *s_xhtml_1_0_start_menu_tag (void *pdoc, Node *node);
110 static char *s_xhtml_1_0_end_menu_tag (void *pdoc, Node *node);
111 static char *s_xhtml_1_0_start_plaintext_tag (void *pdoc, Node *node);
112 static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
113 static char *s_xhtml_1_0_end_plaintext_tag (void *pdoc, Node *node);
114 static char *s_xhtml_1_0_start_blink_tag (void *pdoc, Node *node);
115 static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
116 static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
117 static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
118 static char *s_xhtml_1_0_newline_mark (void *pdoc, Node *node);
120 static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
121 static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
122 static char *s_xhtml_1_0_text_tag(void *pdoc, Node *child);
125 tag_handler xhtml_handler[] = {
128 s_xhtml_1_0_start_html_tag,
129 s_xhtml_1_0_end_html_tag,
133 s_xhtml_1_0_start_meta_tag,
134 s_xhtml_1_0_end_meta_tag,
138 s_xhtml_1_0_start_textarea_tag,
139 s_xhtml_1_0_end_textarea_tag,
143 s_xhtml_1_0_start_p_tag,
144 s_xhtml_1_0_end_p_tag,
148 s_xhtml_1_0_start_pre_tag,
149 s_xhtml_1_0_end_pre_tag,
153 s_xhtml_1_0_start_ul_tag,
154 s_xhtml_1_0_end_ul_tag,
158 s_xhtml_1_0_start_li_tag,
159 s_xhtml_1_0_end_li_tag,
163 s_xhtml_1_0_start_ol_tag,
164 s_xhtml_1_0_end_ol_tag,
168 s_xhtml_1_0_start_h1_tag,
169 s_xhtml_1_0_end_h1_tag,
173 s_xhtml_1_0_start_h2_tag,
174 s_xhtml_1_0_end_h2_tag,
178 s_xhtml_1_0_start_h3_tag,
179 s_xhtml_1_0_end_h3_tag,
183 s_xhtml_1_0_start_h4_tag,
184 s_xhtml_1_0_end_h4_tag,
188 s_xhtml_1_0_start_h5_tag,
189 s_xhtml_1_0_end_h5_tag,
193 s_xhtml_1_0_start_h6_tag,
194 s_xhtml_1_0_end_h6_tag,
198 s_xhtml_1_0_start_head_tag,
199 s_xhtml_1_0_end_head_tag,
203 s_xhtml_1_0_start_title_tag,
204 s_xhtml_1_0_end_title_tag,
208 s_xhtml_1_0_start_base_tag,
209 s_xhtml_1_0_end_base_tag,
213 s_xhtml_1_0_start_body_tag,
214 s_xhtml_1_0_end_body_tag,
218 s_xhtml_1_0_start_a_tag,
219 s_xhtml_1_0_end_a_tag,
223 s_xhtml_1_0_start_br_tag,
224 s_xhtml_1_0_end_br_tag,
233 s_xhtml_1_0_start_tr_tag,
234 s_xhtml_1_0_end_tr_tag,
248 s_xhtml_1_0_start_font_tag,
249 s_xhtml_1_0_end_font_tag,
253 s_xhtml_1_0_start_form_tag,
254 s_xhtml_1_0_end_form_tag,
258 s_xhtml_1_0_start_input_tag,
259 s_xhtml_1_0_end_input_tag,
263 s_xhtml_1_0_start_center_tag,
264 s_xhtml_1_0_end_center_tag,
268 s_xhtml_1_0_start_hr_tag,
269 s_xhtml_1_0_end_hr_tag,
273 s_xhtml_1_0_start_img_tag,
274 s_xhtml_1_0_end_img_tag,
278 s_xhtml_1_0_start_select_tag,
279 s_xhtml_1_0_end_select_tag,
283 s_xhtml_1_0_start_option_tag,
284 s_xhtml_1_0_end_option_tag,
288 s_xhtml_1_0_start_div_tag,
289 s_xhtml_1_0_end_div_tag,
293 s_xhtml_1_0_chxjif_tag,
318 s_xhtml_1_0_text_tag,
328 s_xhtml_1_0_start_b_tag,
329 s_xhtml_1_0_end_b_tag,
338 s_xhtml_1_0_start_dt_tag,
339 s_xhtml_1_0_end_dt_tag,
353 s_xhtml_1_0_start_blockquote_tag,
354 s_xhtml_1_0_end_blockquote_tag,
358 s_xhtml_1_0_start_dir_tag,
359 s_xhtml_1_0_end_dir_tag,
363 s_xhtml_1_0_start_dl_tag,
364 s_xhtml_1_0_end_dl_tag,
368 s_xhtml_1_0_start_dd_tag,
369 s_xhtml_1_0_end_dd_tag,
373 s_xhtml_1_0_start_menu_tag,
374 s_xhtml_1_0_end_menu_tag,
378 s_xhtml_1_0_start_plaintext_tag,
379 s_xhtml_1_0_end_plaintext_tag,
383 s_xhtml_1_0_start_blink_tag,
384 s_xhtml_1_0_end_blink_tag,
388 s_xhtml_1_0_start_marquee_tag,
389 s_xhtml_1_0_end_marquee_tag,
393 s_xhtml_1_0_newline_mark,
399 * converts from CHTML to XHTML.
401 * @param r [i] Requet_rec is appointed.
402 * @param spec [i] The result of the device specification processing which
403 * was done in advance is appointed.
404 * @param src [i] The character string before the converting is appointed.
405 * @return The character string after the converting is returned.
408 chxj_convert_xhtml_mobile_1_0(
414 chxjconvrule_entry *entryp,
423 DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
424 /*--------------------------------------------------------------------------*/
426 /*--------------------------------------------------------------------------*/
428 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
430 DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
434 /*--------------------------------------------------------------------------*/
435 /* The XHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_xhtml(&xhtml, &doc, r, spec);
439 xhtml.entryp = entryp;
440 xhtml.cookie = cookie;
442 chxj_set_content_type(r, "text/html; charset=Windows-31J");
444 /*--------------------------------------------------------------------------*/
445 /* The character string of the input is analyzed. */
446 /*--------------------------------------------------------------------------*/
447 qs_init_malloc(&doc);
448 qs_init_root_node(&doc);
450 ss = apr_pcalloc(r->pool, srclen + 1);
451 memset(ss, 0, srclen + 1);
452 memcpy(ss, src, srclen);
455 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
457 qs_parse_string(&doc,ss, strlen(ss));
459 chxj_buffered_write_init(r->pool, &doc.buf);
460 /*--------------------------------------------------------------------------*/
461 /* It converts it from CHTML to XHTML. */
462 /*--------------------------------------------------------------------------*/
463 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
464 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
465 dst = apr_pstrdup(r->pool, xhtml.out);
466 chxj_buffered_write_terminate(&doc.buf);
468 qs_all_free(&doc,QX_LOGMARK);
471 return apr_pstrdup(r->pool,ss);
475 dst = apr_psprintf(r->pool, "\n");
477 *dstlen = strlen(dst);
480 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
483 DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
489 * The XHTML structure is initialized.
491 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
492 * initialized is specified.
493 * @param doc [i] The Doc structure that should be set to the initialized
494 * HDML structure is specified.
495 * @param r [i] To use POOL, the pointer to request_rec is specified.
496 * @param spec [i] The pointer to the device_table
499 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
501 memset(doc, 0, sizeof(Doc));
502 memset(xhtml, 0, sizeof(xhtml_t));
507 xhtml->out = qs_alloc_zero_byte_string(r->pool);
508 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
509 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
514 * Corresponding EMOJI to a current character-code is retrieved.
515 * The substitution character string is stored in the rslt pointer if agreeing.
517 * @param xhtml [i] The pointer to the XHTML structure is specified.
518 * @param txt [i] The character string to want to examine whether it is
519 * EMOJI is specified.
520 * @param rslt [o] The pointer to the pointer that stores the result is
522 * @return When corresponding EMOJI exists, it returns it excluding 0.
525 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
538 DBG(r,"spec is NULL");
541 for (ee = xhtml->conf->emoji;
544 unsigned char hex1byte;
545 unsigned char hex2byte;
547 DBG(r,"emoji->imode is NULL");
551 if (ee->imode->string != NULL
552 && strlen(ee->imode->string) > 0
553 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
554 if (spec == NULL || spec->emoji_type == NULL) {
555 *rslt = apr_psprintf(r->pool,
558 return strlen(ee->imode->string);
561 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
562 *rslt = apr_psprintf(r->pool,
565 return strlen(ee->imode->string);
568 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
569 *rslt = apr_psprintf(r->pool,
572 return strlen(ee->imode->string);
575 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
576 *rslt = apr_psprintf(r->pool,
579 return strlen(ee->imode->string);
582 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
583 *rslt = apr_psprintf(r->pool,
586 return strlen(ee->imode->string);
589 *rslt = apr_psprintf(r->pool,
592 return strlen(ee->imode->string);
596 hex1byte = ee->imode->hex1byte & 0xff;
597 hex2byte = ee->imode->hex2byte & 0xff;
599 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
600 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
601 if (spec == NULL || spec->emoji_type == NULL) {
602 *rslt = apr_psprintf(r->pool,
603 "<img localsrc=\"%s\">",
608 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
609 *rslt = apr_psprintf(r->pool,
610 "<img localsrc=\"%s\">",
615 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
616 *rslt = apr_psprintf(r->pool,
617 "<img localsrc=\"%s\">",
622 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
623 *rslt = apr_psprintf(r->pool,
624 "<img localsrc=\"%s\">",
629 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
630 *rslt = apr_psprintf(r->pool,
631 "<img localsrc=\"%s\">",
636 *rslt = apr_psprintf(r->pool,
637 "<img localsrc=\"%s\">",
649 * It is a handler who processes the HTML tag.
651 * @param pdoc [i/o] The pointer to the XHTML structure at the output
652 * destination is specified.
653 * @param node [i] The HTML tag node is specified.
654 * @return The conversion result is returned.
657 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
659 xhtml_t *xhtml = GET_XHTML(pdoc);
661 Doc *doc = xhtml->doc;
663 /*--------------------------------------------------------------------------*/
664 /* Add XML Declare */
665 /*--------------------------------------------------------------------------*/
666 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>");
668 /*--------------------------------------------------------------------------*/
670 /*--------------------------------------------------------------------------*/
671 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"");
673 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">");
675 /*--------------------------------------------------------------------------*/
677 /*--------------------------------------------------------------------------*/
678 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
679 /*--------------------------------------------------------------------------*/
681 /*--------------------------------------------------------------------------*/
682 for (attr = qs_get_attr(doc,node);
684 attr = qs_get_next_attr(doc,attr)) {
685 char* name = qs_get_attr_name(doc,attr);
686 char* value = qs_get_attr_value(doc,attr);
687 if (STRCASEEQ('l','L',"lang", name)) {
692 else if (STRCASEEQ('v','V',"version", name)) {
693 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
702 * It is a handler who processes the HTML tag.
704 * @param pdoc [i/o] The pointer to the XHTML structure at the output
705 * destination is specified.
706 * @param node [i] The HTML tag node is specified.
707 * @return The conversion result is returned.
710 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
712 xhtml_t *xhtml = GET_XHTML(pdoc);
713 Doc *doc = xhtml->doc;
720 * It is a handler who processes the META tag.
722 * @param pdoc [i/o] The pointer to the XHTML structure at the output
723 * destination is specified.
724 * @param node [i] The META tag node is specified.
725 * @return The conversion result is returned.
728 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
730 xhtml_t *xhtml = GET_XHTML(pdoc);
732 Doc *doc = xhtml->doc;
733 int content_type_flag = 0;
736 /*--------------------------------------------------------------------------*/
738 /*--------------------------------------------------------------------------*/
739 for (attr = qs_get_attr(doc,node);
741 attr = qs_get_next_attr(doc,attr)) {
742 char *name = qs_get_attr_name(doc,attr);
743 char *value = qs_get_attr_value(doc,attr);
744 if (STRCASEEQ('n','N',"name", name) && value && *value) {
751 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
757 if (STRCASEEQ('c','C', "content-type", value)) {
758 content_type_flag = 1;
761 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
762 if (content_type_flag) {
766 W_L("text/html; charset=Windows-31J");
784 * It is a handler who processes the META tag.
786 * @param pdoc [i/o] The pointer to the XHTML structure at the output
787 * destination is specified.
788 * @param node [i] The META tag node is specified.
789 * @return The conversion result is returned.
792 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
794 xhtml_t *xhtml = GET_XHTML(pdoc);
801 * It is a handler who processes the HEAD tag.
803 * @param pdoc [i/o] The pointer to the XHTML structure at the output
804 * destination is specified.
805 * @param node [i] The HEAD tag node is specified.
806 * @return The conversion result is returned.
809 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
811 xhtml_t *xhtml = GET_XHTML(pdoc);
812 Doc *doc = xhtml->doc;
820 * It is a handler who processes the HEAD tag.
822 * @param pdoc [i/o] The pointer to the XHTML structure at the output
823 * destination is specified.
824 * @param node [i] The HEAD tag node is specified.
825 * @return The conversion result is returned.
828 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
830 xhtml_t *xhtml = GET_XHTML(pdoc);
831 Doc *doc = xhtml->doc;
839 * It is a handler who processes the TITLE tag.
841 * @param pdoc [i/o] The pointer to the XHTML structure at the output
842 * destination is specified.
843 * @param node [i] The TITLE tag node is specified.
844 * @return The conversion result is returned.
847 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
849 xhtml_t *xhtml = GET_XHTML(pdoc);
850 Doc *doc = xhtml->doc;
858 * It is a handler who processes the TITLE tag.
860 * @param pdoc [i/o] The pointer to the XHTML structure at the output
861 * destination is specified.
862 * @param node [i] The TITLE tag node is specified.
863 * @return The conversion result is returned.
866 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
868 xhtml_t *xhtml = GET_XHTML(pdoc);
869 Doc *doc = xhtml->doc;
878 * It is a handler who processes the BASE tag.
880 * @param pdoc [i/o] The pointer to the XHTML structure at the output
881 * destination is specified.
882 * @param node [i] The BASE tag node is specified.
883 * @return The conversion result is returned.
886 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
888 xhtml_t *xhtml = GET_XHTML(pdoc);
890 Doc *doc = xhtml->doc;
893 /*--------------------------------------------------------------------------*/
895 /*--------------------------------------------------------------------------*/
896 for (attr = qs_get_attr(doc,node);
898 attr = qs_get_next_attr(doc,attr)) {
899 char *name = qs_get_attr_name(doc,attr);
900 char *value = qs_get_attr_value(doc,attr);
901 if (STRCASEEQ('h','H',"href",name)) {
915 * It is a handler who processes the BASE tag.
917 * @param pdoc [i/o] The pointer to the XHTML structure at the output
918 * destination is specified.
919 * @param node [i] The BASE tag node is specified.
920 * @return The conversion result is returned.
923 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
925 xhtml_t *xhtml = GET_XHTML(pdoc);
932 * It is a handler who processes the BODY tag.
934 * @param pdoc [i/o] The pointer to the XHTML structure at the output
935 * destination is specified.
936 * @param node [i] The BODY tag node is specified.
937 * @return The conversion result is returned.
940 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
942 xhtml_t *xhtml = GET_XHTML(pdoc);
943 Doc *doc = xhtml->doc;
947 /*--------------------------------------------------------------------------*/
949 /*--------------------------------------------------------------------------*/
950 for (attr = qs_get_attr(doc,node);
952 attr = qs_get_next_attr(doc,attr)) {
953 char *name = qs_get_attr_name(doc,attr);
954 char *value = qs_get_attr_value(doc,attr);
955 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
960 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
965 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
970 else if (STRCASEEQ('a','A',"alink", name)) {
973 else if (STRCASEEQ('v','V',"vlink",name)) {
983 * It is a handler who processes the BODY tag.
985 * @param pdoc [i/o] The pointer to the XHTML structure at the output
986 * destination is specified.
987 * @param node [i] The BODY tag node is specified.
988 * @return The conversion result is returned.
991 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
993 xhtml_t *xhtml = GET_XHTML(pdoc);
994 Doc *doc = xhtml->doc;
1002 * It is a handler who processes the A tag.
1004 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1005 * destination is specified.
1006 * @param node [i] The A tag node is specified.
1007 * @return The conversion result is returned.
1010 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
1012 xhtml_t *xhtml = GET_XHTML(pdoc);
1013 Doc *doc = xhtml->doc;
1014 request_rec *r = doc->r;
1018 /*--------------------------------------------------------------------------*/
1019 /* Get Attributes */
1020 /*--------------------------------------------------------------------------*/
1021 for (attr = qs_get_attr(doc,node);
1023 attr = qs_get_next_attr(doc,attr)) {
1024 char* name = qs_get_attr_name(doc,attr);
1025 char* value = qs_get_attr_value(doc,attr);
1026 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1031 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1032 value = chxj_encoding_parameter(r, value);
1033 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1038 else if (STRCASEEQ('a','A',"accesskey", name)) {
1039 W_L(" accesskey=\"");
1043 else if (STRCASEEQ('c','C',"cti",name)) {
1046 else if (STRCASEEQ('i','I',"ijam", name)) {
1049 else if (STRCASEEQ('u','U',"utn", name)) {
1052 else if (STRCASEEQ('t','T',"telbook",name)) {
1055 else if (STRCASEEQ('k','K',"kana",name)) {
1058 else if (STRCASEEQ('e','E',"email",name)) {
1061 else if (STRCASEEQ('i','I',"ista",name)) {
1064 else if (STRCASEEQ('i','I',"ilet",name)) {
1067 else if (STRCASEEQ('i','I',"iswf",name)) {
1070 else if (STRCASEEQ('i','I',"irst",name)) {
1080 * It is a handler who processes the A tag.
1082 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1083 * destination is specified.
1084 * @param node [i] The A tag node is specified.
1085 * @return The conversion result is returned.
1088 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1090 xhtml_t *xhtml = GET_XHTML(pdoc);
1091 Doc *doc = xhtml->doc;
1100 * It is a handler who processes the BR tag.
1102 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1103 * destination is specified.
1104 * @param node [i] The BR tag node is specified.
1105 * @return The conversion result is returned.
1108 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1110 xhtml_t *xhtml = GET_XHTML(pdoc);
1111 Doc *doc = xhtml->doc;
1115 /*--------------------------------------------------------------------------*/
1116 /* Get Attributes */
1117 /*--------------------------------------------------------------------------*/
1118 for (attr = qs_get_attr(doc,node);
1120 attr = qs_get_next_attr(doc,attr)) {
1121 char *name = qs_get_attr_name(doc,attr);
1122 char *value = qs_get_attr_value(doc,attr);
1123 if (STRCASEEQ('c','C',"clear",name)) {
1124 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1138 * It is a handler who processes the BR tag.
1140 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1141 * destination is specified.
1142 * @param node [i] The BR tag node is specified.
1143 * @return The conversion result is returned.
1146 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1148 xhtml_t *xhtml = GET_XHTML(pdoc);
1155 * It is a handler who processes the TR tag.
1157 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1158 * destination is specified.
1159 * @param node [i] The TR tag node is specified.
1160 * @return The conversion result is returned.
1163 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1165 xhtml_t *xhtml = GET_XHTML(pdoc);
1166 Doc *doc = xhtml->doc;
1175 * It is a handler who processes the TR tag.
1177 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1178 * destination is specified.
1179 * @param node [i] The TR tag node is specified.
1180 * @return The conversion result is returned.
1183 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1185 xhtml_t *xhtml = GET_XHTML(pdoc);
1192 * It is a handler who processes the FONT tag.
1194 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1195 * destination is specified.
1196 * @param node [i] The FONT tag node is specified.
1197 * @return The conversion result is returned.
1200 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1202 xhtml_t *xhtml = GET_XHTML(pdoc);
1203 Doc *doc = xhtml->doc;
1208 /*=========================================================================*/
1209 /* Get Attributes */
1210 /*=========================================================================*/
1211 for (attr = qs_get_attr(doc,node);
1213 attr = qs_get_next_attr(doc,attr)) {
1214 char *name = qs_get_attr_name(doc,attr);
1215 char *value = qs_get_attr_value(doc,attr);
1216 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1217 color = apr_pstrdup(doc->buf.pool, value);
1219 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1220 size = apr_pstrdup(doc->buf.pool, value);
1224 W_L("<font color=\"");
1227 xhtml->font_color_flag++;
1230 xhtml->font_size_flag++;
1232 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1233 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1234 case '3': W_L("<span style=\"font-size: small\">"); break;
1235 case '4': W_L("<span style=\"font-size: medium\">"); break;
1236 case '5': W_L("<span style=\"font-size: large\">"); break;
1237 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1238 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1240 if (*(size + 1) == '1') {
1241 W_L("<span style=\"font-size: small\">");
1244 if (*(size + 1) == '2') {
1245 W_L("<span style=\"font-size: x-small\">");
1248 if (*(size + 1) == '3') {
1249 W_L("<span style=\"font-size: xx-small\">");
1252 xhtml->font_size_flag--;
1256 if (*(size + 1) == '1') {
1257 W_L("<span style=\"font-size: large\">");
1260 if (*(size + 1) == '2') {
1261 W_L("<span style=\"font-size: x-large\">");
1264 if (*(size + 1) == '3') {
1265 W_L("<span style=\"font-size: xx-large\">");
1268 xhtml->font_size_flag--;
1272 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1273 xhtml->font_size_flag--;
1281 * It is a handler who processes the FONT tag.
1283 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1284 * destination is specified.
1285 * @param node [i] The FONT tag node is specified.
1286 * @return The conversion result is returned.
1289 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1291 xhtml_t *xhtml = GET_XHTML(pdoc);
1292 Doc *doc = xhtml->doc;
1294 if (xhtml->font_size_flag) {
1296 xhtml->font_size_flag--;
1298 if (xhtml->font_color_flag) {
1300 xhtml->font_color_flag--;
1307 * It is a handler who processes the FORM tag.
1309 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1310 * destination is specified.
1311 * @param node [i] The FORM tag node is specified.
1312 * @return The conversion result is returned.
1315 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1317 xhtml_t *xhtml = GET_XHTML(pdoc);
1318 Doc *doc = xhtml->doc;
1319 request_rec *r = doc->r;
1321 char *new_hidden_tag = NULL;
1324 /*--------------------------------------------------------------------------*/
1325 /* Get Attributes */
1326 /*--------------------------------------------------------------------------*/
1327 for (attr = qs_get_attr(doc,node);
1329 attr = qs_get_next_attr(doc,attr)) {
1330 char *name = qs_get_attr_name(doc,attr);
1331 char *value = qs_get_attr_value(doc,attr);
1332 if (STRCASEEQ('a','A',"action",name)) {
1333 value = chxj_encoding_parameter(r, value);
1334 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1336 q = strchr(value, '?');
1338 new_hidden_tag = chxj_form_action_to_hidden_tag(doc->pool, value, 1);
1345 else if (STRCASEEQ('m','M',"method",name)) {
1350 else if (STRCASEEQ('u','U',"utn",name)) {
1353 else if (STRCASEEQ('n','N',"name",name)) {
1360 if (new_hidden_tag) {
1361 W_V(new_hidden_tag);
1368 * It is a handler who processes the FORM tag.
1370 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1371 * destination is specified.
1372 * @param node [i] The FORM tag node is specified.
1373 * @return The conversion result is returned.
1376 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1378 xhtml_t *xhtml = GET_XHTML(pdoc);
1379 Doc *doc = xhtml->doc;
1388 * It is a handler who processes the INPUT tag.
1390 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1391 * destination is specified.
1392 * @param node [i] The INPUT tag node is specified.
1393 * @return The conversion result is returned.
1396 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1398 xhtml_t *xhtml = GET_XHTML(pdoc);
1399 Doc *doc = xhtml->doc;
1400 request_rec *r = doc->r;
1401 char *max_length = NULL;
1405 char *istyle = NULL;
1407 char *checked = NULL;
1408 char *accesskey = NULL;
1411 /*--------------------------------------------------------------------------*/
1412 /* Get Attributes */
1413 /*--------------------------------------------------------------------------*/
1414 type = qs_get_type_attr(doc, node, doc->buf.pool);
1415 name = qs_get_name_attr(doc, node, doc->buf.pool);
1416 value = qs_get_value_attr(doc,node, doc->buf.pool);
1417 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1418 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1419 checked = qs_get_checked_attr(doc,node, doc->buf.pool);
1420 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1421 size = qs_get_size_attr(doc, node, doc->buf.pool);
1424 type = qs_trim_string(doc->buf.pool, type);
1425 if (type && (STRCASEEQ('t','T',"text", type) ||
1426 STRCASEEQ('p','P',"password",type) ||
1427 STRCASEEQ('c','C',"checkbox",type) ||
1428 STRCASEEQ('r','R',"radio", type) ||
1429 STRCASEEQ('h','H',"hidden", type) ||
1430 STRCASEEQ('s','S',"submit", type) ||
1431 STRCASEEQ('r','R',"reset", type))) {
1437 if (size && *size) {
1442 if (name && *name) {
1447 if (value && *value) {
1449 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1452 if (accesskey && *accesskey) {
1453 W_L(" accesskey=\"");
1457 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1458 char *fmt = qs_conv_istyle_to_format(r,istyle);
1459 if (max_length && *max_length) {
1461 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1462 if (max_length[ii] < '0' || max_length[ii] > '9') {
1463 max_length = apr_psprintf(r->pool, "0");
1468 if (strcmp(max_length, "0")) {
1469 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1481 if (max_length && *max_length) {
1482 if (chxj_chk_numeric(max_length) != 0) {
1483 max_length = apr_psprintf(r->pool, "0");
1485 if (strcmp(max_length, "0")) {
1486 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1491 /*--------------------------------------------------------------------------*/
1492 /* The figure is default for the password. */
1493 /*--------------------------------------------------------------------------*/
1494 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1501 W_L(" FORMAT=\"*N\"");
1505 W_L(" checked=\"checked\"");
1514 * It is a handler who processes the INPUT tag.
1516 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1517 * destination is specified.
1518 * @param node [i] The INPUT tag node is specified.
1519 * @return The conversion result is returned.
1522 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1524 xhtml_t *xhtml = GET_XHTML(pdoc);
1531 * It is a handler who processes the CENTER tag.
1533 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1534 * destination is specified.
1535 * @param node [i] The CENTER tag node is specified.
1536 * @return The conversion result is returned.
1539 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1541 xhtml_t *xhtml = GET_XHTML(pdoc);
1542 Doc *doc = xhtml->doc;
1550 * It is a handler who processes the CENTER tag.
1552 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1553 * destination is specified.
1554 * @param node [i] The CENTER tag node is specified.
1555 * @return The conversion result is returned.
1558 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1560 xhtml_t *xhtml = GET_XHTML(pdoc);
1561 Doc *doc = xhtml->doc;
1569 * It is a handler who processes the HR tag.
1571 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1572 * destination is specified.
1573 * @param node [i] The HR tag node is specified.
1574 * @return The conversion result is returned.
1577 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1579 xhtml_t *xhtml = GET_XHTML(pdoc);
1580 Doc *doc = xhtml->doc;
1585 for (attr = qs_get_attr(doc,node);
1587 attr = qs_get_next_attr(doc,attr)) {
1588 char *name = qs_get_attr_name(doc,attr);
1589 char *value = qs_get_attr_value(doc,attr);
1590 if (STRCASEEQ('a','A',"align", name)) {
1591 /*----------------------------------------------------------------------*/
1593 /*----------------------------------------------------------------------*/
1594 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1600 else if (STRCASEEQ('s','S',"size", name)) {
1601 /*----------------------------------------------------------------------*/
1603 /*----------------------------------------------------------------------*/
1604 if (value && *value) {
1610 else if (STRCASEEQ('w','W',"width", name)) {
1611 /*----------------------------------------------------------------------*/
1613 /*----------------------------------------------------------------------*/
1614 if (value && *value) {
1620 else if (STRCASEEQ('n','N',"noshade", name)) {
1621 /*----------------------------------------------------------------------*/
1623 /*----------------------------------------------------------------------*/
1626 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1627 /*----------------------------------------------------------------------*/
1629 /*----------------------------------------------------------------------*/
1641 * It is a handler who processes the HR tag.
1643 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1644 * destination is specified.
1645 * @param node [i] The HR tag node is specified.
1646 * @return The conversion result is returned.
1649 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1651 xhtml_t *xhtml = GET_XHTML(pdoc);
1658 * It is a handler who processes the PRE tag.
1660 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1661 * destination is specified.
1662 * @param node [i] The PRE tag node is specified.
1663 * @return The conversion result is returned.
1666 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1668 xhtml_t *xhtml = GET_XHTML(pdoc);
1669 Doc *doc = xhtml->doc;
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_end_pre_tag(void *pdoc, Node *UNUSED(child))
1688 xhtml_t *xhtml = GET_XHTML(pdoc);
1689 Doc *doc = xhtml->doc;
1699 * It is a handler who processes the P tag.
1701 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1702 * destination is specified.
1703 * @param node [i] The P tag node is specified.
1704 * @return The conversion result is returned.
1707 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1709 xhtml_t *xhtml = GET_XHTML(pdoc);
1710 Doc *doc = xhtml->doc;
1715 for (attr = qs_get_attr(doc,node);
1717 attr = qs_get_next_attr(doc,attr)) {
1718 char *nm = qs_get_attr_name(doc,attr);
1719 char *val = qs_get_attr_value(doc,attr);
1720 if (STRCASEEQ('a','A',"align", nm)) {
1721 /*----------------------------------------------------------------------*/
1722 /* CHTML 1.0 (W3C version 3.2) */
1723 /*----------------------------------------------------------------------*/
1724 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1725 align = apr_pstrdup(doc->buf.pool, val);
1741 * It is a handler who processes the P tag.
1743 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1744 * destination is specified.
1745 * @param node [i] The P tag node is specified.
1746 * @return The conversion result is returned.
1749 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1751 xhtml_t *xhtml = GET_XHTML(pdoc);
1752 Doc *doc = xhtml->doc;
1760 * It is a handler who processes the UL tag.
1762 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1763 * destination is specified.
1764 * @param node [i] The UL tag node is specified.
1765 * @return The conversion result is returned.
1768 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1770 xhtml_t *xhtml = GET_XHTML(pdoc);
1771 Doc *doc = xhtml->doc;
1774 /*--------------------------------------------------------------------------*/
1775 /* Get Attributes */
1776 /*--------------------------------------------------------------------------*/
1777 for (attr = qs_get_attr(doc,node);
1779 attr = qs_get_next_attr(doc,attr)) {
1780 char *name = qs_get_attr_name(doc,attr);
1781 char *value = qs_get_attr_value(doc,attr);
1782 if (STRCASEEQ('t','T',"type",name)) {
1783 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1796 * It is a handler who processes the UL tag.
1798 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1799 * destination is specified.
1800 * @param node [i] The UL tag node is specified.
1801 * @return The conversion result is returned.
1804 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1806 xhtml_t *xhtml = GET_XHTML(pdoc);
1807 Doc *doc = xhtml->doc;
1815 * It is a handler who processes the H1 tag.
1817 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1818 * destination is specified.
1819 * @param node [i] The H1 tag node is specified.
1820 * @return The conversion result is returned.
1823 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1825 xhtml_t *xhtml = GET_XHTML(pdoc);
1826 Doc *doc = xhtml->doc;
1830 for (attr = qs_get_attr(doc,node);
1832 attr = qs_get_next_attr(doc,attr)) {
1835 name = qs_get_attr_name(doc,attr);
1836 value = qs_get_attr_value(doc,attr);
1837 if (STRCASEEQ('a','A',"align", name)) {
1839 if (STRCASEEQ('l','L',"left",value)) {
1841 W_L("text-align:left");
1844 else if (STRCASEEQ('r','R',"right",value)) {
1846 W_L("text-align:right");
1849 else if (STRCASEEQ('c','C',"center",value)) {
1851 W_L("text-align:center");
1864 * It is a handler who processes the H1 tag.
1866 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1867 * destination is specified.
1868 * @param node [i] The H1 tag node is specified.
1869 * @return The conversion result is returned.
1872 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1874 xhtml_t *xhtml = GET_XHTML(pdoc);
1875 Doc *doc = xhtml->doc;
1883 * It is a handler who processes the H2 tag.
1885 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1886 * destination is specified.
1887 * @param node [i] The H2 tag node is specified.
1888 * @return The conversion result is returned.
1891 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1893 xhtml_t *xhtml = GET_XHTML(pdoc);
1894 Doc *doc = xhtml->doc;
1898 for (attr = qs_get_attr(doc,node);
1900 attr = qs_get_next_attr(doc,attr)) {
1903 name = qs_get_attr_name(doc,attr);
1904 value = qs_get_attr_value(doc,attr);
1905 if (STRCASEEQ('a','A',"align", name)) {
1907 if (STRCASEEQ('l','L',"left",value)) {
1909 W_L("text-align:left");
1912 else if (STRCASEEQ('r','R',"right",value)) {
1914 W_L("text-align:right");
1917 else if (STRCASEEQ('c','C',"center",value)) {
1919 W_L("text-align:center");
1932 * It is a handler who processes the H2 tag.
1934 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1935 * destination is specified.
1936 * @param node [i] The H2 tag node is specified.
1937 * @return The conversion result is returned.
1940 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1942 xhtml_t *xhtml = GET_XHTML(pdoc);
1943 Doc *doc = xhtml->doc;
1951 * It is a handler who processes the H3 tag.
1953 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1954 * destination is specified.
1955 * @param node [i] The H3 tag node is specified.
1956 * @return The conversion result is returned.
1959 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1961 xhtml_t *xhtml = GET_XHTML(pdoc);
1962 Doc *doc = xhtml->doc;
1966 for (attr = qs_get_attr(doc,node);
1968 attr = qs_get_next_attr(doc,attr)) {
1971 name = qs_get_attr_name(doc,attr);
1972 value = qs_get_attr_value(doc,attr);
1973 if (STRCASEEQ('a','A',"align", name)) {
1975 if (STRCASEEQ('l','L',"left",value)) {
1977 W_L("text-align:left");
1980 else if (STRCASEEQ('r','R',"right",value)) {
1982 W_L("text-align:right");
1985 else if (STRCASEEQ('c','C',"center",value)) {
1987 W_L("text-align:center");
2000 * It is a handler who processes the H3 tag.
2002 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2003 * destination is specified.
2004 * @param node [i] The H3 tag node is specified.
2005 * @return The conversion result is returned.
2008 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
2010 xhtml_t *xhtml = GET_XHTML(pdoc);
2011 Doc *doc = xhtml->doc;
2019 * It is a handler who processes the H4 tag.
2021 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2022 * destination is specified.
2023 * @param node [i] The H4 tag node is specified.
2024 * @return The conversion result is returned.
2027 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
2029 xhtml_t *xhtml = GET_XHTML(pdoc);
2030 Doc *doc = xhtml->doc;
2034 for (attr = qs_get_attr(doc,node);
2036 attr = qs_get_next_attr(doc,attr)) {
2039 name = qs_get_attr_name(doc,attr);
2040 value = qs_get_attr_value(doc,attr);
2041 if (STRCASEEQ('a','A',"align", name)) {
2043 if (STRCASEEQ('l','L',"left",value)) {
2045 W_L("text-align:left");
2048 else if (STRCASEEQ('r','R',"right",value)) {
2050 W_L("text-align:right");
2053 else if (STRCASEEQ('c','C',"center",value)) {
2055 W_L("text-align:center");
2068 * It is a handler who processes the H4 tag.
2070 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2071 * destination is specified.
2072 * @param node [i] The H4 tag node is specified.
2073 * @return The conversion result is returned.
2076 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2078 xhtml_t *xhtml = GET_XHTML(pdoc);
2079 Doc *doc = xhtml->doc;
2087 * It is a handler who processes the H5 tag.
2089 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2090 * destination is specified.
2091 * @param node [i] The H5 tag node is specified.
2092 * @return The conversion result is returned.
2095 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2097 xhtml_t *xhtml = GET_XHTML(pdoc);
2098 Doc *doc = xhtml->doc;
2102 for (attr = qs_get_attr(doc,node);
2104 attr = qs_get_next_attr(doc,attr)) {
2107 name = qs_get_attr_name(doc,attr);
2108 value = qs_get_attr_value(doc,attr);
2109 if (STRCASEEQ('a','A',"align", name)) {
2111 if (STRCASEEQ('l','L',"left",value)) {
2113 W_L("text-align:left");
2116 else if (STRCASEEQ('r','R',"right",value)) {
2118 W_L("text-align:right");
2121 else if (STRCASEEQ('c','C',"center",value)) {
2123 W_L("text-align:center");
2136 * It is a handler who processes the H5 tag.
2138 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2139 * destination is specified.
2140 * @param node [i] The H5 tag node is specified.
2141 * @return The conversion result is returned.
2144 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2146 xhtml_t *xhtml = GET_XHTML(pdoc);
2147 Doc *doc = xhtml->doc;
2155 * It is a handler who processes the H6 tag.
2157 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2158 * destination is specified.
2159 * @param node [i] The H6 tag node is specified.
2160 * @return The conversion result is returned.
2163 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2165 xhtml_t *xhtml = GET_XHTML(pdoc);
2166 Doc *doc = xhtml->doc;
2170 for (attr = qs_get_attr(doc,node);
2172 attr = qs_get_next_attr(doc,attr)) {
2175 name = qs_get_attr_name(doc,attr);
2176 value = qs_get_attr_value(doc,attr);
2177 if (STRCASEEQ('a','A',"align", name)) {
2179 if (STRCASEEQ('l','L',"left",value)) {
2181 W_L("text-align:left");
2184 else if (STRCASEEQ('r','R',"right",value)) {
2186 W_L("text-align:right");
2189 else if (STRCASEEQ('c','C',"center",value)) {
2191 W_L("text-align:center");
2204 * It is a handler who processes the H6 tag.
2206 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2207 * destination is specified.
2208 * @param node [i] The H6 tag node is specified.
2209 * @return The conversion result is returned.
2212 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2214 xhtml_t *xhtml = GET_XHTML(pdoc);
2215 Doc *doc = xhtml->doc;
2223 * It is a handler who processes the OL tag.
2225 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2226 * destination is specified.
2227 * @param node [i] The OL tag node is specified.
2228 * @return The conversion result is returned.
2231 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2233 xhtml_t *xhtml = GET_XHTML(pdoc);
2234 Doc *doc = xhtml->doc;
2238 /*--------------------------------------------------------------------------*/
2239 /* Get Attributes */
2240 /*--------------------------------------------------------------------------*/
2241 for (attr = qs_get_attr(doc,node);
2243 attr = qs_get_next_attr(doc,attr)) {
2244 char *name = qs_get_attr_name(doc,attr);
2245 char *value = qs_get_attr_value(doc,attr);
2246 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2251 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2263 * It is a handler who processes the OL tag.
2265 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2266 * destination is specified.
2267 * @param node [i] The OL tag node is specified.
2268 * @return The conversion result is returned.
2271 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2273 xhtml_t *xhtml = GET_XHTML(pdoc);
2274 Doc *doc = xhtml->doc;
2282 * It is a handler who processes the LI tag.
2284 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2285 * destination is specified.
2286 * @param node [i] The LI tag node is specified.
2287 * @return The conversion result is returned.
2290 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2292 xhtml_t *xhtml = GET_XHTML(pdoc);
2293 Doc *doc = xhtml->doc;
2297 /*--------------------------------------------------------------------------*/
2298 /* Get Attributes */
2299 /*--------------------------------------------------------------------------*/
2300 for (attr = qs_get_attr(doc,node);
2302 attr = qs_get_next_attr(doc,attr)) {
2303 char *name = qs_get_attr_name(doc,attr);
2304 char *value = qs_get_attr_value(doc,attr);
2305 if (STRCASEEQ('t','T',"type",name)) {
2306 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2312 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2324 ** It is a handler who processes the LI tag.
2326 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2327 * destination is specified.
2328 * @param node [i] The LI tag node is specified.
2329 * @return The conversion result is returned.
2332 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2334 xhtml_t *xhtml = GET_XHTML(pdoc);
2335 Doc *doc = xhtml->doc;
2342 * It is a handler who processes the IMG tag.
2344 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2345 * destination is specified.
2346 * @param node [i] The IMG tag node is specified.
2347 * @return The conversion result is returned.
2350 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2352 xhtml_t *xhtml = GET_XHTML(pdoc);
2353 Doc *doc = xhtml->doc;
2354 request_rec *r = doc->r;
2357 #ifndef IMG_NOT_CONVERT_FILENAME
2358 device_table *spec = xhtml->spec;
2362 /*--------------------------------------------------------------------------*/
2363 /* Get Attributes */
2364 /*--------------------------------------------------------------------------*/
2365 for (attr = qs_get_attr(doc,node);
2367 attr = qs_get_next_attr(doc,attr)) {
2368 char *name = qs_get_attr_name(doc,attr);
2369 char *value = qs_get_attr_value(doc,attr);
2371 if (STRCASEEQ('s','S',"src",name)) {
2372 value = chxj_encoding_parameter(r, value);
2373 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2375 value = apr_psprintf(r->pool,
2378 (strchr(value, '?')) ? '&' : '?',
2379 CHXJ_COOKIE_NOUPDATE_PARAM);
2381 #ifdef IMG_NOT_CONVERT_FILENAME
2391 char *vv = chxj_img_conv(r,spec,value);
2399 if (STRCASEEQ('a','A',"align",name)) {
2401 if (STRCASEEQ('t','T',"top", value) ||
2402 STRCASEEQ('m','M',"middle",value) ||
2403 STRCASEEQ('b','B',"bottom",value) ||
2404 STRCASEEQ('l','L',"left", value) ||
2405 STRCASEEQ('r','R',"right", value)) {
2410 else if (STRCASEEQ('c','C',"center", value)) {
2417 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2422 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2427 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2432 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2437 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2449 * It is a handler who processes the IMG tag.
2451 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2452 * destination is specified.
2453 * @param node [i] The IMG tag node is specified.
2454 * @return The conversion result is returned.
2457 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2459 xhtml_t *xhtml = GET_XHTML(pdoc);
2466 * It is a handler who processes the SELECT tag.
2468 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2469 * destination is specified.
2470 * @param node [i] The SELECT tag node is specified.
2471 * @return The conversion result is returned.
2474 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2476 xhtml_t *xhtml = GET_XHTML(pdoc);
2477 Doc *doc = xhtml->doc;
2480 char *multiple = NULL;
2485 for (attr = qs_get_attr(doc,child);
2487 attr = qs_get_next_attr(doc,attr)) {
2488 char *nm = qs_get_attr_name(doc,attr);
2489 char *val = qs_get_attr_value(doc,attr);
2490 if (STRCASEEQ('s','S',"size",nm)) {
2491 /*----------------------------------------------------------------------*/
2492 /* CHTML 1.0 version 2.0 */
2493 /*----------------------------------------------------------------------*/
2494 size = apr_pstrdup(doc->buf.pool, val);
2496 else if (STRCASEEQ('n','N',"name",nm)) {
2497 /*----------------------------------------------------------------------*/
2498 /* CHTML 1.0 version 2.0 */
2499 /*----------------------------------------------------------------------*/
2500 name = apr_pstrdup(doc->buf.pool, val);
2502 else if (STRCASEEQ('m','M',"multiple",nm)) {
2503 /*----------------------------------------------------------------------*/
2504 /* CHTML 1.0 version 2.0 */
2505 /*----------------------------------------------------------------------*/
2506 multiple = apr_pstrdup(doc->buf.pool, val);
2509 if (size && *size) {
2514 if (name && *name) {
2520 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2521 W_L(" multiple=\"true\"");
2529 * It is a handler who processes the SELECT tag.
2531 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2532 * destination is specified.
2533 * @param node [i] The SELECT tag node is specified.
2534 * @return The conversion result is returned.
2537 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2539 xhtml_t *xhtml = GET_XHTML(pdoc);
2540 Doc *doc = xhtml->doc;
2548 * It is a handler who processes the OPTION tag.
2550 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2551 * destination is specified.
2552 * @param node [i] The OPTION tag node is specified.
2553 * @return The conversion result is returned.
2556 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2558 xhtml_t *xhtml = GET_XHTML(pdoc);
2559 Doc *doc = xhtml->doc;
2562 char *selected = NULL;
2566 for (attr = qs_get_attr(doc,child);
2568 attr = qs_get_next_attr(doc,attr)) {
2569 char *nm = qs_get_attr_name(doc,attr);
2570 char *val = qs_get_attr_value(doc,attr);
2571 if (STRCASEEQ('s','S',"selected",nm)) {
2572 /* CHTML version 2.0 */
2573 selected = apr_pstrdup(doc->buf.pool, val);
2575 else if (STRCASEEQ('v','V',"value",nm)) {
2576 /* CHTML version 2.0 */
2577 value = apr_pstrdup(doc->buf.pool, val);
2580 if (value && *value) {
2586 W_L(" selected=\"selected\"");
2594 * It is a handler who processes the OPTION tag.
2596 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2597 * destination is specified.
2598 * @param node [i] The OPTION tag node is specified.
2599 * @return The conversion result is returned.
2602 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2604 xhtml_t *xhtml = GET_XHTML(pdoc);
2605 Doc *doc = xhtml->doc;
2613 * It is a handler who processes the DIV tag.
2615 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2616 * destination is specified.
2617 * @param node [i] The DIV tag node is specified.
2618 * @return The conversion result is returned.
2621 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2623 xhtml_t *xhtml = GET_XHTML(pdoc);
2624 Doc *doc = xhtml->doc;
2629 for (attr = qs_get_attr(doc,child);
2631 attr = qs_get_next_attr(doc,attr)) {
2632 char *nm = qs_get_attr_name(doc,attr);
2633 char *val = qs_get_attr_value(doc,attr);
2634 if (STRCASEEQ('a','A',"align",nm)) {
2635 /*=====================================================================*/
2636 /* CHTML version 3.2 */
2637 /*=====================================================================*/
2638 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2639 align = apr_pstrdup(doc->buf.pool, val);
2654 * It is a handler who processes the DIV tag.
2656 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2657 * destination is specified.
2658 * @param node [i] The DIV tag node is specified.
2659 * @return The conversion result is returned.
2662 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2664 xhtml_t *xhtml = GET_XHTML(pdoc);
2665 Doc *doc = xhtml->doc;
2672 * It is a handler who processes the B tag.
2674 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2675 * destination is specified.
2676 * @param node [i] The B tag node is specified.
2677 * @return The conversion result is returned.
2680 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2682 xhtml_t *xhtml = GET_XHTML(pdoc);
2683 Doc *doc = xhtml->doc;
2685 W_L("<div style=\"font-weight:bold\">");
2691 * It is a handler who processes the B tag.
2693 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2694 * destination is specified.
2695 * @param node [i] The B tag node is specified.
2696 * @return The conversion result is returned.
2699 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2701 xhtml_t *xhtml = GET_XHTML(pdoc);
2702 Doc *doc = xhtml->doc;
2710 * It is a handler who processes the CHXJ:IF tag.
2712 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2713 * destination is specified.
2714 * @param node [i] The CHXJ:IF tag node is specified.
2717 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2719 xhtml_t *xhtml = GET_XHTML(pdoc);
2720 Doc *doc = xhtml->doc;
2723 for (child = qs_get_child_node(doc, node);
2725 child = qs_get_next_node(doc, child)) {
2727 s_xhtml_1_0_chxjif_tag(xhtml, child);
2735 * It is a handler who processes the TEXTARE tag.
2737 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2738 * destination is specified.
2739 * @param node [i] The TEXTAREA tag node is specified.
2740 * @return The conversion result is returned.
2743 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2745 xhtml_t *xhtml = GET_XHTML(pdoc);
2746 Doc *doc = xhtml->doc;
2749 xhtml->textarea_flag++;
2751 for (attr = qs_get_attr(doc,node);
2753 attr = qs_get_next_attr(doc,attr)) {
2754 char *name = qs_get_attr_name(doc,attr);
2755 char *value = qs_get_attr_value(doc,attr);
2756 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2761 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2766 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2771 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2772 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2777 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2778 W_L(" accesskey=\"");
2789 * It is a handler who processes the TEXTAREA tag.
2791 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2792 * destination is specified.
2793 * @param node [i] The TEXTAREA tag node is specified.
2794 * @return The conversion result is returned.
2797 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2799 xhtml_t *xhtml = GET_XHTML(pdoc);
2800 Doc *doc = xhtml->doc;
2803 xhtml->textarea_flag--;
2809 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2811 xhtml_t *xhtml = GET_XHTML(pdoc);
2812 Doc *doc = xhtml->doc;
2813 request_rec *r = doc->r;
2821 textval = qs_get_node_value(doc,child);
2822 if (strlen(textval) == 0) {
2826 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2827 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2829 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2830 memset(one_byte, 0, sizeof(one_byte));
2833 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2835 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2837 DBG(r,"[%s][%d]", out, rtn);
2838 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2842 if (is_sjis_kanji(textval[ii])) {
2843 one_byte[0] = textval[ii+0];
2844 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2845 one_byte[0] = textval[ii+1];
2846 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2849 else if (xhtml->pre_flag) {
2850 one_byte[0] = textval[ii+0];
2851 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2853 else if (xhtml->textarea_flag) {
2854 one_byte[0] = textval[ii+0];
2855 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2857 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2858 one_byte[0] = textval[ii+0];
2859 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2868 * It is a handler who processes the BLOCKQUOTE tag.
2870 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2871 * destination is specified.
2872 * @param node [i] The BLOCKQUOTE tag node is specified.
2873 * @return The conversion result is returned.
2876 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2878 xhtml_t *xhtml = GET_XHTML(pdoc);
2879 Doc *doc = xhtml->doc;
2880 W_L("<blockquote>");
2886 * It is a handler who processes the BLOCKQUOTE tag.
2888 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2889 * destination is specified.
2890 * @param node [i] The BLOCKQUOTE tag node is specified.
2891 * @return The conversion result is returned.
2894 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2896 xhtml_t *xhtml = GET_XHTML(pdoc);
2897 Doc *doc = xhtml->doc;
2898 W_L("</blockquote>");
2904 * It is a handler who processes the DIR tag.
2906 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2907 * destination is specified.
2908 * @param node [i] The DIR tag node is specified.
2909 * @return The conversion result is returned.
2912 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2914 xhtml_t *xhtml = GET_XHTML(pdoc);
2915 Doc *doc = xhtml->doc;
2918 for (attr = qs_get_attr(doc,node);
2920 attr = qs_get_next_attr(doc,attr)) {
2921 char *name = qs_get_attr_name(doc,attr);
2922 char *value = qs_get_attr_value(doc,attr);
2923 if (STRCASEEQ('t','T',"type",name)) {
2924 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2937 * It is a handler who processes the DIR tag.
2939 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2940 * destination is specified.
2941 * @param node [i] The DIR tag node is specified.
2942 * @return The conversion result is returned.
2945 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2947 xhtml_t *xhtml = GET_XHTML(pdoc);
2948 Doc *doc = xhtml->doc;
2955 * It is a handler who processes the DL tag.
2957 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2958 * destination is specified.
2959 * @param node [i] The DL tag node is specified.
2960 * @return The conversion result is returned.
2963 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2965 xhtml_t *xhtml = GET_XHTML(pdoc);
2966 Doc *doc = xhtml->doc;
2973 * It is a handler who processes the DL tag.
2975 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2976 * destination is specified.
2977 * @param node [i] The DL tag node is specified.
2978 * @return The conversion result is returned.
2981 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2983 xhtml_t *xhtml = GET_XHTML(pdoc);
2984 Doc *doc = xhtml->doc;
2991 * It is a handter who processes the DT tag.
2993 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2994 * destination is specified.
2995 * @param node [i] The DT tag node is specified.
2996 * @return The conversion result is returned.
2999 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
3001 xhtml_t *xhtml = GET_XHTML(pdoc);
3002 Doc *doc = xhtml->doc;
3009 * It is a handter who processes the DT tag.
3011 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3012 * destination is specified.
3013 * @param node [i] The DT tag node is specified.
3014 * @return The conversion result is returned.
3017 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
3019 xhtml_t *xhtml = GET_XHTML(pdoc);
3020 Doc *doc = xhtml->doc;
3027 * It is a handder who processes the DD tag.
3029 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3030 * destination is specified.
3031 * @param node [i] The DD tag node is specified.
3032 * @return The conversion result is returned.
3035 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
3037 xhtml_t *xhtml = GET_XHTML(pdoc);
3038 Doc *doc = xhtml->doc;
3045 * It is a handder who processes the DD tag.
3047 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3048 * destination is specified.
3049 * @param node [i] The DD tag node is specified.
3050 * @return The conversion result is returned.
3053 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
3055 xhtml_t *xhtml = GET_XHTML(pdoc);
3056 Doc *doc = xhtml->doc;
3063 * It is a handler who processes the MENU tag.
3065 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3066 * destination is specified.
3067 * @param node [i] The MENU tag node is specified.
3068 * @return The conversion result is returned.
3071 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
3073 xhtml_t *xhtml = GET_XHTML(pdoc);
3074 Doc *doc = xhtml->doc;
3077 /*--------------------------------------------------------------------------*/
3078 /* Get Attributes */
3079 /*--------------------------------------------------------------------------*/
3080 for (attr = qs_get_attr(doc,node);
3082 attr = qs_get_next_attr(doc,attr)) {
3083 char *name = qs_get_attr_name(doc,attr);
3084 char *value = qs_get_attr_value(doc,attr);
3085 if (STRCASEEQ('t','T',"type",name)) {
3086 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3099 * It is a hanmenuer who processes the MENU tag.
3101 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3102 * destination is specified.
3103 * @param node [i] The MENU tag node is specified.
3104 * @return The conversion result is returned.
3107 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3109 xhtml_t *xhtml = GET_XHTML(pdoc);
3110 Doc *doc = xhtml->doc;
3117 * It is a handler who processes the PLAINTEXT tag.
3119 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3120 * destination is specified.
3121 * @param node [i] The PLAINTEXT tag node is specified.
3122 * @return The conversion result is returned.
3125 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3127 xhtml_t *xhtml = GET_XHTML(pdoc);
3128 Doc *doc = xhtml->doc;
3130 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3135 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3137 xhtml_t *xhtml = GET_XHTML(pdoc);
3138 Doc *doc = xhtml->doc;
3140 for (child = qs_get_child_node(doc, node);
3142 child = qs_get_next_node(doc, child)) {
3144 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3151 * It is a handler who processes the PLAINTEXT tag.
3153 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3154 * destination is specified.
3155 * @param node [i] The PLAINTEXT tag node is specified.
3156 * @return The conversion result is returned.
3159 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3161 xhtml_t *xhtml = GET_XHTML(pdoc);
3162 Doc *doc = xhtml->doc;
3163 W_L("</plaintext>");
3169 * It is a hanblinker who processes the BLINK tag.
3171 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The BLINK tag node is specified.
3174 * @return The conversion result is returned.
3177 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3179 xhtml_t *xhtml = GET_XHTML(pdoc);
3180 Doc *doc = xhtml->doc;
3187 * It is a hanblinker who processes the BLINK tag.
3189 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3190 * destination is specified.
3191 * @param node [i] The BLINK tag node is specified.
3192 * @return The conversion result is returned.
3195 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3197 xhtml_t *xhtml = GET_XHTML(pdoc);
3198 Doc *doc = xhtml->doc;
3205 * It is a handler who processes the MARQUEE tag.
3207 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3208 * destination is specified.
3209 * @param node [i] The MARQUEE tag node is specified.
3210 * @return The conversion result is returned.
3213 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3215 xhtml_t *xhtml = GET_XHTML(pdoc);
3216 Doc *doc = xhtml->doc;
3219 /*--------------------------------------------------------------------------*/
3220 /* Get Attributes */
3221 /*--------------------------------------------------------------------------*/
3222 for (attr = qs_get_attr(doc,node);
3224 attr = qs_get_next_attr(doc,attr)) {
3225 char *name = qs_get_attr_name(doc,attr);
3226 char *value = qs_get_attr_value(doc,attr);
3227 if (STRCASEEQ('d','D',"direction", name)) {
3228 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3229 W_L(" direction=\"");
3234 else if (STRCASEEQ('b','B',"behavior",name)) {
3235 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3236 W_L(" behavior=\"");
3241 else if (STRCASEEQ('l','L',"loop",name)) {
3242 if (value && *value) {
3248 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3249 if (value && *value) {
3262 * It is a handler who processes the MARQUEE tag.
3264 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3265 * destination is specified.
3266 * @param node [i] The MARQUEE tag node is specified.
3267 * @return The conversion result is returned.
3270 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3272 xhtml_t *xhtml = GET_XHTML(pdoc);
3273 Doc *doc = xhtml->doc;
3280 * It is handler who processes the New Line Code.
3283 s_xhtml_1_0_newline_mark(void *pdoc, Node *UNUSED(node))
3285 xhtml_t *xhtml = GET_XHTML(pdoc);
3286 Doc *doc = xhtml->doc;