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_exchange_xhtml_mobile_1_0(
406 chxjconvrule_entry *entryp,
415 DBG(r,"start chxj_exchange_xhtml_mobile_1_0()");
416 /*--------------------------------------------------------------------------*/
418 /*--------------------------------------------------------------------------*/
420 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
422 DBG(r,"end chxj_exchange_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;
432 xhtml.cookie = cookie;
434 chxj_set_content_type(r, "text/html; charset=Windows-31J");
436 /*--------------------------------------------------------------------------*/
437 /* The character string of the input is analyzed. */
438 /*--------------------------------------------------------------------------*/
439 qs_init_malloc(&doc);
440 qs_init_root_node(&doc);
442 ss = apr_pcalloc(r->pool, srclen + 1);
443 memset(ss, 0, srclen + 1);
444 memcpy(ss, src, srclen);
447 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
449 qs_parse_string(&doc,ss, strlen(ss));
451 chxj_buffered_write_init(r->pool, &doc.buf);
452 /*--------------------------------------------------------------------------*/
453 /* It converts it from CHTML to XHTML. */
454 /*--------------------------------------------------------------------------*/
455 chxj_node_exchange(spec,r,(void*)&xhtml, &doc, qs_get_root(&doc), 0);
456 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
457 dst = apr_pstrdup(r->pool, xhtml.out);
458 chxj_buffered_write_terminate(&doc.buf);
460 qs_all_free(&doc,QX_LOGMARK);
463 return apr_pstrdup(r->pool,ss);
467 dst = apr_psprintf(r->pool, "\n");
469 *dstlen = strlen(dst);
472 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
475 DBG(r,"end chxj_exchange_xhtml_mobile_1_0()");
481 * The XHTML structure is initialized.
483 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
484 * initialized is specified.
485 * @param doc [i] The Doc structure that should be set to the initialized
486 * HDML structure is specified.
487 * @param r [i] To use POOL, the pointer to request_rec is specified.
488 * @param spec [i] The pointer to the device_table
491 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
493 memset(doc, 0, sizeof(Doc));
494 memset(xhtml, 0, sizeof(xhtml_t));
499 xhtml->out = qs_alloc_zero_byte_string(r);
500 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
501 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
506 * Corresponding EMOJI to a current character-code is retrieved.
507 * The substitution character string is stored in the rslt pointer if agreeing.
509 * @param xhtml [i] The pointer to the XHTML structure is specified.
510 * @param txt [i] The character string to want to examine whether it is
511 * EMOJI is specified.
512 * @param rslt [o] The pointer to the pointer that stores the result is
514 * @return When corresponding EMOJI exists, it returns it excluding 0.
517 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
530 DBG(r,"spec is NULL");
533 for (ee = xhtml->conf->emoji;
536 unsigned char hex1byte;
537 unsigned char hex2byte;
539 DBG(r,"emoji->imode is NULL");
543 if (ee->imode->string != NULL
544 && strlen(ee->imode->string) > 0
545 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
546 if (spec == NULL || spec->emoji_type == NULL) {
547 *rslt = apr_psprintf(r->pool,
550 return strlen(ee->imode->string);
553 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
554 *rslt = apr_psprintf(r->pool,
557 return strlen(ee->imode->string);
560 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
561 *rslt = apr_psprintf(r->pool,
564 return strlen(ee->imode->string);
567 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
568 *rslt = apr_psprintf(r->pool,
571 return strlen(ee->imode->string);
574 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
575 *rslt = apr_psprintf(r->pool,
578 return strlen(ee->imode->string);
581 *rslt = apr_psprintf(r->pool,
584 return strlen(ee->imode->string);
588 hex1byte = ee->imode->hex1byte & 0xff;
589 hex2byte = ee->imode->hex2byte & 0xff;
591 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
592 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
593 if (spec == NULL || spec->emoji_type == NULL) {
594 *rslt = apr_psprintf(r->pool,
595 "<img localsrc=\"%s\">",
600 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
601 *rslt = apr_psprintf(r->pool,
602 "<img localsrc=\"%s\">",
607 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
608 *rslt = apr_psprintf(r->pool,
609 "<img localsrc=\"%s\">",
614 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
615 *rslt = apr_psprintf(r->pool,
616 "<img localsrc=\"%s\">",
621 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
622 *rslt = apr_psprintf(r->pool,
623 "<img localsrc=\"%s\">",
628 *rslt = apr_psprintf(r->pool,
629 "<img localsrc=\"%s\">",
641 * It is a handler who processes the HTML tag.
643 * @param pdoc [i/o] The pointer to the XHTML structure at the output
644 * destination is specified.
645 * @param node [i] The HTML tag node is specified.
646 * @return The conversion result is returned.
649 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
651 xhtml_t *xhtml = GET_XHTML(pdoc);
653 Doc *doc = xhtml->doc;
655 /*--------------------------------------------------------------------------*/
656 /* Add XML Declare */
657 /*--------------------------------------------------------------------------*/
658 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n");
659 /*--------------------------------------------------------------------------*/
661 /*--------------------------------------------------------------------------*/
662 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n");
663 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n");
664 /*--------------------------------------------------------------------------*/
666 /*--------------------------------------------------------------------------*/
667 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
668 /*--------------------------------------------------------------------------*/
670 /*--------------------------------------------------------------------------*/
671 for (attr = qs_get_attr(doc,node);
673 attr = qs_get_next_attr(doc,attr)) {
674 char* name = qs_get_attr_name(doc,attr);
675 char* value = qs_get_attr_value(doc,attr);
676 if (STRCASEEQ('l','L',"lang", name)) {
681 else if (STRCASEEQ('v','V',"version", name)) {
682 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
691 * It is a handler who processes the HTML tag.
693 * @param pdoc [i/o] The pointer to the XHTML structure at the output
694 * destination is specified.
695 * @param node [i] The HTML tag node is specified.
696 * @return The conversion result is returned.
699 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
701 xhtml_t *xhtml = GET_XHTML(pdoc);
702 Doc *doc = xhtml->doc;
709 * It is a handler who processes the META tag.
711 * @param pdoc [i/o] The pointer to the XHTML structure at the output
712 * destination is specified.
713 * @param node [i] The META tag node is specified.
714 * @return The conversion result is returned.
717 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
719 xhtml_t *xhtml = GET_XHTML(pdoc);
721 Doc *doc = xhtml->doc;
722 int content_type_flag = 0;
725 /*--------------------------------------------------------------------------*/
727 /*--------------------------------------------------------------------------*/
728 for (attr = qs_get_attr(doc,node);
730 attr = qs_get_next_attr(doc,attr)) {
731 char *name = qs_get_attr_name(doc,attr);
732 char *value = qs_get_attr_value(doc,attr);
733 if (STRCASEEQ('n','N',"name", name) && value && *value) {
740 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
746 if (STRCASEEQ('c','C', "content-type", value)) {
747 content_type_flag = 1;
750 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
751 if (content_type_flag) {
755 W_L("text/html; charset=Windows-31J");
773 * It is a handler who processes the META tag.
775 * @param pdoc [i/o] The pointer to the XHTML structure at the output
776 * destination is specified.
777 * @param node [i] The META tag node is specified.
778 * @return The conversion result is returned.
781 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
783 xhtml_t *xhtml = GET_XHTML(pdoc);
790 * It is a handler who processes the HEAD tag.
792 * @param pdoc [i/o] The pointer to the XHTML structure at the output
793 * destination is specified.
794 * @param node [i] The HEAD tag node is specified.
795 * @return The conversion result is returned.
798 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
800 xhtml_t *xhtml = GET_XHTML(pdoc);
801 Doc *doc = xhtml->doc;
809 * It is a handler who processes the HEAD tag.
811 * @param pdoc [i/o] The pointer to the XHTML structure at the output
812 * destination is specified.
813 * @param node [i] The HEAD tag node is specified.
814 * @return The conversion result is returned.
817 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
819 xhtml_t *xhtml = GET_XHTML(pdoc);
820 Doc *doc = xhtml->doc;
828 * It is a handler who processes the TITLE tag.
830 * @param pdoc [i/o] The pointer to the XHTML structure at the output
831 * destination is specified.
832 * @param node [i] The TITLE tag node is specified.
833 * @return The conversion result is returned.
836 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
838 xhtml_t *xhtml = GET_XHTML(pdoc);
839 Doc *doc = xhtml->doc;
847 * It is a handler who processes the TITLE tag.
849 * @param pdoc [i/o] The pointer to the XHTML structure at the output
850 * destination is specified.
851 * @param node [i] The TITLE tag node is specified.
852 * @return The conversion result is returned.
855 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
857 xhtml_t *xhtml = GET_XHTML(pdoc);
858 Doc *doc = xhtml->doc;
866 * It is a handler who processes the BASE tag.
868 * @param pdoc [i/o] The pointer to the XHTML structure at the output
869 * destination is specified.
870 * @param node [i] The BASE tag node is specified.
871 * @return The conversion result is returned.
874 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
876 xhtml_t *xhtml = GET_XHTML(pdoc);
878 Doc *doc = xhtml->doc;
881 /*--------------------------------------------------------------------------*/
883 /*--------------------------------------------------------------------------*/
884 for (attr = qs_get_attr(doc,node);
886 attr = qs_get_next_attr(doc,attr)) {
887 char *name = qs_get_attr_name(doc,attr);
888 char *value = qs_get_attr_value(doc,attr);
889 if (STRCASEEQ('h','H',"href",name)) {
902 * It is a handler who processes the BASE tag.
904 * @param pdoc [i/o] The pointer to the XHTML structure at the output
905 * destination is specified.
906 * @param node [i] The BASE tag node is specified.
907 * @return The conversion result is returned.
910 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
912 xhtml_t *xhtml = GET_XHTML(pdoc);
919 * It is a handler who processes the BODY tag.
921 * @param pdoc [i/o] The pointer to the XHTML structure at the output
922 * destination is specified.
923 * @param node [i] The BODY tag node is specified.
924 * @return The conversion result is returned.
927 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
929 xhtml_t *xhtml = GET_XHTML(pdoc);
930 Doc *doc = xhtml->doc;
934 /*--------------------------------------------------------------------------*/
936 /*--------------------------------------------------------------------------*/
937 for (attr = qs_get_attr(doc,node);
939 attr = qs_get_next_attr(doc,attr)) {
940 char *name = qs_get_attr_name(doc,attr);
941 char *value = qs_get_attr_value(doc,attr);
942 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
947 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
952 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
957 else if (STRCASEEQ('a','A',"alink", name)) {
960 else if (STRCASEEQ('v','V',"vlink",name)) {
970 * It is a handler who processes the BODY tag.
972 * @param pdoc [i/o] The pointer to the XHTML structure at the output
973 * destination is specified.
974 * @param node [i] The BODY tag node is specified.
975 * @return The conversion result is returned.
978 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
980 xhtml_t *xhtml = GET_XHTML(pdoc);
981 Doc *doc = xhtml->doc;
989 * It is a handler who processes the A tag.
991 * @param pdoc [i/o] The pointer to the XHTML structure at the output
992 * destination is specified.
993 * @param node [i] The A tag node is specified.
994 * @return The conversion result is returned.
997 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
999 xhtml_t *xhtml = GET_XHTML(pdoc);
1000 Doc *doc = xhtml->doc;
1001 request_rec *r = doc->r;
1005 /*--------------------------------------------------------------------------*/
1006 /* Get Attributes */
1007 /*--------------------------------------------------------------------------*/
1008 for (attr = qs_get_attr(doc,node);
1010 attr = qs_get_next_attr(doc,attr)) {
1011 char* name = qs_get_attr_name(doc,attr);
1012 char* value = qs_get_attr_value(doc,attr);
1013 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1018 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1019 value = chxj_encoding_parameter(r, value);
1020 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1025 else if (STRCASEEQ('a','A',"accesskey", name)) {
1026 W_L(" accesskey=\"");
1030 else if (STRCASEEQ('c','C',"cti",name)) {
1033 else if (STRCASEEQ('i','I',"ijam", name)) {
1036 else if (STRCASEEQ('u','U',"utn", name)) {
1039 else if (STRCASEEQ('t','T',"telbook",name)) {
1042 else if (STRCASEEQ('k','K',"kana",name)) {
1045 else if (STRCASEEQ('e','E',"email",name)) {
1048 else if (STRCASEEQ('i','I',"ista",name)) {
1051 else if (STRCASEEQ('i','I',"ilet",name)) {
1054 else if (STRCASEEQ('i','I',"iswf",name)) {
1057 else if (STRCASEEQ('i','I',"irst",name)) {
1067 * It is a handler who processes the A tag.
1069 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1070 * destination is specified.
1071 * @param node [i] The A tag node is specified.
1072 * @return The conversion result is returned.
1075 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1077 xhtml_t *xhtml = GET_XHTML(pdoc);
1078 Doc *doc = xhtml->doc;
1086 * It is a handler who processes the BR tag.
1088 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1089 * destination is specified.
1090 * @param node [i] The BR tag node is specified.
1091 * @return The conversion result is returned.
1094 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1096 xhtml_t *xhtml = GET_XHTML(pdoc);
1097 Doc *doc = xhtml->doc;
1101 /*--------------------------------------------------------------------------*/
1102 /* Get Attributes */
1103 /*--------------------------------------------------------------------------*/
1104 for (attr = qs_get_attr(doc,node);
1106 attr = qs_get_next_attr(doc,attr)) {
1107 char *name = qs_get_attr_name(doc,attr);
1108 char *value = qs_get_attr_value(doc,attr);
1109 if (STRCASEEQ('c','C',"clear",name)) {
1110 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1123 * It is a handler who processes the BR tag.
1125 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1126 * destination is specified.
1127 * @param node [i] The BR tag node is specified.
1128 * @return The conversion result is returned.
1131 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1133 xhtml_t *xhtml = GET_XHTML(pdoc);
1140 * It is a handler who processes the TR tag.
1142 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1143 * destination is specified.
1144 * @param node [i] The TR tag node is specified.
1145 * @return The conversion result is returned.
1148 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1150 xhtml_t *xhtml = GET_XHTML(pdoc);
1151 Doc *doc = xhtml->doc;
1159 * It is a handler who processes the TR tag.
1161 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1162 * destination is specified.
1163 * @param node [i] The TR tag node is specified.
1164 * @return The conversion result is returned.
1167 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1169 xhtml_t *xhtml = GET_XHTML(pdoc);
1176 * It is a handler who processes the FONT tag.
1178 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1179 * destination is specified.
1180 * @param node [i] The FONT tag node is specified.
1181 * @return The conversion result is returned.
1184 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1186 xhtml_t *xhtml = GET_XHTML(pdoc);
1187 Doc *doc = xhtml->doc;
1191 /*=========================================================================*/
1192 /* Get Attributes */
1193 /*=========================================================================*/
1194 for (attr = qs_get_attr(doc,node);
1196 attr = qs_get_next_attr(doc,attr)) {
1197 char *name = qs_get_attr_name(doc,attr);
1198 char *value = qs_get_attr_value(doc,attr);
1199 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1204 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1216 * It is a handler who processes the FONT tag.
1218 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1219 * destination is specified.
1220 * @param node [i] The FONT tag node is specified.
1221 * @return The conversion result is returned.
1224 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1226 xhtml_t *xhtml = GET_XHTML(pdoc);
1227 Doc *doc = xhtml->doc;
1235 * It is a handler who processes the FORM tag.
1237 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1238 * destination is specified.
1239 * @param node [i] The FORM tag node is specified.
1240 * @return The conversion result is returned.
1243 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1245 xhtml_t *xhtml = GET_XHTML(pdoc);
1246 Doc *doc = xhtml->doc;
1247 request_rec *r = doc->r;
1251 /*--------------------------------------------------------------------------*/
1252 /* Get Attributes */
1253 /*--------------------------------------------------------------------------*/
1254 for (attr = qs_get_attr(doc,node);
1256 attr = qs_get_next_attr(doc,attr)) {
1257 char *name = qs_get_attr_name(doc,attr);
1258 char *value = qs_get_attr_value(doc,attr);
1259 if (STRCASEEQ('a','A',"action",name)) {
1260 value = chxj_encoding_parameter(r, value);
1261 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
1266 else if (STRCASEEQ('m','M',"method",name)) {
1271 else if (STRCASEEQ('u','U',"utn",name)) {
1274 else if (STRCASEEQ('n','N',"name",name)) {
1286 * It is a handler who processes the FORM tag.
1288 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1289 * destination is specified.
1290 * @param node [i] The FORM tag node is specified.
1291 * @return The conversion result is returned.
1294 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1296 xhtml_t *xhtml = GET_XHTML(pdoc);
1297 Doc *doc = xhtml->doc;
1305 * It is a handler who processes the INPUT tag.
1307 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1308 * destination is specified.
1309 * @param node [i] The INPUT tag node is specified.
1310 * @return The conversion result is returned.
1313 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1315 xhtml_t *xhtml = GET_XHTML(pdoc);
1316 Doc *doc = xhtml->doc;
1317 request_rec *r = doc->r;
1318 char *max_length = NULL;
1322 char *istyle = NULL;
1324 char *checked = NULL;
1325 char *accesskey = NULL;
1328 /*--------------------------------------------------------------------------*/
1329 /* Get Attributes */
1330 /*--------------------------------------------------------------------------*/
1331 type = qs_get_type_attr(doc, node, r);
1332 name = qs_get_name_attr(doc, node, r);
1333 value = qs_get_value_attr(doc,node,r);
1334 istyle = qs_get_istyle_attr(doc,node,r);
1335 max_length = qs_get_maxlength_attr(doc,node,r);
1336 checked = qs_get_checked_attr(doc,node,r);
1337 accesskey = qs_get_accesskey_attr(doc, node, r);
1338 size = qs_get_size_attr(doc, node, r);
1341 type = qs_trim_string(doc->buf.pool, type);
1342 if (type && (STRCASEEQ('t','T',"text", type) ||
1343 STRCASEEQ('p','P',"password",type) ||
1344 STRCASEEQ('c','C',"checkbox",type) ||
1345 STRCASEEQ('r','R',"radio", type) ||
1346 STRCASEEQ('h','H',"hidden", type) ||
1347 STRCASEEQ('s','S',"submit", type) ||
1348 STRCASEEQ('r','R',"reset", type))) {
1354 if (size && *size) {
1359 if (name && *name) {
1364 if (value && *value) {
1366 W_V(chxj_add_slash_to_doublequote(doc->pool,value));
1369 if (accesskey && *accesskey) {
1370 W_L(" accesskey=\"");
1374 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1375 char *fmt = qs_conv_istyle_to_format(r,istyle);
1376 if (max_length && *max_length) {
1378 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1379 if (max_length[ii] < '0' || max_length[ii] > '9') {
1380 max_length = apr_psprintf(r->pool, "0");
1385 if (strcmp(max_length, "0")) {
1386 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1398 if (max_length && *max_length) {
1399 if (chxj_chk_numeric(max_length) != 0) {
1400 max_length = apr_psprintf(r->pool, "0");
1402 if (strcmp(max_length, "0")) {
1403 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1408 /*--------------------------------------------------------------------------*/
1409 /* The figure is default for the password. */
1410 /*--------------------------------------------------------------------------*/
1411 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1418 W_L(" FORMAT=\"*N\"");
1422 W_L(" checked=\"checked\"");
1430 * It is a handler who processes the INPUT tag.
1432 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1433 * destination is specified.
1434 * @param node [i] The INPUT tag node is specified.
1435 * @return The conversion result is returned.
1438 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1440 xhtml_t *xhtml = GET_XHTML(pdoc);
1447 * It is a handler who processes the CENTER tag.
1449 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1450 * destination is specified.
1451 * @param node [i] The CENTER tag node is specified.
1452 * @return The conversion result is returned.
1455 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1457 xhtml_t *xhtml = GET_XHTML(pdoc);
1458 Doc *doc = xhtml->doc;
1466 * It is a handler who processes the CENTER tag.
1468 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1469 * destination is specified.
1470 * @param node [i] The CENTER tag node is specified.
1471 * @return The conversion result is returned.
1474 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1476 xhtml_t *xhtml = GET_XHTML(pdoc);
1477 Doc *doc = xhtml->doc;
1485 * It is a handler who processes the HR tag.
1487 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1488 * destination is specified.
1489 * @param node [i] The HR tag node is specified.
1490 * @return The conversion result is returned.
1493 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1495 xhtml_t *xhtml = GET_XHTML(pdoc);
1496 Doc *doc = xhtml->doc;
1501 for (attr = qs_get_attr(doc,node);
1503 attr = qs_get_next_attr(doc,attr)) {
1504 char *name = qs_get_attr_name(doc,attr);
1505 char *value = qs_get_attr_value(doc,attr);
1506 if (STRCASEEQ('a','A',"align", name)) {
1507 /*----------------------------------------------------------------------*/
1509 /*----------------------------------------------------------------------*/
1510 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1516 else if (STRCASEEQ('s','S',"size", name)) {
1517 /*----------------------------------------------------------------------*/
1519 /*----------------------------------------------------------------------*/
1520 if (value && *value) {
1526 else if (STRCASEEQ('w','W',"width", name)) {
1527 /*----------------------------------------------------------------------*/
1529 /*----------------------------------------------------------------------*/
1530 if (value && *value) {
1536 else if (STRCASEEQ('n','N',"noshade", name)) {
1537 /*----------------------------------------------------------------------*/
1539 /*----------------------------------------------------------------------*/
1542 else if (STRCASEEQ('c','C',"color", name)) {
1543 /*----------------------------------------------------------------------*/
1545 /*----------------------------------------------------------------------*/
1555 * It is a handler who processes the HR tag.
1557 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1558 * destination is specified.
1559 * @param node [i] The HR tag node is specified.
1560 * @return The conversion result is returned.
1563 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1565 xhtml_t *xhtml = GET_XHTML(pdoc);
1572 * It is a handler who processes the PRE tag.
1574 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1575 * destination is specified.
1576 * @param node [i] The PRE tag node is specified.
1577 * @return The conversion result is returned.
1580 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1582 xhtml_t *xhtml = GET_XHTML(pdoc);
1583 Doc *doc = xhtml->doc;
1592 * It is a handler who processes the PRE tag.
1594 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1595 * destination is specified.
1596 * @param node [i] The PRE tag node is specified.
1597 * @return The conversion result is returned.
1600 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1602 xhtml_t *xhtml = GET_XHTML(pdoc);
1603 Doc *doc = xhtml->doc;
1613 * It is a handler who processes the P tag.
1615 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1616 * destination is specified.
1617 * @param node [i] The P tag node is specified.
1618 * @return The conversion result is returned.
1621 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1623 xhtml_t *xhtml = GET_XHTML(pdoc);
1624 Doc *doc = xhtml->doc;
1629 for (attr = qs_get_attr(doc,node);
1631 attr = qs_get_next_attr(doc,attr)) {
1632 char *nm = qs_get_attr_name(doc,attr);
1633 char *val = qs_get_attr_value(doc,attr);
1634 if (STRCASEEQ('a','A',"align", nm)) {
1635 /*----------------------------------------------------------------------*/
1636 /* CHTML 1.0 (W3C version 3.2) */
1637 /*----------------------------------------------------------------------*/
1638 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1639 align = apr_pstrdup(doc->buf.pool, val);
1655 * It is a handler who processes the P tag.
1657 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1658 * destination is specified.
1659 * @param node [i] The P tag node is specified.
1660 * @return The conversion result is returned.
1663 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1665 xhtml_t *xhtml = GET_XHTML(pdoc);
1666 Doc *doc = xhtml->doc;
1674 * It is a handler who processes the UL tag.
1676 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1677 * destination is specified.
1678 * @param node [i] The UL tag node is specified.
1679 * @return The conversion result is returned.
1682 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *UNUSED(node))
1684 xhtml_t *xhtml = GET_XHTML(pdoc);
1685 Doc *doc = xhtml->doc;
1693 * It is a handler who processes the UL tag.
1695 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1696 * destination is specified.
1697 * @param node [i] The UL tag node is specified.
1698 * @return The conversion result is returned.
1701 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1703 xhtml_t *xhtml = GET_XHTML(pdoc);
1704 Doc *doc = xhtml->doc;
1712 * It is a handler who processes the H1 tag.
1714 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1715 * destination is specified.
1716 * @param node [i] The H1 tag node is specified.
1717 * @return The conversion result is returned.
1720 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1722 xhtml_t *xhtml = GET_XHTML(pdoc);
1723 Doc *doc = xhtml->doc;
1727 for (attr = qs_get_attr(doc,node);
1729 attr = qs_get_next_attr(doc,attr)) {
1732 name = qs_get_attr_name(doc,attr);
1733 value = qs_get_attr_value(doc,attr);
1734 if (STRCASEEQ('a','A',"align", name)) {
1736 if (STRCASEEQ('l','L',"left",value)) {
1738 W_L("text-align:left");
1741 else if (STRCASEEQ('r','R',"right",value)) {
1743 W_L("text-align:right");
1746 else if (STRCASEEQ('c','C',"center",value)) {
1748 W_L("text-align:center");
1761 * It is a handler who processes the H1 tag.
1763 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1764 * destination is specified.
1765 * @param node [i] The H1 tag node is specified.
1766 * @return The conversion result is returned.
1769 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1771 xhtml_t *xhtml = GET_XHTML(pdoc);
1772 Doc *doc = xhtml->doc;
1780 * It is a handler who processes the H2 tag.
1782 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1783 * destination is specified.
1784 * @param node [i] The H2 tag node is specified.
1785 * @return The conversion result is returned.
1788 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1790 xhtml_t *xhtml = GET_XHTML(pdoc);
1791 Doc *doc = xhtml->doc;
1795 for (attr = qs_get_attr(doc,node);
1797 attr = qs_get_next_attr(doc,attr)) {
1800 name = qs_get_attr_name(doc,attr);
1801 value = qs_get_attr_value(doc,attr);
1802 if (STRCASEEQ('a','A',"align", name)) {
1804 if (STRCASEEQ('l','L',"left",value)) {
1806 W_L("text-align:left");
1809 else if (STRCASEEQ('r','R',"right",value)) {
1811 W_L("text-align:right");
1814 else if (STRCASEEQ('c','C',"center",value)) {
1816 W_L("text-align:center");
1829 * It is a handler who processes the H2 tag.
1831 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1832 * destination is specified.
1833 * @param node [i] The H2 tag node is specified.
1834 * @return The conversion result is returned.
1837 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1839 xhtml_t *xhtml = GET_XHTML(pdoc);
1840 Doc *doc = xhtml->doc;
1848 * It is a handler who processes the H3 tag.
1850 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1851 * destination is specified.
1852 * @param node [i] The H3 tag node is specified.
1853 * @return The conversion result is returned.
1856 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1858 xhtml_t *xhtml = GET_XHTML(pdoc);
1859 Doc *doc = xhtml->doc;
1863 for (attr = qs_get_attr(doc,node);
1865 attr = qs_get_next_attr(doc,attr)) {
1868 name = qs_get_attr_name(doc,attr);
1869 value = qs_get_attr_value(doc,attr);
1870 if (STRCASEEQ('a','A',"align", name)) {
1872 if (STRCASEEQ('l','L',"left",value)) {
1874 W_L("text-align:left");
1877 else if (STRCASEEQ('r','R',"right",value)) {
1879 W_L("text-align:right");
1882 else if (STRCASEEQ('c','C',"center",value)) {
1884 W_L("text-align:center");
1897 * It is a handler who processes the H3 tag.
1899 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1900 * destination is specified.
1901 * @param node [i] The H3 tag node is specified.
1902 * @return The conversion result is returned.
1905 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
1907 xhtml_t *xhtml = GET_XHTML(pdoc);
1908 Doc *doc = xhtml->doc;
1916 * It is a handler who processes the H4 tag.
1918 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1919 * destination is specified.
1920 * @param node [i] The H4 tag node is specified.
1921 * @return The conversion result is returned.
1924 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
1926 xhtml_t *xhtml = GET_XHTML(pdoc);
1927 Doc *doc = xhtml->doc;
1931 for (attr = qs_get_attr(doc,node);
1933 attr = qs_get_next_attr(doc,attr)) {
1936 name = qs_get_attr_name(doc,attr);
1937 value = qs_get_attr_value(doc,attr);
1938 if (STRCASEEQ('a','A',"align", name)) {
1940 if (STRCASEEQ('l','L',"left",value)) {
1942 W_L("text-align:left");
1945 else if (STRCASEEQ('r','R',"right",value)) {
1947 W_L("text-align:right");
1950 else if (STRCASEEQ('c','C',"center",value)) {
1952 W_L("text-align:center");
1965 * It is a handler who processes the H4 tag.
1967 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1968 * destination is specified.
1969 * @param node [i] The H4 tag node is specified.
1970 * @return The conversion result is returned.
1973 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
1975 xhtml_t *xhtml = GET_XHTML(pdoc);
1976 Doc *doc = xhtml->doc;
1984 * It is a handler who processes the H5 tag.
1986 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1987 * destination is specified.
1988 * @param node [i] The H5 tag node is specified.
1989 * @return The conversion result is returned.
1992 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
1994 xhtml_t *xhtml = GET_XHTML(pdoc);
1995 Doc *doc = xhtml->doc;
1999 for (attr = qs_get_attr(doc,node);
2001 attr = qs_get_next_attr(doc,attr)) {
2004 name = qs_get_attr_name(doc,attr);
2005 value = qs_get_attr_value(doc,attr);
2006 if (STRCASEEQ('a','A',"align", name)) {
2008 if (STRCASEEQ('l','L',"left",value)) {
2010 W_L("text-align:left");
2013 else if (STRCASEEQ('r','R',"right",value)) {
2015 W_L("text-align:right");
2018 else if (STRCASEEQ('c','C',"center",value)) {
2020 W_L("text-align:center");
2033 * It is a handler who processes the H5 tag.
2035 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2036 * destination is specified.
2037 * @param node [i] The H5 tag node is specified.
2038 * @return The conversion result is returned.
2041 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2043 xhtml_t *xhtml = GET_XHTML(pdoc);
2044 Doc *doc = xhtml->doc;
2052 * It is a handler who processes the H6 tag.
2054 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2055 * destination is specified.
2056 * @param node [i] The H6 tag node is specified.
2057 * @return The conversion result is returned.
2060 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2062 xhtml_t *xhtml = GET_XHTML(pdoc);
2063 Doc *doc = xhtml->doc;
2067 for (attr = qs_get_attr(doc,node);
2069 attr = qs_get_next_attr(doc,attr)) {
2072 name = qs_get_attr_name(doc,attr);
2073 value = qs_get_attr_value(doc,attr);
2074 if (STRCASEEQ('a','A',"align", name)) {
2076 if (STRCASEEQ('l','L',"left",value)) {
2078 W_L("text-align:left");
2081 else if (STRCASEEQ('r','R',"right",value)) {
2083 W_L("text-align:right");
2086 else if (STRCASEEQ('c','C',"center",value)) {
2088 W_L("text-align:center");
2101 * It is a handler who processes the H6 tag.
2103 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2104 * destination is specified.
2105 * @param node [i] The H6 tag node is specified.
2106 * @return The conversion result is returned.
2109 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2111 xhtml_t *xhtml = GET_XHTML(pdoc);
2112 Doc *doc = xhtml->doc;
2120 * It is a handler who processes the OL tag.
2122 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2123 * destination is specified.
2124 * @param node [i] The OL tag node is specified.
2125 * @return The conversion result is returned.
2128 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2130 xhtml_t *xhtml = GET_XHTML(pdoc);
2131 Doc *doc = xhtml->doc;
2135 /*--------------------------------------------------------------------------*/
2136 /* Get Attributes */
2137 /*--------------------------------------------------------------------------*/
2138 for (attr = qs_get_attr(doc,node);
2140 attr = qs_get_next_attr(doc,attr)) {
2141 char *name = qs_get_attr_name(doc,attr);
2142 char *value = qs_get_attr_value(doc,attr);
2143 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2148 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2160 * It is a handler who processes the OL tag.
2162 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2163 * destination is specified.
2164 * @param node [i] The OL tag node is specified.
2165 * @return The conversion result is returned.
2168 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2170 xhtml_t *xhtml = GET_XHTML(pdoc);
2171 Doc *doc = xhtml->doc;
2179 * It is a handler who processes the LI tag.
2181 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2182 * destination is specified.
2183 * @param node [i] The LI tag node is specified.
2184 * @return The conversion result is returned.
2187 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2189 xhtml_t *xhtml = GET_XHTML(pdoc);
2190 Doc *doc = xhtml->doc;
2194 /*--------------------------------------------------------------------------*/
2195 /* Get Attributes */
2196 /*--------------------------------------------------------------------------*/
2197 for (attr = qs_get_attr(doc,node);
2199 attr = qs_get_next_attr(doc,attr)) {
2200 char *name = qs_get_attr_name(doc,attr);
2201 char *value = qs_get_attr_value(doc,attr);
2202 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2207 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2219 ** It is a handler who processes the LI tag.
2221 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2222 * destination is specified.
2223 * @param node [i] The LI tag node is specified.
2224 * @return The conversion result is returned.
2227 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2229 xhtml_t *xhtml = GET_XHTML(pdoc);
2230 Doc *doc = xhtml->doc;
2237 * It is a handler who processes the IMG tag.
2239 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2240 * destination is specified.
2241 * @param node [i] The IMG tag node is specified.
2242 * @return The conversion result is returned.
2245 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2247 xhtml_t *xhtml = GET_XHTML(pdoc);
2248 Doc *doc = xhtml->doc;
2249 request_rec *r = doc->r;
2252 #ifndef IMG_NOT_CONVERT_FILENAME
2253 device_table *spec = xhtml->spec;
2257 /*--------------------------------------------------------------------------*/
2258 /* Get Attributes */
2259 /*--------------------------------------------------------------------------*/
2260 for (attr = qs_get_attr(doc,node);
2262 attr = qs_get_next_attr(doc,attr)) {
2263 char *name = qs_get_attr_name(doc,attr);
2264 char *value = qs_get_attr_value(doc,attr);
2266 if (STRCASEEQ('s','S',"src",name)) {
2267 value = chxj_encoding_parameter(r, value);
2268 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2270 value = apr_psprintf(r->pool,
2273 (strchr(value, '?')) ? '&' : '?',
2274 CHXJ_COOKIE_NOUPDATE_PARAM);
2276 #ifdef IMG_NOT_CONVERT_FILENAME
2286 char *vv = chxj_img_conv(r,spec,value);
2294 if (STRCASEEQ('a','A',"align",name)) {
2295 if (value && (STRCASEEQ('t','T',"top", value) ||
2296 STRCASEEQ('m','M',"middle",value) ||
2297 STRCASEEQ('b','B',"bottom",value) ||
2298 STRCASEEQ('l','L',"left", value) ||
2299 STRCASEEQ('r','R',"right", value))) {
2305 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2310 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2315 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2320 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2325 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2337 * It is a handler who processes the IMG tag.
2339 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2340 * destination is specified.
2341 * @param node [i] The IMG tag node is specified.
2342 * @return The conversion result is returned.
2345 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2347 xhtml_t *xhtml = GET_XHTML(pdoc);
2354 * It is a handler who processes the SELECT tag.
2356 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2357 * destination is specified.
2358 * @param node [i] The SELECT tag node is specified.
2359 * @return The conversion result is returned.
2362 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2364 xhtml_t *xhtml = GET_XHTML(pdoc);
2365 Doc *doc = xhtml->doc;
2368 char *multiple = NULL;
2373 for (attr = qs_get_attr(doc,child);
2375 attr = qs_get_next_attr(doc,attr)) {
2376 char *nm = qs_get_attr_name(doc,attr);
2377 char *val = qs_get_attr_value(doc,attr);
2378 if (STRCASEEQ('s','S',"size",nm)) {
2379 /*----------------------------------------------------------------------*/
2380 /* CHTML 1.0 version 2.0 */
2381 /*----------------------------------------------------------------------*/
2382 size = apr_pstrdup(doc->buf.pool, val);
2384 else if (STRCASEEQ('n','N',"name",nm)) {
2385 /*----------------------------------------------------------------------*/
2386 /* CHTML 1.0 version 2.0 */
2387 /*----------------------------------------------------------------------*/
2388 name = apr_pstrdup(doc->buf.pool, val);
2390 else if (STRCASEEQ('m','M',"multiple",nm)) {
2391 /*----------------------------------------------------------------------*/
2392 /* CHTML 1.0 version 2.0 */
2393 /*----------------------------------------------------------------------*/
2394 multiple = apr_pstrdup(doc->buf.pool, val);
2397 if (size && *size) {
2402 if (name && *name) {
2408 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2409 W_L(" multiple=\"true\"");
2417 * It is a handler who processes the SELECT tag.
2419 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2420 * destination is specified.
2421 * @param node [i] The SELECT tag node is specified.
2422 * @return The conversion result is returned.
2425 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2427 xhtml_t *xhtml = GET_XHTML(pdoc);
2428 Doc *doc = xhtml->doc;
2430 W_L("</select>\r\n");
2436 * It is a handler who processes the OPTION tag.
2438 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2439 * destination is specified.
2440 * @param node [i] The OPTION tag node is specified.
2441 * @return The conversion result is returned.
2444 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2446 xhtml_t *xhtml = GET_XHTML(pdoc);
2447 Doc *doc = xhtml->doc;
2450 char *selected = NULL;
2454 for (attr = qs_get_attr(doc,child);
2456 attr = qs_get_next_attr(doc,attr)) {
2457 char *nm = qs_get_attr_name(doc,attr);
2458 char *val = qs_get_attr_value(doc,attr);
2459 if (STRCASEEQ('s','S',"selected",nm)) {
2460 /* CHTML version 2.0 */
2461 selected = apr_pstrdup(doc->buf.pool, val);
2463 else if (STRCASEEQ('v','V',"value",nm)) {
2464 /* CHTML version 2.0 */
2465 value = apr_pstrdup(doc->buf.pool, val);
2468 if (value && *value) {
2474 W_L(" selected=\"selected\"");
2482 * It is a handler who processes the OPTION tag.
2484 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2485 * destination is specified.
2486 * @param node [i] The OPTION tag node is specified.
2487 * @return The conversion result is returned.
2490 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2492 xhtml_t *xhtml = GET_XHTML(pdoc);
2493 Doc *doc = xhtml->doc;
2495 W_L("</option>\r\n");
2501 * It is a handler who processes the DIV tag.
2503 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2504 * destination is specified.
2505 * @param node [i] The DIV tag node is specified.
2506 * @return The conversion result is returned.
2509 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2511 xhtml_t *xhtml = GET_XHTML(pdoc);
2512 Doc *doc = xhtml->doc;
2517 for (attr = qs_get_attr(doc,child);
2519 attr = qs_get_next_attr(doc,attr)) {
2520 char *nm = qs_get_attr_name(doc,attr);
2521 char *val = qs_get_attr_value(doc,attr);
2522 if (STRCASEEQ('a','A',"align",nm)) {
2523 /*=====================================================================*/
2524 /* CHTML version 3.2 */
2525 /*=====================================================================*/
2526 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2527 align = apr_pstrdup(doc->buf.pool, val);
2542 * It is a handler who processes the DIV tag.
2544 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2545 * destination is specified.
2546 * @param node [i] The DIV tag node is specified.
2547 * @return The conversion result is returned.
2550 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2552 xhtml_t *xhtml = GET_XHTML(pdoc);
2553 Doc *doc = xhtml->doc;
2560 * It is a handler who processes the B tag.
2562 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2563 * destination is specified.
2564 * @param node [i] The B tag node is specified.
2565 * @return The conversion result is returned.
2568 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2570 xhtml_t *xhtml = GET_XHTML(pdoc);
2571 Doc *doc = xhtml->doc;
2573 W_L("<div style=\"font-weight:bold\">");
2579 * It is a handler who processes the B tag.
2581 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2582 * destination is specified.
2583 * @param node [i] The B tag node is specified.
2584 * @return The conversion result is returned.
2587 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2589 xhtml_t *xhtml = GET_XHTML(pdoc);
2590 Doc *doc = xhtml->doc;
2598 * It is a handler who processes the CHXJ:IF tag.
2600 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2601 * destination is specified.
2602 * @param node [i] The CHXJ:IF tag node is specified.
2605 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2607 xhtml_t *xhtml = GET_XHTML(pdoc);
2608 Doc *doc = xhtml->doc;
2611 for (child = qs_get_child_node(doc, node);
2613 child = qs_get_next_node(doc, child)) {
2615 s_xhtml_1_0_chxjif_tag(xhtml, child);
2623 * It is a handler who processes the TEXTARE tag.
2625 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2626 * destination is specified.
2627 * @param node [i] The TEXTAREA tag node is specified.
2628 * @return The conversion result is returned.
2631 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2633 xhtml_t *xhtml = GET_XHTML(pdoc);
2634 Doc *doc = xhtml->doc;
2637 xhtml->textarea_flag++;
2639 for (attr = qs_get_attr(doc,node);
2641 attr = qs_get_next_attr(doc,attr)) {
2642 char *name = qs_get_attr_name(doc,attr);
2643 char *value = qs_get_attr_value(doc,attr);
2644 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2649 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2654 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2659 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2660 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2665 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2666 W_L(" accesskey=\"");
2677 * It is a handler who processes the TEXTAREA tag.
2679 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2680 * destination is specified.
2681 * @param node [i] The TEXTAREA tag node is specified.
2682 * @return The conversion result is returned.
2685 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2687 xhtml_t *xhtml = GET_XHTML(pdoc);
2688 Doc *doc = xhtml->doc;
2690 W_L("</textarea>\r\n");
2691 xhtml->textarea_flag--;
2697 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2699 xhtml_t *xhtml = GET_XHTML(pdoc);
2700 Doc *doc = xhtml->doc;
2701 request_rec *r = doc->r;
2709 textval = qs_get_node_value(doc,child);
2710 if (strlen(textval) == 0) {
2714 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2715 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2717 tdst = qs_alloc_zero_byte_string(r);
2718 memset(one_byte, 0, sizeof(one_byte));
2721 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2723 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2725 DBG(r,"[%s][%d]", out, rtn);
2726 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2730 if (is_sjis_kanji(textval[ii])) {
2731 one_byte[0] = textval[ii+0];
2732 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2733 one_byte[0] = textval[ii+1];
2734 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2737 else if (xhtml->pre_flag) {
2738 one_byte[0] = textval[ii+0];
2739 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2741 else if (xhtml->textarea_flag) {
2742 one_byte[0] = textval[ii+0];
2743 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2745 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2746 one_byte[0] = textval[ii+0];
2747 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2756 * It is a handler who processes the BLOCKQUOTE tag.
2758 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2759 * destination is specified.
2760 * @param node [i] The BLOCKQUOTE tag node is specified.
2761 * @return The conversion result is returned.
2764 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2766 xhtml_t *xhtml = GET_XHTML(pdoc);
2767 Doc *doc = xhtml->doc;
2768 W_L("<blockquote>");
2774 * It is a handler who processes the BLOCKQUOTE tag.
2776 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2777 * destination is specified.
2778 * @param node [i] The BLOCKQUOTE tag node is specified.
2779 * @return The conversion result is returned.
2782 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2784 xhtml_t *xhtml = GET_XHTML(pdoc);
2785 Doc *doc = xhtml->doc;
2786 W_L("</blockquote>");
2792 * It is a handler who processes the DIR tag.
2794 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2795 * destination is specified.
2796 * @param node [i] The DIR tag node is specified.
2797 * @return The conversion result is returned.
2800 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *UNUSED(child))
2802 xhtml_t *xhtml = GET_XHTML(pdoc);
2803 Doc *doc = xhtml->doc;
2810 * It is a handler who processes the DIR tag.
2812 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2813 * destination is specified.
2814 * @param node [i] The DIR tag node is specified.
2815 * @return The conversion result is returned.
2818 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2820 xhtml_t *xhtml = GET_XHTML(pdoc);
2821 Doc *doc = xhtml->doc;
2828 * It is a handler who processes the DL tag.
2830 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2831 * destination is specified.
2832 * @param node [i] The DL tag node is specified.
2833 * @return The conversion result is returned.
2836 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2838 xhtml_t *xhtml = GET_XHTML(pdoc);
2839 Doc *doc = xhtml->doc;
2846 * It is a handler who processes the DL tag.
2848 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2849 * destination is specified.
2850 * @param node [i] The DL tag node is specified.
2851 * @return The conversion result is returned.
2854 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2856 xhtml_t *xhtml = GET_XHTML(pdoc);
2857 Doc *doc = xhtml->doc;
2864 * It is a handter who processes the DT tag.
2866 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2867 * destination is specified.
2868 * @param node [i] The DT tag node is specified.
2869 * @return The conversion result is returned.
2872 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
2874 xhtml_t *xhtml = GET_XHTML(pdoc);
2875 Doc *doc = xhtml->doc;
2882 * It is a handter who processes the DT tag.
2884 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2885 * destination is specified.
2886 * @param node [i] The DT tag node is specified.
2887 * @return The conversion result is returned.
2890 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
2892 xhtml_t *xhtml = GET_XHTML(pdoc);
2893 Doc *doc = xhtml->doc;
2900 * It is a handder who processes the DD tag.
2902 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2903 * destination is specified.
2904 * @param node [i] The DD tag node is specified.
2905 * @return The conversion result is returned.
2908 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
2910 xhtml_t *xhtml = GET_XHTML(pdoc);
2911 Doc *doc = xhtml->doc;
2918 * It is a handder who processes the DD tag.
2920 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2921 * destination is specified.
2922 * @param node [i] The DD tag node is specified.
2923 * @return The conversion result is returned.
2926 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
2928 xhtml_t *xhtml = GET_XHTML(pdoc);
2929 Doc *doc = xhtml->doc;
2936 * It is a handler who processes the MENU tag.
2938 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2939 * destination is specified.
2940 * @param node [i] The MENU tag node is specified.
2941 * @return The conversion result is returned.
2944 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *UNUSED(child))
2948 xhtml = GET_XHTML(pdoc);
2956 * It is a hanmenuer who processes the MENU tag.
2958 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2959 * destination is specified.
2960 * @param node [i] The MENU tag node is specified.
2961 * @return The conversion result is returned.
2964 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
2966 xhtml_t *xhtml = GET_XHTML(pdoc);
2967 Doc *doc = xhtml->doc;
2974 * It is a handler who processes the PLAINTEXT tag.
2976 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2977 * destination is specified.
2978 * @param node [i] The PLAINTEXT tag node is specified.
2979 * @return The conversion result is returned.
2982 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
2984 xhtml_t *xhtml = GET_XHTML(pdoc);
2985 Doc *doc = xhtml->doc;
2987 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
2992 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
2994 xhtml_t *xhtml = GET_XHTML(pdoc);
2995 Doc *doc = xhtml->doc;
2997 for (child = qs_get_child_node(doc, node);
2999 child = qs_get_next_node(doc, child)) {
3001 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3008 * It is a handler who processes the PLAINTEXT tag.
3010 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3011 * destination is specified.
3012 * @param node [i] The PLAINTEXT tag node is specified.
3013 * @return The conversion result is returned.
3016 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3018 xhtml_t *xhtml = GET_XHTML(pdoc);
3019 Doc *doc = xhtml->doc;
3020 W_L("</plaintext>");
3026 * It is a hanblinker who processes the BLINK tag.
3028 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3029 * destination is specified.
3030 * @param node [i] The BLINK tag node is specified.
3031 * @return The conversion result is returned.
3034 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3036 xhtml_t *xhtml = GET_XHTML(pdoc);
3037 Doc *doc = xhtml->doc;
3044 * It is a hanblinker who processes the BLINK tag.
3046 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3047 * destination is specified.
3048 * @param node [i] The BLINK tag node is specified.
3049 * @return The conversion result is returned.
3052 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3054 xhtml_t *xhtml = GET_XHTML(pdoc);
3055 Doc *doc = xhtml->doc;
3062 * It is a handler who processes the MARQUEE tag.
3064 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3065 * destination is specified.
3066 * @param node [i] The MARQUEE tag node is specified.
3067 * @return The conversion result is returned.
3070 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3072 xhtml_t *xhtml = GET_XHTML(pdoc);
3073 Doc *doc = xhtml->doc;
3076 /*--------------------------------------------------------------------------*/
3077 /* Get Attributes */
3078 /*--------------------------------------------------------------------------*/
3079 for (attr = qs_get_attr(doc,node);
3081 attr = qs_get_next_attr(doc,attr)) {
3082 char *name = qs_get_attr_name(doc,attr);
3083 char *value = qs_get_attr_value(doc,attr);
3084 if (STRCASEEQ('d','D',"direction", name)) {
3085 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3086 W_L(" direction=\"");
3091 else if (STRCASEEQ('b','B',"behavior",name)) {
3092 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3093 W_L(" behavior=\"");
3098 else if (STRCASEEQ('l','L',"loop",name)) {
3099 if (value && *value) {
3112 * It is a handler who processes the MARQUEE tag.
3114 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3115 * destination is specified.
3116 * @param node [i] The MARQUEE tag node is specified.
3117 * @return The conversion result is returned.
3120 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3122 xhtml_t *xhtml = GET_XHTML(pdoc);
3123 Doc *doc = xhtml->doc;