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 static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
35 static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
36 static char *s_xhtml_1_0_start_p_tag (void *pdoc, Node *node);
37 static char *s_xhtml_1_0_end_p_tag (void *pdoc, Node *node);
38 static char *s_xhtml_1_0_start_pre_tag (void *pdoc, Node *node);
39 static char *s_xhtml_1_0_end_pre_tag (void *pdoc, Node *node);
40 static char *s_xhtml_1_0_start_ul_tag (void *pdoc, Node *node);
41 static char *s_xhtml_1_0_end_ul_tag (void *pdoc, Node *node);
42 static char *s_xhtml_1_0_start_h1_tag (void *pdoc, Node *node);
43 static char *s_xhtml_1_0_end_h1_tag (void *pdoc, Node *node);
44 static char *s_xhtml_1_0_start_h2_tag (void *pdoc, Node *node);
45 static char *s_xhtml_1_0_end_h2_tag (void *pdoc, Node *node);
46 static char *s_xhtml_1_0_start_h3_tag (void *pdoc, Node *node);
47 static char *s_xhtml_1_0_end_h3_tag (void *pdoc, Node *node);
48 static char *s_xhtml_1_0_start_h4_tag (void *pdoc, Node *node);
49 static char *s_xhtml_1_0_end_h4_tag (void *pdoc, Node *node);
50 static char *s_xhtml_1_0_start_h5_tag (void *pdoc, Node *node);
51 static char *s_xhtml_1_0_end_h5_tag (void *pdoc, Node *node);
52 static char *s_xhtml_1_0_start_h6_tag (void *pdoc, Node *node);
53 static char *s_xhtml_1_0_end_h6_tag (void *pdoc, Node *node);
54 static char *s_xhtml_1_0_start_ol_tag (void *pdoc, Node *node);
55 static char *s_xhtml_1_0_end_ol_tag (void *pdoc, Node *node);
56 static char *s_xhtml_1_0_start_li_tag (void *pdoc, Node *node);
57 static char *s_xhtml_1_0_end_li_tag (void *pdoc, Node *node);
58 static char *s_xhtml_1_0_start_meta_tag (void *pdoc, Node *node);
59 static char *s_xhtml_1_0_end_meta_tag (void *pdoc, Node *node);
60 static char *s_xhtml_1_0_start_head_tag (void *pdoc, Node *node);
61 static char *s_xhtml_1_0_end_head_tag (void *pdoc, Node *node);
62 static char *s_xhtml_1_0_start_title_tag (void *pdoc, Node *node);
63 static char *s_xhtml_1_0_end_title_tag (void *pdoc, Node *node);
64 static char *s_xhtml_1_0_start_base_tag (void *pdoc, Node *node);
65 static char *s_xhtml_1_0_end_base_tag (void *pdoc, Node *node);
66 static char *s_xhtml_1_0_start_body_tag (void *pdoc, Node *node);
67 static char *s_xhtml_1_0_end_body_tag (void *pdoc, Node *node);
68 static char *s_xhtml_1_0_start_a_tag (void *pdoc, Node *node);
69 static char *s_xhtml_1_0_end_a_tag (void *pdoc, Node *node);
70 static char *s_xhtml_1_0_start_br_tag (void *pdoc, Node *node);
71 static char *s_xhtml_1_0_end_br_tag (void *pdoc, Node *node);
72 static char *s_xhtml_1_0_start_tr_tag (void *pdoc, Node *node);
73 static char *s_xhtml_1_0_end_tr_tag (void *pdoc, Node *node);
74 static char *s_xhtml_1_0_start_font_tag (void *pdoc, Node *node);
75 static char *s_xhtml_1_0_end_font_tag (void *pdoc, Node *node);
76 static char *s_xhtml_1_0_start_form_tag (void *pdoc, Node *node);
77 static char *s_xhtml_1_0_end_form_tag (void *pdoc, Node *node);
78 static char *s_xhtml_1_0_start_input_tag (void *pdoc, Node *node);
79 static char *s_xhtml_1_0_end_input_tag (void *pdoc, Node *node);
80 static char *s_xhtml_1_0_start_center_tag (void *pdoc, Node *node);
81 static char *s_xhtml_1_0_end_center_tag (void *pdoc, Node *node);
82 static char *s_xhtml_1_0_start_hr_tag (void *pdoc, Node *node);
83 static char *s_xhtml_1_0_end_hr_tag (void *pdoc, Node *node);
84 static char *s_xhtml_1_0_start_img_tag (void *pdoc, Node *node);
85 static char *s_xhtml_1_0_end_img_tag (void *pdoc, Node *node);
86 static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
87 static char *s_xhtml_1_0_end_select_tag (void *pdoc, Node *node);
88 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
89 static char *s_xhtml_1_0_end_option_tag (void *pdoc, Node *node);
90 static char *s_xhtml_1_0_start_div_tag (void *pdoc, Node *node);
91 static char *s_xhtml_1_0_end_div_tag (void *pdoc, Node *node);
92 static char *s_xhtml_1_0_start_textarea_tag (void *pdoc, Node *node);
93 static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
94 static char *s_xhtml_1_0_start_b_tag (void *pdoc, Node *node);
95 static char *s_xhtml_1_0_end_b_tag (void *pdoc, Node *node);
96 static char *s_xhtml_1_0_chxjif_tag (void *pdoc, Node *node);
97 static char *s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *node);
98 static char *s_xhtml_1_0_end_blockquote_tag (void *pdoc, Node *node);
99 static char *s_xhtml_1_0_start_dir_tag (void *pdoc, Node *node);
100 static char *s_xhtml_1_0_end_dir_tag (void *pdoc, Node *node);
101 static char *s_xhtml_1_0_start_dl_tag (void *pdoc, Node *node);
102 static char *s_xhtml_1_0_end_dl_tag (void *pdoc, Node *node);
103 static char *s_xhtml_1_0_start_dt_tag (void *pdoc, Node *node);
104 static char *s_xhtml_1_0_end_dt_tag (void *pdoc, Node *node);
105 static char *s_xhtml_1_0_start_dd_tag (void *pdoc, Node *node);
106 static char *s_xhtml_1_0_end_dd_tag (void *pdoc, Node *node);
107 static char *s_xhtml_1_0_start_menu_tag (void *pdoc, Node *node);
108 static char *s_xhtml_1_0_end_menu_tag (void *pdoc, Node *node);
109 static char *s_xhtml_1_0_start_plaintext_tag (void *pdoc, Node *node);
110 static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
111 static char *s_xhtml_1_0_end_plaintext_tag (void *pdoc, Node *node);
112 static char *s_xhtml_1_0_start_blink_tag (void *pdoc, Node *node);
113 static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
114 static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
115 static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
117 static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
118 static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
119 static char *s_xhtml_1_0_text_tag(void *pdoc, Node *child);
122 tag_handler xhtml_handler[] = {
125 s_xhtml_1_0_start_html_tag,
126 s_xhtml_1_0_end_html_tag,
130 s_xhtml_1_0_start_meta_tag,
131 s_xhtml_1_0_end_meta_tag,
135 s_xhtml_1_0_start_textarea_tag,
136 s_xhtml_1_0_end_textarea_tag,
140 s_xhtml_1_0_start_p_tag,
141 s_xhtml_1_0_end_p_tag,
145 s_xhtml_1_0_start_pre_tag,
146 s_xhtml_1_0_end_pre_tag,
150 s_xhtml_1_0_start_ul_tag,
151 s_xhtml_1_0_end_ul_tag,
155 s_xhtml_1_0_start_li_tag,
156 s_xhtml_1_0_end_li_tag,
160 s_xhtml_1_0_start_ol_tag,
161 s_xhtml_1_0_end_ol_tag,
165 s_xhtml_1_0_start_h1_tag,
166 s_xhtml_1_0_end_h1_tag,
170 s_xhtml_1_0_start_h2_tag,
171 s_xhtml_1_0_end_h2_tag,
175 s_xhtml_1_0_start_h3_tag,
176 s_xhtml_1_0_end_h3_tag,
180 s_xhtml_1_0_start_h4_tag,
181 s_xhtml_1_0_end_h4_tag,
185 s_xhtml_1_0_start_h5_tag,
186 s_xhtml_1_0_end_h5_tag,
190 s_xhtml_1_0_start_h6_tag,
191 s_xhtml_1_0_end_h6_tag,
195 s_xhtml_1_0_start_head_tag,
196 s_xhtml_1_0_end_head_tag,
200 s_xhtml_1_0_start_title_tag,
201 s_xhtml_1_0_end_title_tag,
205 s_xhtml_1_0_start_base_tag,
206 s_xhtml_1_0_end_base_tag,
210 s_xhtml_1_0_start_body_tag,
211 s_xhtml_1_0_end_body_tag,
215 s_xhtml_1_0_start_a_tag,
216 s_xhtml_1_0_end_a_tag,
220 s_xhtml_1_0_start_br_tag,
221 s_xhtml_1_0_end_br_tag,
230 s_xhtml_1_0_start_tr_tag,
231 s_xhtml_1_0_end_tr_tag,
245 s_xhtml_1_0_start_font_tag,
246 s_xhtml_1_0_end_font_tag,
250 s_xhtml_1_0_start_form_tag,
251 s_xhtml_1_0_end_form_tag,
255 s_xhtml_1_0_start_input_tag,
256 s_xhtml_1_0_end_input_tag,
260 s_xhtml_1_0_start_center_tag,
261 s_xhtml_1_0_end_center_tag,
265 s_xhtml_1_0_start_hr_tag,
266 s_xhtml_1_0_end_hr_tag,
270 s_xhtml_1_0_start_img_tag,
271 s_xhtml_1_0_end_img_tag,
275 s_xhtml_1_0_start_select_tag,
276 s_xhtml_1_0_end_select_tag,
280 s_xhtml_1_0_start_option_tag,
281 s_xhtml_1_0_end_option_tag,
285 s_xhtml_1_0_start_div_tag,
286 s_xhtml_1_0_end_div_tag,
290 s_xhtml_1_0_chxjif_tag,
315 s_xhtml_1_0_text_tag,
325 s_xhtml_1_0_start_b_tag,
326 s_xhtml_1_0_end_b_tag,
335 s_xhtml_1_0_start_dt_tag,
336 s_xhtml_1_0_end_dt_tag,
350 s_xhtml_1_0_start_blockquote_tag,
351 s_xhtml_1_0_end_blockquote_tag,
355 s_xhtml_1_0_start_dir_tag,
356 s_xhtml_1_0_end_dir_tag,
360 s_xhtml_1_0_start_dl_tag,
361 s_xhtml_1_0_end_dl_tag,
365 s_xhtml_1_0_start_dd_tag,
366 s_xhtml_1_0_end_dd_tag,
370 s_xhtml_1_0_start_menu_tag,
371 s_xhtml_1_0_end_menu_tag,
375 s_xhtml_1_0_start_plaintext_tag,
376 s_xhtml_1_0_end_plaintext_tag,
380 s_xhtml_1_0_start_blink_tag,
381 s_xhtml_1_0_end_blink_tag,
385 s_xhtml_1_0_start_marquee_tag,
386 s_xhtml_1_0_end_marquee_tag,
391 * converts from CHTML to XHTML.
393 * @param r [i] Requet_rec is appointed.
394 * @param spec [i] The result of the device specification processing which
395 * was done in advance is appointed.
396 * @param src [i] The character string before the converting is appointed.
397 * @return The character string after the converting is returned.
400 chxj_convert_xhtml_mobile_1_0(
406 chxjconvrule_entry *entryp,
407 cookie_t *UNUSED(cookie)
415 DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
416 /*--------------------------------------------------------------------------*/
418 /*--------------------------------------------------------------------------*/
420 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
422 DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
426 /*--------------------------------------------------------------------------*/
427 /* The XHTML structure is initialized. */
428 /*--------------------------------------------------------------------------*/
429 s_init_xhtml(&xhtml, &doc, r, spec);
431 xhtml.entryp = entryp;
433 chxj_set_content_type(r, "text/html; charset=Windows-31J");
435 /*--------------------------------------------------------------------------*/
436 /* The character string of the input is analyzed. */
437 /*--------------------------------------------------------------------------*/
438 qs_init_malloc(&doc);
439 qs_init_root_node(&doc);
441 ss = apr_pcalloc(r->pool, srclen + 1);
442 memset(ss, 0, srclen + 1);
443 memcpy(ss, src, srclen);
446 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
448 qs_parse_string(&doc,ss, strlen(ss));
450 chxj_buffered_write_init(r->pool, &doc.buf);
451 /*--------------------------------------------------------------------------*/
452 /* It converts it from CHTML to XHTML. */
453 /*--------------------------------------------------------------------------*/
454 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
455 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
456 dst = apr_pstrdup(r->pool, xhtml.out);
457 chxj_buffered_write_terminate(&doc.buf);
459 qs_all_free(&doc,QX_LOGMARK);
462 return apr_pstrdup(r->pool,ss);
466 dst = apr_psprintf(r->pool, "\n");
468 *dstlen = strlen(dst);
471 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
474 DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
480 * The XHTML structure is initialized.
482 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
483 * initialized is specified.
484 * @param doc [i] The Doc structure that should be set to the initialized
485 * HDML structure is specified.
486 * @param r [i] To use POOL, the pointer to request_rec is specified.
487 * @param spec [i] The pointer to the device_table
490 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
492 memset(doc, 0, sizeof(Doc));
493 memset(xhtml, 0, sizeof(xhtml_t));
498 xhtml->out = qs_alloc_zero_byte_string(r);
499 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
500 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
505 * Corresponding EMOJI to a current character-code is retrieved.
506 * The substitution character string is stored in the rslt pointer if agreeing.
508 * @param xhtml [i] The pointer to the XHTML structure is specified.
509 * @param txt [i] The character string to want to examine whether it is
510 * EMOJI is specified.
511 * @param rslt [o] The pointer to the pointer that stores the result is
513 * @return When corresponding EMOJI exists, it returns it excluding 0.
516 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
529 DBG(r,"spec is NULL");
532 for (ee = xhtml->conf->emoji;
535 unsigned char hex1byte;
536 unsigned char hex2byte;
538 DBG(r,"emoji->imode is NULL");
542 if (ee->imode->string != NULL
543 && strlen(ee->imode->string) > 0
544 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
545 if (spec == NULL || spec->emoji_type == NULL) {
546 *rslt = apr_psprintf(r->pool,
549 return strlen(ee->imode->string);
552 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
553 *rslt = apr_psprintf(r->pool,
556 return strlen(ee->imode->string);
559 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
560 *rslt = apr_psprintf(r->pool,
563 return strlen(ee->imode->string);
566 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
567 *rslt = apr_psprintf(r->pool,
570 return strlen(ee->imode->string);
573 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
574 *rslt = apr_psprintf(r->pool,
577 return strlen(ee->imode->string);
580 *rslt = apr_psprintf(r->pool,
583 return strlen(ee->imode->string);
587 hex1byte = ee->imode->hex1byte & 0xff;
588 hex2byte = ee->imode->hex2byte & 0xff;
590 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
591 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
592 if (spec == NULL || spec->emoji_type == NULL) {
593 *rslt = apr_psprintf(r->pool,
594 "<img localsrc=\"%s\">",
599 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
600 *rslt = apr_psprintf(r->pool,
601 "<img localsrc=\"%s\">",
606 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
607 *rslt = apr_psprintf(r->pool,
608 "<img localsrc=\"%s\">",
613 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
614 *rslt = apr_psprintf(r->pool,
615 "<img localsrc=\"%s\">",
620 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
621 *rslt = apr_psprintf(r->pool,
622 "<img localsrc=\"%s\">",
627 *rslt = apr_psprintf(r->pool,
628 "<img localsrc=\"%s\">",
640 * It is a handler who processes the HTML tag.
642 * @param pdoc [i/o] The pointer to the XHTML structure at the output
643 * destination is specified.
644 * @param node [i] The HTML tag node is specified.
645 * @return The conversion result is returned.
648 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
650 xhtml_t *xhtml = GET_XHTML(pdoc);
652 Doc *doc = xhtml->doc;
654 /*--------------------------------------------------------------------------*/
655 /* Add XML Declare */
656 /*--------------------------------------------------------------------------*/
657 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n");
658 /*--------------------------------------------------------------------------*/
660 /*--------------------------------------------------------------------------*/
661 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n");
662 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n");
663 /*--------------------------------------------------------------------------*/
665 /*--------------------------------------------------------------------------*/
666 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
667 /*--------------------------------------------------------------------------*/
669 /*--------------------------------------------------------------------------*/
670 for (attr = qs_get_attr(doc,node);
672 attr = qs_get_next_attr(doc,attr)) {
673 char* name = qs_get_attr_name(doc,attr);
674 char* value = qs_get_attr_value(doc,attr);
675 if (STRCASEEQ('l','L',"lang", name)) {
680 else if (STRCASEEQ('v','V',"version", name)) {
681 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
690 * It is a handler who processes the HTML tag.
692 * @param pdoc [i/o] The pointer to the XHTML structure at the output
693 * destination is specified.
694 * @param node [i] The HTML tag node is specified.
695 * @return The conversion result is returned.
698 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
700 xhtml_t *xhtml = GET_XHTML(pdoc);
701 Doc *doc = xhtml->doc;
708 * It is a handler who processes the META tag.
710 * @param pdoc [i/o] The pointer to the XHTML structure at the output
711 * destination is specified.
712 * @param node [i] The META tag node is specified.
713 * @return The conversion result is returned.
716 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
718 xhtml_t *xhtml = GET_XHTML(pdoc);
720 Doc *doc = xhtml->doc;
721 int content_type_flag = 0;
724 /*--------------------------------------------------------------------------*/
726 /*--------------------------------------------------------------------------*/
727 for (attr = qs_get_attr(doc,node);
729 attr = qs_get_next_attr(doc,attr)) {
730 char *name = qs_get_attr_name(doc,attr);
731 char *value = qs_get_attr_value(doc,attr);
732 if (STRCASEEQ('n','N',"name", name) && value && *value) {
739 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
745 if (STRCASEEQ('c','C', "content-type", value)) {
746 content_type_flag = 1;
749 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
750 if (content_type_flag) {
754 W_L("text/html; charset=Windows-31J");
772 * It is a handler who processes the META tag.
774 * @param pdoc [i/o] The pointer to the XHTML structure at the output
775 * destination is specified.
776 * @param node [i] The META tag node is specified.
777 * @return The conversion result is returned.
780 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
782 xhtml_t *xhtml = GET_XHTML(pdoc);
789 * It is a handler who processes the HEAD tag.
791 * @param pdoc [i/o] The pointer to the XHTML structure at the output
792 * destination is specified.
793 * @param node [i] The HEAD tag node is specified.
794 * @return The conversion result is returned.
797 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
799 xhtml_t *xhtml = GET_XHTML(pdoc);
800 Doc *doc = xhtml->doc;
808 * It is a handler who processes the HEAD tag.
810 * @param pdoc [i/o] The pointer to the XHTML structure at the output
811 * destination is specified.
812 * @param node [i] The HEAD tag node is specified.
813 * @return The conversion result is returned.
816 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
818 xhtml_t *xhtml = GET_XHTML(pdoc);
819 Doc *doc = xhtml->doc;
827 * It is a handler who processes the TITLE tag.
829 * @param pdoc [i/o] The pointer to the XHTML structure at the output
830 * destination is specified.
831 * @param node [i] The TITLE tag node is specified.
832 * @return The conversion result is returned.
835 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
837 xhtml_t *xhtml = GET_XHTML(pdoc);
838 Doc *doc = xhtml->doc;
846 * It is a handler who processes the TITLE tag.
848 * @param pdoc [i/o] The pointer to the XHTML structure at the output
849 * destination is specified.
850 * @param node [i] The TITLE tag node is specified.
851 * @return The conversion result is returned.
854 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
856 xhtml_t *xhtml = GET_XHTML(pdoc);
857 Doc *doc = xhtml->doc;
865 * It is a handler who processes the BASE tag.
867 * @param pdoc [i/o] The pointer to the XHTML structure at the output
868 * destination is specified.
869 * @param node [i] The BASE tag node is specified.
870 * @return The conversion result is returned.
873 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
875 xhtml_t *xhtml = GET_XHTML(pdoc);
877 Doc *doc = xhtml->doc;
880 /*--------------------------------------------------------------------------*/
882 /*--------------------------------------------------------------------------*/
883 for (attr = qs_get_attr(doc,node);
885 attr = qs_get_next_attr(doc,attr)) {
886 char *name = qs_get_attr_name(doc,attr);
887 char *value = qs_get_attr_value(doc,attr);
888 if (STRCASEEQ('h','H',"href",name)) {
901 * It is a handler who processes the BASE tag.
903 * @param pdoc [i/o] The pointer to the XHTML structure at the output
904 * destination is specified.
905 * @param node [i] The BASE tag node is specified.
906 * @return The conversion result is returned.
909 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
911 xhtml_t *xhtml = GET_XHTML(pdoc);
918 * It is a handler who processes the BODY tag.
920 * @param pdoc [i/o] The pointer to the XHTML structure at the output
921 * destination is specified.
922 * @param node [i] The BODY tag node is specified.
923 * @return The conversion result is returned.
926 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
928 xhtml_t *xhtml = GET_XHTML(pdoc);
929 Doc *doc = xhtml->doc;
933 /*--------------------------------------------------------------------------*/
935 /*--------------------------------------------------------------------------*/
936 for (attr = qs_get_attr(doc,node);
938 attr = qs_get_next_attr(doc,attr)) {
939 char *name = qs_get_attr_name(doc,attr);
940 char *value = qs_get_attr_value(doc,attr);
941 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
946 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
951 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
956 else if (STRCASEEQ('a','A',"alink", name)) {
959 else if (STRCASEEQ('v','V',"vlink",name)) {
969 * It is a handler who processes the BODY tag.
971 * @param pdoc [i/o] The pointer to the XHTML structure at the output
972 * destination is specified.
973 * @param node [i] The BODY tag node is specified.
974 * @return The conversion result is returned.
977 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
979 xhtml_t *xhtml = GET_XHTML(pdoc);
980 Doc *doc = xhtml->doc;
988 * It is a handler who processes the A tag.
990 * @param pdoc [i/o] The pointer to the XHTML structure at the output
991 * destination is specified.
992 * @param node [i] The A tag node is specified.
993 * @return The conversion result is returned.
996 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
998 xhtml_t *xhtml = GET_XHTML(pdoc);
999 Doc *doc = xhtml->doc;
1000 request_rec *r = doc->r;
1004 /*--------------------------------------------------------------------------*/
1005 /* Get Attributes */
1006 /*--------------------------------------------------------------------------*/
1007 for (attr = qs_get_attr(doc,node);
1009 attr = qs_get_next_attr(doc,attr)) {
1010 char* name = qs_get_attr_name(doc,attr);
1011 char* value = qs_get_attr_value(doc,attr);
1012 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1017 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1018 value = chxj_encoding_parameter(r, value);
1023 else if (STRCASEEQ('a','A',"accesskey", name)) {
1024 W_L(" accesskey=\"");
1028 else if (STRCASEEQ('c','C',"cti",name)) {
1031 else if (STRCASEEQ('i','I',"ijam", name)) {
1034 else if (STRCASEEQ('u','U',"utn", name)) {
1037 else if (STRCASEEQ('t','T',"telbook",name)) {
1040 else if (STRCASEEQ('k','K',"kana",name)) {
1043 else if (STRCASEEQ('e','E',"email",name)) {
1046 else if (STRCASEEQ('i','I',"ista",name)) {
1049 else if (STRCASEEQ('i','I',"ilet",name)) {
1052 else if (STRCASEEQ('i','I',"iswf",name)) {
1055 else if (STRCASEEQ('i','I',"irst",name)) {
1065 * It is a handler who processes the A tag.
1067 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1068 * destination is specified.
1069 * @param node [i] The A tag node is specified.
1070 * @return The conversion result is returned.
1073 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1075 xhtml_t *xhtml = GET_XHTML(pdoc);
1076 Doc *doc = xhtml->doc;
1084 * It is a handler who processes the BR tag.
1086 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1087 * destination is specified.
1088 * @param node [i] The BR tag node is specified.
1089 * @return The conversion result is returned.
1092 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1094 xhtml_t *xhtml = GET_XHTML(pdoc);
1095 Doc *doc = xhtml->doc;
1099 /*--------------------------------------------------------------------------*/
1100 /* Get Attributes */
1101 /*--------------------------------------------------------------------------*/
1102 for (attr = qs_get_attr(doc,node);
1104 attr = qs_get_next_attr(doc,attr)) {
1105 char *name = qs_get_attr_name(doc,attr);
1106 char *value = qs_get_attr_value(doc,attr);
1107 if (STRCASEEQ('c','C',"clear",name)) {
1108 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1121 * It is a handler who processes the BR tag.
1123 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1124 * destination is specified.
1125 * @param node [i] The BR tag node is specified.
1126 * @return The conversion result is returned.
1129 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1131 xhtml_t *xhtml = GET_XHTML(pdoc);
1138 * It is a handler who processes the TR tag.
1140 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1141 * destination is specified.
1142 * @param node [i] The TR tag node is specified.
1143 * @return The conversion result is returned.
1146 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1148 xhtml_t *xhtml = GET_XHTML(pdoc);
1149 Doc *doc = xhtml->doc;
1157 * It is a handler who processes the TR tag.
1159 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1160 * destination is specified.
1161 * @param node [i] The TR tag node is specified.
1162 * @return The conversion result is returned.
1165 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1167 xhtml_t *xhtml = GET_XHTML(pdoc);
1174 * It is a handler who processes the FONT tag.
1176 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1177 * destination is specified.
1178 * @param node [i] The FONT tag node is specified.
1179 * @return The conversion result is returned.
1182 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1184 xhtml_t *xhtml = GET_XHTML(pdoc);
1185 Doc *doc = xhtml->doc;
1190 /*=========================================================================*/
1191 /* Get Attributes */
1192 /*=========================================================================*/
1193 for (attr = qs_get_attr(doc,node);
1195 attr = qs_get_next_attr(doc,attr)) {
1196 char *name = qs_get_attr_name(doc,attr);
1197 char *value = qs_get_attr_value(doc,attr);
1198 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1199 color = apr_pstrdup(doc->buf.pool, value);
1201 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1202 size = apr_pstrdup(doc->buf.pool, value);
1206 W_L("<font color=\"");
1209 xhtml->font_color_flag++;
1212 xhtml->font_size_flag++;
1214 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1215 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1216 case '3': W_L("<span style=\"font-size: small\">"); break;
1217 case '4': W_L("<span style=\"font-size: medium\">"); break;
1218 case '5': W_L("<span style=\"font-size: large\">"); break;
1219 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1220 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1222 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7)", size);
1223 xhtml->font_size_flag--;
1231 * It is a handler who processes the FONT tag.
1233 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1234 * destination is specified.
1235 * @param node [i] The FONT tag node is specified.
1236 * @return The conversion result is returned.
1239 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1241 xhtml_t *xhtml = GET_XHTML(pdoc);
1242 Doc *doc = xhtml->doc;
1244 if (xhtml->font_size_flag) {
1246 xhtml->font_size_flag--;
1248 if (xhtml->font_color_flag) {
1250 xhtml->font_color_flag--;
1257 * It is a handler who processes the FORM tag.
1259 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1260 * destination is specified.
1261 * @param node [i] The FORM tag node is specified.
1262 * @return The conversion result is returned.
1265 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1267 xhtml_t *xhtml = GET_XHTML(pdoc);
1268 Doc *doc = xhtml->doc;
1269 request_rec *r = doc->r;
1273 /*--------------------------------------------------------------------------*/
1274 /* Get Attributes */
1275 /*--------------------------------------------------------------------------*/
1276 for (attr = qs_get_attr(doc,node);
1278 attr = qs_get_next_attr(doc,attr)) {
1279 char *name = qs_get_attr_name(doc,attr);
1280 char *value = qs_get_attr_value(doc,attr);
1281 if (STRCASEEQ('a','A',"action",name)) {
1282 value = chxj_encoding_parameter(r, value);
1287 else if (STRCASEEQ('m','M',"method",name)) {
1292 else if (STRCASEEQ('u','U',"utn",name)) {
1302 * It is a handler who processes the FORM tag.
1304 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1305 * destination is specified.
1306 * @param node [i] The FORM tag node is specified.
1307 * @return The conversion result is returned.
1310 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1312 xhtml_t *xhtml = GET_XHTML(pdoc);
1313 Doc *doc = xhtml->doc;
1321 * It is a handler who processes the INPUT tag.
1323 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1324 * destination is specified.
1325 * @param node [i] The INPUT tag node is specified.
1326 * @return The conversion result is returned.
1329 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1331 xhtml_t *xhtml = GET_XHTML(pdoc);
1332 Doc *doc = xhtml->doc;
1333 request_rec *r = doc->r;
1334 char *max_length = NULL;
1338 char *istyle = NULL;
1340 char *checked = NULL;
1341 char *accesskey = NULL;
1344 /*--------------------------------------------------------------------------*/
1345 /* Get Attributes */
1346 /*--------------------------------------------------------------------------*/
1347 type = qs_get_type_attr(doc, node, r);
1348 name = qs_get_name_attr(doc, node, r);
1349 value = qs_get_value_attr(doc,node,r);
1350 istyle = qs_get_istyle_attr(doc,node,r);
1351 max_length = qs_get_maxlength_attr(doc,node,r);
1352 checked = qs_get_checked_attr(doc,node,r);
1353 accesskey = qs_get_accesskey_attr(doc, node, r);
1354 size = qs_get_size_attr(doc, node, r);
1357 type = qs_trim_string(doc->buf.pool, type);
1358 if (type && (STRCASEEQ('t','T',"text", type) ||
1359 STRCASEEQ('p','P',"password",type) ||
1360 STRCASEEQ('c','C',"checkbox",type) ||
1361 STRCASEEQ('r','R',"radio", type) ||
1362 STRCASEEQ('h','H',"hidden", type) ||
1363 STRCASEEQ('s','S',"submit", type) ||
1364 STRCASEEQ('r','R',"reset", type))) {
1370 if (size && *size) {
1375 if (name && *name) {
1380 if (value && *value) {
1385 if (accesskey && *accesskey) {
1386 W_L(" accesskey=\"");
1390 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1391 char *fmt = qs_conv_istyle_to_format(r,istyle);
1392 if (max_length && *max_length) {
1394 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1395 if (max_length[ii] < '0' || max_length[ii] > '9') {
1396 max_length = apr_psprintf(r->pool, "0");
1401 if (strcmp(max_length, "0")) {
1402 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1414 if (max_length && *max_length) {
1415 if (chxj_chk_numeric(max_length) != 0) {
1416 max_length = apr_psprintf(r->pool, "0");
1418 if (strcmp(max_length, "0")) {
1419 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1424 /*--------------------------------------------------------------------------*/
1425 /* The figure is default for the password. */
1426 /*--------------------------------------------------------------------------*/
1427 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1434 W_L(" FORMAT=\"*N\"");
1438 W_L(" checked=\"checked\"");
1446 * It is a handler who processes the INPUT tag.
1448 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1449 * destination is specified.
1450 * @param node [i] The INPUT tag node is specified.
1451 * @return The conversion result is returned.
1454 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1456 xhtml_t *xhtml = GET_XHTML(pdoc);
1463 * It is a handler who processes the CENTER tag.
1465 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1466 * destination is specified.
1467 * @param node [i] The CENTER tag node is specified.
1468 * @return The conversion result is returned.
1471 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1473 xhtml_t *xhtml = GET_XHTML(pdoc);
1474 Doc *doc = xhtml->doc;
1482 * It is a handler who processes the CENTER tag.
1484 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1485 * destination is specified.
1486 * @param node [i] The CENTER tag node is specified.
1487 * @return The conversion result is returned.
1490 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1492 xhtml_t *xhtml = GET_XHTML(pdoc);
1493 Doc *doc = xhtml->doc;
1501 * It is a handler who processes the HR tag.
1503 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1504 * destination is specified.
1505 * @param node [i] The HR tag node is specified.
1506 * @return The conversion result is returned.
1509 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1511 xhtml_t *xhtml = GET_XHTML(pdoc);
1512 Doc *doc = xhtml->doc;
1517 for (attr = qs_get_attr(doc,node);
1519 attr = qs_get_next_attr(doc,attr)) {
1520 char *name = qs_get_attr_name(doc,attr);
1521 char *value = qs_get_attr_value(doc,attr);
1522 if (STRCASEEQ('a','A',"align", name)) {
1523 /*----------------------------------------------------------------------*/
1525 /*----------------------------------------------------------------------*/
1526 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1532 else if (STRCASEEQ('s','S',"size", name)) {
1533 /*----------------------------------------------------------------------*/
1535 /*----------------------------------------------------------------------*/
1536 if (value && *value) {
1542 else if (STRCASEEQ('w','W',"width", name)) {
1543 /*----------------------------------------------------------------------*/
1545 /*----------------------------------------------------------------------*/
1546 if (value && *value) {
1552 else if (STRCASEEQ('n','N',"noshade", name)) {
1553 /*----------------------------------------------------------------------*/
1555 /*----------------------------------------------------------------------*/
1558 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1559 /*----------------------------------------------------------------------*/
1561 /*----------------------------------------------------------------------*/
1573 * It is a handler who processes the HR tag.
1575 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1576 * destination is specified.
1577 * @param node [i] The HR tag node is specified.
1578 * @return The conversion result is returned.
1581 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1583 xhtml_t *xhtml = GET_XHTML(pdoc);
1590 * It is a handler who processes the PRE tag.
1592 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1593 * destination is specified.
1594 * @param node [i] The PRE tag node is specified.
1595 * @return The conversion result is returned.
1598 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1600 xhtml_t *xhtml = GET_XHTML(pdoc);
1601 Doc *doc = xhtml->doc;
1610 * It is a handler who processes the PRE tag.
1612 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1613 * destination is specified.
1614 * @param node [i] The PRE tag node is specified.
1615 * @return The conversion result is returned.
1618 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1620 xhtml_t *xhtml = GET_XHTML(pdoc);
1621 Doc *doc = xhtml->doc;
1631 * It is a handler who processes the P tag.
1633 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1634 * destination is specified.
1635 * @param node [i] The P tag node is specified.
1636 * @return The conversion result is returned.
1639 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1641 xhtml_t *xhtml = GET_XHTML(pdoc);
1642 Doc *doc = xhtml->doc;
1647 for (attr = qs_get_attr(doc,node);
1649 attr = qs_get_next_attr(doc,attr)) {
1650 char *nm = qs_get_attr_name(doc,attr);
1651 char *val = qs_get_attr_value(doc,attr);
1652 if (STRCASEEQ('a','A',"align", nm)) {
1653 /*----------------------------------------------------------------------*/
1654 /* CHTML 1.0 (W3C version 3.2) */
1655 /*----------------------------------------------------------------------*/
1656 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1657 align = apr_pstrdup(doc->buf.pool, val);
1673 * It is a handler who processes the P tag.
1675 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1676 * destination is specified.
1677 * @param node [i] The P tag node is specified.
1678 * @return The conversion result is returned.
1681 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1683 xhtml_t *xhtml = GET_XHTML(pdoc);
1684 Doc *doc = xhtml->doc;
1692 * It is a handler who processes the UL tag.
1694 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1695 * destination is specified.
1696 * @param node [i] The UL tag node is specified.
1697 * @return The conversion result is returned.
1700 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1702 xhtml_t *xhtml = GET_XHTML(pdoc);
1703 Doc *doc = xhtml->doc;
1706 /*--------------------------------------------------------------------------*/
1707 /* Get Attributes */
1708 /*--------------------------------------------------------------------------*/
1709 for (attr = qs_get_attr(doc,node);
1711 attr = qs_get_next_attr(doc,attr)) {
1712 char *name = qs_get_attr_name(doc,attr);
1713 char *value = qs_get_attr_value(doc,attr);
1714 if (STRCASEEQ('t','T',"type",name)) {
1715 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1728 * It is a handler who processes the UL tag.
1730 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1731 * destination is specified.
1732 * @param node [i] The UL tag node is specified.
1733 * @return The conversion result is returned.
1736 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1738 xhtml_t *xhtml = GET_XHTML(pdoc);
1739 Doc *doc = xhtml->doc;
1747 * It is a handler who processes the H1 tag.
1749 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1750 * destination is specified.
1751 * @param node [i] The H1 tag node is specified.
1752 * @return The conversion result is returned.
1755 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1757 xhtml_t *xhtml = GET_XHTML(pdoc);
1758 Doc *doc = xhtml->doc;
1762 for (attr = qs_get_attr(doc,node);
1764 attr = qs_get_next_attr(doc,attr)) {
1767 name = qs_get_attr_name(doc,attr);
1768 value = qs_get_attr_value(doc,attr);
1769 if (STRCASEEQ('a','A',"align", name)) {
1771 if (STRCASEEQ('l','L',"left",value)) {
1773 W_L("text-align:left");
1776 else if (STRCASEEQ('r','R',"right",value)) {
1778 W_L("text-align:right");
1781 else if (STRCASEEQ('c','C',"center",value)) {
1783 W_L("text-align:center");
1796 * It is a handler who processes the H1 tag.
1798 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1799 * destination is specified.
1800 * @param node [i] The H1 tag node is specified.
1801 * @return The conversion result is returned.
1804 s_xhtml_1_0_end_h1_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 H2 tag.
1817 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1818 * destination is specified.
1819 * @param node [i] The H2 tag node is specified.
1820 * @return The conversion result is returned.
1823 s_xhtml_1_0_start_h2_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 H2 tag.
1866 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1867 * destination is specified.
1868 * @param node [i] The H2 tag node is specified.
1869 * @return The conversion result is returned.
1872 s_xhtml_1_0_end_h2_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 H3 tag.
1885 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1886 * destination is specified.
1887 * @param node [i] The H3 tag node is specified.
1888 * @return The conversion result is returned.
1891 s_xhtml_1_0_start_h3_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 H3 tag.
1934 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1935 * destination is specified.
1936 * @param node [i] The H3 tag node is specified.
1937 * @return The conversion result is returned.
1940 s_xhtml_1_0_end_h3_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 H4 tag.
1953 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1954 * destination is specified.
1955 * @param node [i] The H4 tag node is specified.
1956 * @return The conversion result is returned.
1959 s_xhtml_1_0_start_h4_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 H4 tag.
2002 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2003 * destination is specified.
2004 * @param node [i] The H4 tag node is specified.
2005 * @return The conversion result is returned.
2008 s_xhtml_1_0_end_h4_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 H5 tag.
2021 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2022 * destination is specified.
2023 * @param node [i] The H5 tag node is specified.
2024 * @return The conversion result is returned.
2027 s_xhtml_1_0_start_h5_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 H5 tag.
2070 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2071 * destination is specified.
2072 * @param node [i] The H5 tag node is specified.
2073 * @return The conversion result is returned.
2076 s_xhtml_1_0_end_h5_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 H6 tag.
2089 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2090 * destination is specified.
2091 * @param node [i] The H6 tag node is specified.
2092 * @return The conversion result is returned.
2095 s_xhtml_1_0_start_h6_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 H6 tag.
2138 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2139 * destination is specified.
2140 * @param node [i] The H6 tag node is specified.
2141 * @return The conversion result is returned.
2144 s_xhtml_1_0_end_h6_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 OL tag.
2157 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2158 * destination is specified.
2159 * @param node [i] The OL tag node is specified.
2160 * @return The conversion result is returned.
2163 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2165 xhtml_t *xhtml = GET_XHTML(pdoc);
2166 Doc *doc = xhtml->doc;
2170 /*--------------------------------------------------------------------------*/
2171 /* Get Attributes */
2172 /*--------------------------------------------------------------------------*/
2173 for (attr = qs_get_attr(doc,node);
2175 attr = qs_get_next_attr(doc,attr)) {
2176 char *name = qs_get_attr_name(doc,attr);
2177 char *value = qs_get_attr_value(doc,attr);
2178 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2183 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2195 * It is a handler who processes the OL tag.
2197 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2198 * destination is specified.
2199 * @param node [i] The OL tag node is specified.
2200 * @return The conversion result is returned.
2203 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2205 xhtml_t *xhtml = GET_XHTML(pdoc);
2206 Doc *doc = xhtml->doc;
2214 * It is a handler who processes the LI tag.
2216 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2217 * destination is specified.
2218 * @param node [i] The LI tag node is specified.
2219 * @return The conversion result is returned.
2222 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2224 xhtml_t *xhtml = GET_XHTML(pdoc);
2225 Doc *doc = xhtml->doc;
2229 /*--------------------------------------------------------------------------*/
2230 /* Get Attributes */
2231 /*--------------------------------------------------------------------------*/
2232 for (attr = qs_get_attr(doc,node);
2234 attr = qs_get_next_attr(doc,attr)) {
2235 char *name = qs_get_attr_name(doc,attr);
2236 char *value = qs_get_attr_value(doc,attr);
2237 if (STRCASEEQ('t','T',"type",name)) {
2238 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2244 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2256 ** It is a handler who processes the LI tag.
2258 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2259 * destination is specified.
2260 * @param node [i] The LI tag node is specified.
2261 * @return The conversion result is returned.
2264 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2266 xhtml_t *xhtml = GET_XHTML(pdoc);
2267 Doc *doc = xhtml->doc;
2274 * It is a handler who processes the IMG tag.
2276 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2277 * destination is specified.
2278 * @param node [i] The IMG tag node is specified.
2279 * @return The conversion result is returned.
2282 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2284 xhtml_t *xhtml = GET_XHTML(pdoc);
2285 Doc *doc = xhtml->doc;
2286 request_rec *r = doc->r;
2289 #ifndef IMG_NOT_CONVERT_FILENAME
2290 device_table *spec = xhtml->spec;
2294 /*--------------------------------------------------------------------------*/
2295 /* Get Attributes */
2296 /*--------------------------------------------------------------------------*/
2297 for (attr = qs_get_attr(doc,node);
2299 attr = qs_get_next_attr(doc,attr)) {
2300 char *name = qs_get_attr_name(doc,attr);
2301 char *value = qs_get_attr_value(doc,attr);
2303 if (STRCASEEQ('s','S',"src",name)) {
2304 value = chxj_encoding_parameter(r, value);
2305 #ifdef IMG_NOT_CONVERT_FILENAME
2315 char *vv = chxj_img_conv(r,spec,value);
2323 if (STRCASEEQ('a','A',"align",name)) {
2325 if (STRCASEEQ('t','T',"top", value) ||
2326 STRCASEEQ('m','M',"middle",value) ||
2327 STRCASEEQ('b','B',"bottom",value) ||
2328 STRCASEEQ('l','L',"left", value) ||
2329 STRCASEEQ('r','R',"right", value)) {
2334 else if (STRCASEEQ('c','C',"center", value)) {
2341 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2346 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2351 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2356 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2361 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2373 * It is a handler who processes the IMG tag.
2375 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2376 * destination is specified.
2377 * @param node [i] The IMG tag node is specified.
2378 * @return The conversion result is returned.
2381 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2383 xhtml_t *xhtml = GET_XHTML(pdoc);
2390 * It is a handler who processes the SELECT tag.
2392 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2393 * destination is specified.
2394 * @param node [i] The SELECT tag node is specified.
2395 * @return The conversion result is returned.
2398 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2400 xhtml_t *xhtml = GET_XHTML(pdoc);
2401 Doc *doc = xhtml->doc;
2404 char *multiple = NULL;
2409 for (attr = qs_get_attr(doc,child);
2411 attr = qs_get_next_attr(doc,attr)) {
2412 char *nm = qs_get_attr_name(doc,attr);
2413 char *val = qs_get_attr_value(doc,attr);
2414 if (STRCASEEQ('s','S',"size",nm)) {
2415 /*----------------------------------------------------------------------*/
2416 /* CHTML 1.0 version 2.0 */
2417 /*----------------------------------------------------------------------*/
2418 size = apr_pstrdup(doc->buf.pool, val);
2420 else if (STRCASEEQ('n','N',"name",nm)) {
2421 /*----------------------------------------------------------------------*/
2422 /* CHTML 1.0 version 2.0 */
2423 /*----------------------------------------------------------------------*/
2424 name = apr_pstrdup(doc->buf.pool, val);
2426 else if (STRCASEEQ('m','M',"multiple",nm)) {
2427 /*----------------------------------------------------------------------*/
2428 /* CHTML 1.0 version 2.0 */
2429 /*----------------------------------------------------------------------*/
2430 multiple = apr_pstrdup(doc->buf.pool, val);
2433 if (size && *size) {
2438 if (name && *name) {
2444 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2445 W_L(" multiple=\"true\"");
2453 * It is a handler who processes the SELECT tag.
2455 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2456 * destination is specified.
2457 * @param node [i] The SELECT tag node is specified.
2458 * @return The conversion result is returned.
2461 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2463 xhtml_t *xhtml = GET_XHTML(pdoc);
2464 Doc *doc = xhtml->doc;
2466 W_L("</select>\r\n");
2472 * It is a handler who processes the OPTION tag.
2474 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2475 * destination is specified.
2476 * @param node [i] The OPTION tag node is specified.
2477 * @return The conversion result is returned.
2480 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2482 xhtml_t *xhtml = GET_XHTML(pdoc);
2483 Doc *doc = xhtml->doc;
2486 char *selected = NULL;
2490 for (attr = qs_get_attr(doc,child);
2492 attr = qs_get_next_attr(doc,attr)) {
2493 char *nm = qs_get_attr_name(doc,attr);
2494 char *val = qs_get_attr_value(doc,attr);
2495 if (STRCASEEQ('s','S',"selected",nm)) {
2496 /* CHTML version 2.0 */
2497 selected = apr_pstrdup(doc->buf.pool, val);
2499 else if (STRCASEEQ('v','V',"value",nm)) {
2500 /* CHTML version 2.0 */
2501 value = apr_pstrdup(doc->buf.pool, val);
2504 if (value && *value) {
2510 W_L(" selected=\"selected\"");
2518 * It is a handler who processes the OPTION tag.
2520 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2521 * destination is specified.
2522 * @param node [i] The OPTION tag node is specified.
2523 * @return The conversion result is returned.
2526 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2528 xhtml_t *xhtml = GET_XHTML(pdoc);
2529 Doc *doc = xhtml->doc;
2531 W_L("</option>\r\n");
2537 * It is a handler who processes the DIV tag.
2539 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2540 * destination is specified.
2541 * @param node [i] The DIV tag node is specified.
2542 * @return The conversion result is returned.
2545 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2547 xhtml_t *xhtml = GET_XHTML(pdoc);
2548 Doc *doc = xhtml->doc;
2553 for (attr = qs_get_attr(doc,child);
2555 attr = qs_get_next_attr(doc,attr)) {
2556 char *nm = qs_get_attr_name(doc,attr);
2557 char *val = qs_get_attr_value(doc,attr);
2558 if (STRCASEEQ('a','A',"align",nm)) {
2559 /*=====================================================================*/
2560 /* CHTML version 3.2 */
2561 /*=====================================================================*/
2562 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2563 align = apr_pstrdup(doc->buf.pool, val);
2578 * It is a handler who processes the DIV tag.
2580 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2581 * destination is specified.
2582 * @param node [i] The DIV tag node is specified.
2583 * @return The conversion result is returned.
2586 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2588 xhtml_t *xhtml = GET_XHTML(pdoc);
2589 Doc *doc = xhtml->doc;
2596 * It is a handler who processes the B tag.
2598 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2599 * destination is specified.
2600 * @param node [i] The B tag node is specified.
2601 * @return The conversion result is returned.
2604 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2606 xhtml_t *xhtml = GET_XHTML(pdoc);
2607 Doc *doc = xhtml->doc;
2609 W_L("<div style=\"font-weight:bold\">");
2615 * It is a handler who processes the B tag.
2617 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2618 * destination is specified.
2619 * @param node [i] The B tag node is specified.
2620 * @return The conversion result is returned.
2623 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2625 xhtml_t *xhtml = GET_XHTML(pdoc);
2626 Doc *doc = xhtml->doc;
2634 * It is a handler who processes the CHXJ:IF tag.
2636 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2637 * destination is specified.
2638 * @param node [i] The CHXJ:IF tag node is specified.
2641 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2643 xhtml_t *xhtml = GET_XHTML(pdoc);
2644 Doc *doc = xhtml->doc;
2647 for (child = qs_get_child_node(doc, node);
2649 child = qs_get_next_node(doc, child)) {
2651 s_xhtml_1_0_chxjif_tag(xhtml, child);
2659 * It is a handler who processes the TEXTARE tag.
2661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2662 * destination is specified.
2663 * @param node [i] The TEXTAREA tag node is specified.
2664 * @return The conversion result is returned.
2667 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2669 xhtml_t *xhtml = GET_XHTML(pdoc);
2670 Doc *doc = xhtml->doc;
2673 xhtml->textarea_flag++;
2675 for (attr = qs_get_attr(doc,node);
2677 attr = qs_get_next_attr(doc,attr)) {
2678 char *name = qs_get_attr_name(doc,attr);
2679 char *value = qs_get_attr_value(doc,attr);
2680 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2685 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2690 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2695 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2696 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2701 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2702 W_L(" accesskey=\"");
2713 * It is a handler who processes the TEXTAREA tag.
2715 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2716 * destination is specified.
2717 * @param node [i] The TEXTAREA tag node is specified.
2718 * @return The conversion result is returned.
2721 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2723 xhtml_t *xhtml = GET_XHTML(pdoc);
2724 Doc *doc = xhtml->doc;
2726 W_L("</textarea>\r\n");
2727 xhtml->textarea_flag--;
2733 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2735 xhtml_t *xhtml = GET_XHTML(pdoc);
2736 Doc *doc = xhtml->doc;
2737 request_rec *r = doc->r;
2745 textval = qs_get_node_value(doc,child);
2746 if (strlen(textval) == 0) {
2750 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2751 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2753 tdst = qs_alloc_zero_byte_string(r);
2754 memset(one_byte, 0, sizeof(one_byte));
2757 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2759 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2761 DBG(r,"[%s][%d]", out, rtn);
2762 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2766 if (is_sjis_kanji(textval[ii])) {
2767 one_byte[0] = textval[ii+0];
2768 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2769 one_byte[0] = textval[ii+1];
2770 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2773 else if (xhtml->pre_flag) {
2774 one_byte[0] = textval[ii+0];
2775 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2777 else if (xhtml->textarea_flag) {
2778 one_byte[0] = textval[ii+0];
2779 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2781 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2782 one_byte[0] = textval[ii+0];
2783 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2792 * It is a handler who processes the BLOCKQUOTE tag.
2794 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2795 * destination is specified.
2796 * @param node [i] The BLOCKQUOTE tag node is specified.
2797 * @return The conversion result is returned.
2800 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2802 xhtml_t *xhtml = GET_XHTML(pdoc);
2803 Doc *doc = xhtml->doc;
2804 W_L("<blockquote>");
2810 * It is a handler who processes the BLOCKQUOTE tag.
2812 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2813 * destination is specified.
2814 * @param node [i] The BLOCKQUOTE tag node is specified.
2815 * @return The conversion result is returned.
2818 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2820 xhtml_t *xhtml = GET_XHTML(pdoc);
2821 Doc *doc = xhtml->doc;
2822 W_L("</blockquote>");
2828 * It is a handler who processes the DIR tag.
2830 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2831 * destination is specified.
2832 * @param node [i] The DIR tag node is specified.
2833 * @return The conversion result is returned.
2836 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2838 xhtml_t *xhtml = GET_XHTML(pdoc);
2839 Doc *doc = xhtml->doc;
2842 for (attr = qs_get_attr(doc,node);
2844 attr = qs_get_next_attr(doc,attr)) {
2845 char *name = qs_get_attr_name(doc,attr);
2846 char *value = qs_get_attr_value(doc,attr);
2847 if (STRCASEEQ('t','T',"type",name)) {
2848 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2861 * It is a handler who processes the DIR tag.
2863 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2864 * destination is specified.
2865 * @param node [i] The DIR tag node is specified.
2866 * @return The conversion result is returned.
2869 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2871 xhtml_t *xhtml = GET_XHTML(pdoc);
2872 Doc *doc = xhtml->doc;
2879 * It is a handler who processes the DL tag.
2881 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2882 * destination is specified.
2883 * @param node [i] The DL tag node is specified.
2884 * @return The conversion result is returned.
2887 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2889 xhtml_t *xhtml = GET_XHTML(pdoc);
2890 Doc *doc = xhtml->doc;
2897 * It is a handler who processes the DL tag.
2899 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2900 * destination is specified.
2901 * @param node [i] The DL tag node is specified.
2902 * @return The conversion result is returned.
2905 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2907 xhtml_t *xhtml = GET_XHTML(pdoc);
2908 Doc *doc = xhtml->doc;
2915 * It is a handter who processes the DT tag.
2917 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2918 * destination is specified.
2919 * @param node [i] The DT tag node is specified.
2920 * @return The conversion result is returned.
2923 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
2925 xhtml_t *xhtml = GET_XHTML(pdoc);
2926 Doc *doc = xhtml->doc;
2933 * It is a handter who processes the DT tag.
2935 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2936 * destination is specified.
2937 * @param node [i] The DT tag node is specified.
2938 * @return The conversion result is returned.
2941 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
2943 xhtml_t *xhtml = GET_XHTML(pdoc);
2944 Doc *doc = xhtml->doc;
2951 * It is a handder who processes the DD tag.
2953 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2954 * destination is specified.
2955 * @param node [i] The DD tag node is specified.
2956 * @return The conversion result is returned.
2959 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
2961 xhtml_t *xhtml = GET_XHTML(pdoc);
2962 Doc *doc = xhtml->doc;
2969 * It is a handder who processes the DD tag.
2971 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2972 * destination is specified.
2973 * @param node [i] The DD tag node is specified.
2974 * @return The conversion result is returned.
2977 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
2979 xhtml_t *xhtml = GET_XHTML(pdoc);
2980 Doc *doc = xhtml->doc;
2987 * It is a handler who processes the MENU tag.
2989 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2990 * destination is specified.
2991 * @param node [i] The MENU tag node is specified.
2992 * @return The conversion result is returned.
2995 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
2997 xhtml_t *xhtml = GET_XHTML(pdoc);
2998 Doc *doc = xhtml->doc;
3001 /*--------------------------------------------------------------------------*/
3002 /* Get Attributes */
3003 /*--------------------------------------------------------------------------*/
3004 for (attr = qs_get_attr(doc,node);
3006 attr = qs_get_next_attr(doc,attr)) {
3007 char *name = qs_get_attr_name(doc,attr);
3008 char *value = qs_get_attr_value(doc,attr);
3009 if (STRCASEEQ('t','T',"type",name)) {
3010 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3023 * It is a hanmenuer who processes the MENU tag.
3025 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3026 * destination is specified.
3027 * @param node [i] The MENU tag node is specified.
3028 * @return The conversion result is returned.
3031 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3033 xhtml_t *xhtml = GET_XHTML(pdoc);
3034 Doc *doc = xhtml->doc;
3041 * It is a handler who processes the PLAINTEXT tag.
3043 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3044 * destination is specified.
3045 * @param node [i] The PLAINTEXT tag node is specified.
3046 * @return The conversion result is returned.
3049 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3051 xhtml_t *xhtml = GET_XHTML(pdoc);
3052 Doc *doc = xhtml->doc;
3054 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3059 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3061 xhtml_t *xhtml = GET_XHTML(pdoc);
3062 Doc *doc = xhtml->doc;
3064 for (child = qs_get_child_node(doc, node);
3066 child = qs_get_next_node(doc, child)) {
3068 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3075 * It is a handler who processes the PLAINTEXT tag.
3077 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3078 * destination is specified.
3079 * @param node [i] The PLAINTEXT tag node is specified.
3080 * @return The conversion result is returned.
3083 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3085 xhtml_t *xhtml = GET_XHTML(pdoc);
3086 Doc *doc = xhtml->doc;
3087 W_L("</plaintext>");
3093 * It is a hanblinker who processes the BLINK tag.
3095 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3096 * destination is specified.
3097 * @param node [i] The BLINK tag node is specified.
3098 * @return The conversion result is returned.
3101 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3103 xhtml_t *xhtml = GET_XHTML(pdoc);
3104 Doc *doc = xhtml->doc;
3111 * It is a hanblinker who processes the BLINK tag.
3113 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3114 * destination is specified.
3115 * @param node [i] The BLINK tag node is specified.
3116 * @return The conversion result is returned.
3119 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3121 xhtml_t *xhtml = GET_XHTML(pdoc);
3122 Doc *doc = xhtml->doc;
3129 * It is a handler who processes the MARQUEE tag.
3131 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3132 * destination is specified.
3133 * @param node [i] The MARQUEE tag node is specified.
3134 * @return The conversion result is returned.
3137 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3139 xhtml_t *xhtml = GET_XHTML(pdoc);
3140 Doc *doc = xhtml->doc;
3143 /*--------------------------------------------------------------------------*/
3144 /* Get Attributes */
3145 /*--------------------------------------------------------------------------*/
3146 for (attr = qs_get_attr(doc,node);
3148 attr = qs_get_next_attr(doc,attr)) {
3149 char *name = qs_get_attr_name(doc,attr);
3150 char *value = qs_get_attr_value(doc,attr);
3151 if (STRCASEEQ('d','D',"direction", name)) {
3152 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3153 W_L(" direction=\"");
3158 else if (STRCASEEQ('b','B',"behavior",name)) {
3159 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3160 W_L(" behavior=\"");
3165 else if (STRCASEEQ('l','L',"loop",name)) {
3166 if (value && *value) {
3172 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3173 if (value && *value) {
3186 * It is a handler who processes the MARQUEE tag.
3188 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3189 * destination is specified.
3190 * @param node [i] The MARQUEE tag node is specified.
3191 * @return The conversion result is returned.
3194 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3196 xhtml_t *xhtml = GET_XHTML(pdoc);
3197 Doc *doc = xhtml->doc;