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;
1249 char *new_hidden_tag = NULL;
1250 char *attr_action = NULL;
1251 char *attr_method = NULL;
1252 char *attr_name = NULL;
1254 /*--------------------------------------------------------------------------*/
1255 /* Get Attributes */
1256 /*--------------------------------------------------------------------------*/
1257 for (attr = qs_get_attr(doc,node);
1259 attr = qs_get_next_attr(doc,attr)) {
1260 char *name = qs_get_attr_name(doc,attr);
1261 char *value = qs_get_attr_value(doc,attr);
1262 if (STRCASEEQ('a','A',"action",name)) {
1263 attr_action = chxj_encoding_parameter(r, value);
1264 attr_action = chxj_add_cookie_parameter(r, attr_action, xhtml->cookie);
1266 else if (STRCASEEQ('m','M',"method",name)) {
1267 attr_method = apr_pstrdup(doc->pool, value);
1269 else if (STRCASEEQ('u','U',"utn",name)) {
1272 else if (STRCASEEQ('n','N',"name",name)) {
1273 attr_name = apr_pstrdup(doc->pool, value);
1277 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1282 q = strchr(attr_action, '?');
1284 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
1285 if (new_hidden_tag) {
1304 if (new_hidden_tag) {
1305 W_V(new_hidden_tag);
1312 * It is a handler who processes the FORM tag.
1314 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1315 * destination is specified.
1316 * @param node [i] The FORM tag node is specified.
1317 * @return The conversion result is returned.
1320 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1322 xhtml_t *xhtml = GET_XHTML(pdoc);
1323 Doc *doc = xhtml->doc;
1331 * It is a handler who processes the INPUT tag.
1333 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1334 * destination is specified.
1335 * @param node [i] The INPUT tag node is specified.
1336 * @return The conversion result is returned.
1339 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1341 xhtml_t *xhtml = GET_XHTML(pdoc);
1342 Doc *doc = xhtml->doc;
1343 request_rec *r = doc->r;
1344 char *max_length = NULL;
1348 char *istyle = NULL;
1350 char *checked = NULL;
1351 char *accesskey = NULL;
1354 /*--------------------------------------------------------------------------*/
1355 /* Get Attributes */
1356 /*--------------------------------------------------------------------------*/
1357 type = qs_get_type_attr(doc, node, r);
1358 name = qs_get_name_attr(doc, node, r);
1359 value = qs_get_value_attr(doc,node,r);
1360 istyle = qs_get_istyle_attr(doc,node,r);
1361 max_length = qs_get_maxlength_attr(doc,node,r);
1362 checked = qs_get_checked_attr(doc,node,r);
1363 accesskey = qs_get_accesskey_attr(doc, node, r);
1364 size = qs_get_size_attr(doc, node, r);
1367 type = qs_trim_string(doc->buf.pool, type);
1368 if (type && (STRCASEEQ('t','T',"text", type) ||
1369 STRCASEEQ('p','P',"password",type) ||
1370 STRCASEEQ('c','C',"checkbox",type) ||
1371 STRCASEEQ('r','R',"radio", type) ||
1372 STRCASEEQ('h','H',"hidden", type) ||
1373 STRCASEEQ('s','S',"submit", type) ||
1374 STRCASEEQ('r','R',"reset", type))) {
1380 if (size && *size) {
1385 if (name && *name) {
1390 if (value && *value) {
1392 W_V(chxj_add_slash_to_doublequote(doc->pool,value));
1395 if (accesskey && *accesskey) {
1396 W_L(" accesskey=\"");
1400 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1401 char *fmt = qs_conv_istyle_to_format(r,istyle);
1402 if (max_length && *max_length) {
1404 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1405 if (max_length[ii] < '0' || max_length[ii] > '9') {
1406 max_length = apr_psprintf(r->pool, "0");
1411 if (strcmp(max_length, "0")) {
1412 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1424 if (max_length && *max_length) {
1425 if (chxj_chk_numeric(max_length) != 0) {
1426 max_length = apr_psprintf(r->pool, "0");
1428 if (strcmp(max_length, "0")) {
1429 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1434 /*--------------------------------------------------------------------------*/
1435 /* The figure is default for the password. */
1436 /*--------------------------------------------------------------------------*/
1437 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1444 W_L(" FORMAT=\"*N\"");
1448 W_L(" checked=\"checked\"");
1456 * It is a handler who processes the INPUT tag.
1458 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1459 * destination is specified.
1460 * @param node [i] The INPUT tag node is specified.
1461 * @return The conversion result is returned.
1464 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1466 xhtml_t *xhtml = GET_XHTML(pdoc);
1473 * It is a handler who processes the CENTER tag.
1475 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1476 * destination is specified.
1477 * @param node [i] The CENTER tag node is specified.
1478 * @return The conversion result is returned.
1481 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1483 xhtml_t *xhtml = GET_XHTML(pdoc);
1484 Doc *doc = xhtml->doc;
1492 * It is a handler who processes the CENTER tag.
1494 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1495 * destination is specified.
1496 * @param node [i] The CENTER tag node is specified.
1497 * @return The conversion result is returned.
1500 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1502 xhtml_t *xhtml = GET_XHTML(pdoc);
1503 Doc *doc = xhtml->doc;
1511 * It is a handler who processes the HR tag.
1513 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1514 * destination is specified.
1515 * @param node [i] The HR tag node is specified.
1516 * @return The conversion result is returned.
1519 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1521 xhtml_t *xhtml = GET_XHTML(pdoc);
1522 Doc *doc = xhtml->doc;
1527 for (attr = qs_get_attr(doc,node);
1529 attr = qs_get_next_attr(doc,attr)) {
1530 char *name = qs_get_attr_name(doc,attr);
1531 char *value = qs_get_attr_value(doc,attr);
1532 if (STRCASEEQ('a','A',"align", name)) {
1533 /*----------------------------------------------------------------------*/
1535 /*----------------------------------------------------------------------*/
1536 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1542 else if (STRCASEEQ('s','S',"size", name)) {
1543 /*----------------------------------------------------------------------*/
1545 /*----------------------------------------------------------------------*/
1546 if (value && *value) {
1552 else if (STRCASEEQ('w','W',"width", name)) {
1553 /*----------------------------------------------------------------------*/
1555 /*----------------------------------------------------------------------*/
1556 if (value && *value) {
1562 else if (STRCASEEQ('n','N',"noshade", name)) {
1563 /*----------------------------------------------------------------------*/
1565 /*----------------------------------------------------------------------*/
1568 else if (STRCASEEQ('c','C',"color", name)) {
1569 /*----------------------------------------------------------------------*/
1571 /*----------------------------------------------------------------------*/
1581 * It is a handler who processes the HR tag.
1583 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1584 * destination is specified.
1585 * @param node [i] The HR tag node is specified.
1586 * @return The conversion result is returned.
1589 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1591 xhtml_t *xhtml = GET_XHTML(pdoc);
1598 * It is a handler who processes the PRE tag.
1600 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1601 * destination is specified.
1602 * @param node [i] The PRE tag node is specified.
1603 * @return The conversion result is returned.
1606 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1608 xhtml_t *xhtml = GET_XHTML(pdoc);
1609 Doc *doc = xhtml->doc;
1618 * It is a handler who processes the PRE tag.
1620 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1621 * destination is specified.
1622 * @param node [i] The PRE tag node is specified.
1623 * @return The conversion result is returned.
1626 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1628 xhtml_t *xhtml = GET_XHTML(pdoc);
1629 Doc *doc = xhtml->doc;
1639 * It is a handler who processes the P tag.
1641 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1642 * destination is specified.
1643 * @param node [i] The P tag node is specified.
1644 * @return The conversion result is returned.
1647 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1649 xhtml_t *xhtml = GET_XHTML(pdoc);
1650 Doc *doc = xhtml->doc;
1655 for (attr = qs_get_attr(doc,node);
1657 attr = qs_get_next_attr(doc,attr)) {
1658 char *nm = qs_get_attr_name(doc,attr);
1659 char *val = qs_get_attr_value(doc,attr);
1660 if (STRCASEEQ('a','A',"align", nm)) {
1661 /*----------------------------------------------------------------------*/
1662 /* CHTML 1.0 (W3C version 3.2) */
1663 /*----------------------------------------------------------------------*/
1664 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1665 align = apr_pstrdup(doc->buf.pool, val);
1681 * It is a handler who processes the P tag.
1683 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1684 * destination is specified.
1685 * @param node [i] The P tag node is specified.
1686 * @return The conversion result is returned.
1689 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1691 xhtml_t *xhtml = GET_XHTML(pdoc);
1692 Doc *doc = xhtml->doc;
1700 * It is a handler who processes the UL tag.
1702 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1703 * destination is specified.
1704 * @param node [i] The UL tag node is specified.
1705 * @return The conversion result is returned.
1708 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *UNUSED(node))
1710 xhtml_t *xhtml = GET_XHTML(pdoc);
1711 Doc *doc = xhtml->doc;
1719 * It is a handler who processes the UL tag.
1721 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1722 * destination is specified.
1723 * @param node [i] The UL tag node is specified.
1724 * @return The conversion result is returned.
1727 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1729 xhtml_t *xhtml = GET_XHTML(pdoc);
1730 Doc *doc = xhtml->doc;
1738 * It is a handler who processes the H1 tag.
1740 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1741 * destination is specified.
1742 * @param node [i] The H1 tag node is specified.
1743 * @return The conversion result is returned.
1746 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1748 xhtml_t *xhtml = GET_XHTML(pdoc);
1749 Doc *doc = xhtml->doc;
1753 for (attr = qs_get_attr(doc,node);
1755 attr = qs_get_next_attr(doc,attr)) {
1758 name = qs_get_attr_name(doc,attr);
1759 value = qs_get_attr_value(doc,attr);
1760 if (STRCASEEQ('a','A',"align", name)) {
1762 if (STRCASEEQ('l','L',"left",value)) {
1764 W_L("text-align:left");
1767 else if (STRCASEEQ('r','R',"right",value)) {
1769 W_L("text-align:right");
1772 else if (STRCASEEQ('c','C',"center",value)) {
1774 W_L("text-align:center");
1787 * It is a handler who processes the H1 tag.
1789 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1790 * destination is specified.
1791 * @param node [i] The H1 tag node is specified.
1792 * @return The conversion result is returned.
1795 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1797 xhtml_t *xhtml = GET_XHTML(pdoc);
1798 Doc *doc = xhtml->doc;
1806 * It is a handler who processes the H2 tag.
1808 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1809 * destination is specified.
1810 * @param node [i] The H2 tag node is specified.
1811 * @return The conversion result is returned.
1814 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1816 xhtml_t *xhtml = GET_XHTML(pdoc);
1817 Doc *doc = xhtml->doc;
1821 for (attr = qs_get_attr(doc,node);
1823 attr = qs_get_next_attr(doc,attr)) {
1826 name = qs_get_attr_name(doc,attr);
1827 value = qs_get_attr_value(doc,attr);
1828 if (STRCASEEQ('a','A',"align", name)) {
1830 if (STRCASEEQ('l','L',"left",value)) {
1832 W_L("text-align:left");
1835 else if (STRCASEEQ('r','R',"right",value)) {
1837 W_L("text-align:right");
1840 else if (STRCASEEQ('c','C',"center",value)) {
1842 W_L("text-align:center");
1855 * It is a handler who processes the H2 tag.
1857 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1858 * destination is specified.
1859 * @param node [i] The H2 tag node is specified.
1860 * @return The conversion result is returned.
1863 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1865 xhtml_t *xhtml = GET_XHTML(pdoc);
1866 Doc *doc = xhtml->doc;
1874 * It is a handler who processes the H3 tag.
1876 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1877 * destination is specified.
1878 * @param node [i] The H3 tag node is specified.
1879 * @return The conversion result is returned.
1882 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1884 xhtml_t *xhtml = GET_XHTML(pdoc);
1885 Doc *doc = xhtml->doc;
1889 for (attr = qs_get_attr(doc,node);
1891 attr = qs_get_next_attr(doc,attr)) {
1894 name = qs_get_attr_name(doc,attr);
1895 value = qs_get_attr_value(doc,attr);
1896 if (STRCASEEQ('a','A',"align", name)) {
1898 if (STRCASEEQ('l','L',"left",value)) {
1900 W_L("text-align:left");
1903 else if (STRCASEEQ('r','R',"right",value)) {
1905 W_L("text-align:right");
1908 else if (STRCASEEQ('c','C',"center",value)) {
1910 W_L("text-align:center");
1923 * It is a handler who processes the H3 tag.
1925 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1926 * destination is specified.
1927 * @param node [i] The H3 tag node is specified.
1928 * @return The conversion result is returned.
1931 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
1933 xhtml_t *xhtml = GET_XHTML(pdoc);
1934 Doc *doc = xhtml->doc;
1942 * It is a handler who processes the H4 tag.
1944 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1945 * destination is specified.
1946 * @param node [i] The H4 tag node is specified.
1947 * @return The conversion result is returned.
1950 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
1952 xhtml_t *xhtml = GET_XHTML(pdoc);
1953 Doc *doc = xhtml->doc;
1957 for (attr = qs_get_attr(doc,node);
1959 attr = qs_get_next_attr(doc,attr)) {
1962 name = qs_get_attr_name(doc,attr);
1963 value = qs_get_attr_value(doc,attr);
1964 if (STRCASEEQ('a','A',"align", name)) {
1966 if (STRCASEEQ('l','L',"left",value)) {
1968 W_L("text-align:left");
1971 else if (STRCASEEQ('r','R',"right",value)) {
1973 W_L("text-align:right");
1976 else if (STRCASEEQ('c','C',"center",value)) {
1978 W_L("text-align:center");
1991 * It is a handler who processes the H4 tag.
1993 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1994 * destination is specified.
1995 * @param node [i] The H4 tag node is specified.
1996 * @return The conversion result is returned.
1999 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2001 xhtml_t *xhtml = GET_XHTML(pdoc);
2002 Doc *doc = xhtml->doc;
2010 * It is a handler who processes the H5 tag.
2012 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2013 * destination is specified.
2014 * @param node [i] The H5 tag node is specified.
2015 * @return The conversion result is returned.
2018 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2020 xhtml_t *xhtml = GET_XHTML(pdoc);
2021 Doc *doc = xhtml->doc;
2025 for (attr = qs_get_attr(doc,node);
2027 attr = qs_get_next_attr(doc,attr)) {
2030 name = qs_get_attr_name(doc,attr);
2031 value = qs_get_attr_value(doc,attr);
2032 if (STRCASEEQ('a','A',"align", name)) {
2034 if (STRCASEEQ('l','L',"left",value)) {
2036 W_L("text-align:left");
2039 else if (STRCASEEQ('r','R',"right",value)) {
2041 W_L("text-align:right");
2044 else if (STRCASEEQ('c','C',"center",value)) {
2046 W_L("text-align:center");
2059 * It is a handler who processes the H5 tag.
2061 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2062 * destination is specified.
2063 * @param node [i] The H5 tag node is specified.
2064 * @return The conversion result is returned.
2067 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2069 xhtml_t *xhtml = GET_XHTML(pdoc);
2070 Doc *doc = xhtml->doc;
2078 * It is a handler who processes the H6 tag.
2080 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2081 * destination is specified.
2082 * @param node [i] The H6 tag node is specified.
2083 * @return The conversion result is returned.
2086 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2088 xhtml_t *xhtml = GET_XHTML(pdoc);
2089 Doc *doc = xhtml->doc;
2093 for (attr = qs_get_attr(doc,node);
2095 attr = qs_get_next_attr(doc,attr)) {
2098 name = qs_get_attr_name(doc,attr);
2099 value = qs_get_attr_value(doc,attr);
2100 if (STRCASEEQ('a','A',"align", name)) {
2102 if (STRCASEEQ('l','L',"left",value)) {
2104 W_L("text-align:left");
2107 else if (STRCASEEQ('r','R',"right",value)) {
2109 W_L("text-align:right");
2112 else if (STRCASEEQ('c','C',"center",value)) {
2114 W_L("text-align:center");
2127 * It is a handler who processes the H6 tag.
2129 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2130 * destination is specified.
2131 * @param node [i] The H6 tag node is specified.
2132 * @return The conversion result is returned.
2135 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2137 xhtml_t *xhtml = GET_XHTML(pdoc);
2138 Doc *doc = xhtml->doc;
2146 * It is a handler who processes the OL tag.
2148 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2149 * destination is specified.
2150 * @param node [i] The OL tag node is specified.
2151 * @return The conversion result is returned.
2154 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2156 xhtml_t *xhtml = GET_XHTML(pdoc);
2157 Doc *doc = xhtml->doc;
2161 /*--------------------------------------------------------------------------*/
2162 /* Get Attributes */
2163 /*--------------------------------------------------------------------------*/
2164 for (attr = qs_get_attr(doc,node);
2166 attr = qs_get_next_attr(doc,attr)) {
2167 char *name = qs_get_attr_name(doc,attr);
2168 char *value = qs_get_attr_value(doc,attr);
2169 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2174 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2186 * It is a handler who processes the OL tag.
2188 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2189 * destination is specified.
2190 * @param node [i] The OL tag node is specified.
2191 * @return The conversion result is returned.
2194 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2196 xhtml_t *xhtml = GET_XHTML(pdoc);
2197 Doc *doc = xhtml->doc;
2205 * It is a handler who processes the LI tag.
2207 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2208 * destination is specified.
2209 * @param node [i] The LI tag node is specified.
2210 * @return The conversion result is returned.
2213 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2215 xhtml_t *xhtml = GET_XHTML(pdoc);
2216 Doc *doc = xhtml->doc;
2220 /*--------------------------------------------------------------------------*/
2221 /* Get Attributes */
2222 /*--------------------------------------------------------------------------*/
2223 for (attr = qs_get_attr(doc,node);
2225 attr = qs_get_next_attr(doc,attr)) {
2226 char *name = qs_get_attr_name(doc,attr);
2227 char *value = qs_get_attr_value(doc,attr);
2228 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2233 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2245 ** It is a handler who processes the LI tag.
2247 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2248 * destination is specified.
2249 * @param node [i] The LI tag node is specified.
2250 * @return The conversion result is returned.
2253 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2255 xhtml_t *xhtml = GET_XHTML(pdoc);
2256 Doc *doc = xhtml->doc;
2263 * It is a handler who processes the IMG tag.
2265 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2266 * destination is specified.
2267 * @param node [i] The IMG tag node is specified.
2268 * @return The conversion result is returned.
2271 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2273 xhtml_t *xhtml = GET_XHTML(pdoc);
2274 Doc *doc = xhtml->doc;
2275 request_rec *r = doc->r;
2278 #ifndef IMG_NOT_CONVERT_FILENAME
2279 device_table *spec = xhtml->spec;
2283 /*--------------------------------------------------------------------------*/
2284 /* Get Attributes */
2285 /*--------------------------------------------------------------------------*/
2286 for (attr = qs_get_attr(doc,node);
2288 attr = qs_get_next_attr(doc,attr)) {
2289 char *name = qs_get_attr_name(doc,attr);
2290 char *value = qs_get_attr_value(doc,attr);
2292 if (STRCASEEQ('s','S',"src",name)) {
2293 value = chxj_encoding_parameter(r, value);
2294 value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
2296 value = apr_psprintf(r->pool,
2299 (strchr(value, '?')) ? '&' : '?',
2300 CHXJ_COOKIE_NOUPDATE_PARAM);
2302 #ifdef IMG_NOT_CONVERT_FILENAME
2312 char *vv = chxj_img_conv(r,spec,value);
2320 if (STRCASEEQ('a','A',"align",name)) {
2321 if (value && (STRCASEEQ('t','T',"top", value) ||
2322 STRCASEEQ('m','M',"middle",value) ||
2323 STRCASEEQ('b','B',"bottom",value) ||
2324 STRCASEEQ('l','L',"left", value) ||
2325 STRCASEEQ('r','R',"right", value))) {
2331 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2336 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2341 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2346 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2351 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2363 * It is a handler who processes the IMG tag.
2365 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2366 * destination is specified.
2367 * @param node [i] The IMG tag node is specified.
2368 * @return The conversion result is returned.
2371 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2373 xhtml_t *xhtml = GET_XHTML(pdoc);
2380 * It is a handler who processes the SELECT tag.
2382 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2383 * destination is specified.
2384 * @param node [i] The SELECT tag node is specified.
2385 * @return The conversion result is returned.
2388 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2390 xhtml_t *xhtml = GET_XHTML(pdoc);
2391 Doc *doc = xhtml->doc;
2394 char *multiple = NULL;
2399 for (attr = qs_get_attr(doc,child);
2401 attr = qs_get_next_attr(doc,attr)) {
2402 char *nm = qs_get_attr_name(doc,attr);
2403 char *val = qs_get_attr_value(doc,attr);
2404 if (STRCASEEQ('s','S',"size",nm)) {
2405 /*----------------------------------------------------------------------*/
2406 /* CHTML 1.0 version 2.0 */
2407 /*----------------------------------------------------------------------*/
2408 size = apr_pstrdup(doc->buf.pool, val);
2410 else if (STRCASEEQ('n','N',"name",nm)) {
2411 /*----------------------------------------------------------------------*/
2412 /* CHTML 1.0 version 2.0 */
2413 /*----------------------------------------------------------------------*/
2414 name = apr_pstrdup(doc->buf.pool, val);
2416 else if (STRCASEEQ('m','M',"multiple",nm)) {
2417 /*----------------------------------------------------------------------*/
2418 /* CHTML 1.0 version 2.0 */
2419 /*----------------------------------------------------------------------*/
2420 multiple = apr_pstrdup(doc->buf.pool, val);
2423 if (size && *size) {
2428 if (name && *name) {
2434 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2435 W_L(" multiple=\"true\"");
2443 * It is a handler who processes the SELECT tag.
2445 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2446 * destination is specified.
2447 * @param node [i] The SELECT tag node is specified.
2448 * @return The conversion result is returned.
2451 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2453 xhtml_t *xhtml = GET_XHTML(pdoc);
2454 Doc *doc = xhtml->doc;
2456 W_L("</select>\r\n");
2462 * It is a handler who processes the OPTION tag.
2464 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2465 * destination is specified.
2466 * @param node [i] The OPTION tag node is specified.
2467 * @return The conversion result is returned.
2470 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2472 xhtml_t *xhtml = GET_XHTML(pdoc);
2473 Doc *doc = xhtml->doc;
2476 char *selected = NULL;
2480 for (attr = qs_get_attr(doc,child);
2482 attr = qs_get_next_attr(doc,attr)) {
2483 char *nm = qs_get_attr_name(doc,attr);
2484 char *val = qs_get_attr_value(doc,attr);
2485 if (STRCASEEQ('s','S',"selected",nm)) {
2486 /* CHTML version 2.0 */
2487 selected = apr_pstrdup(doc->buf.pool, val);
2489 else if (STRCASEEQ('v','V',"value",nm)) {
2490 /* CHTML version 2.0 */
2491 value = apr_pstrdup(doc->buf.pool, val);
2494 if (value && *value) {
2500 W_L(" selected=\"selected\"");
2508 * It is a handler who processes the OPTION tag.
2510 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2511 * destination is specified.
2512 * @param node [i] The OPTION tag node is specified.
2513 * @return The conversion result is returned.
2516 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2518 xhtml_t *xhtml = GET_XHTML(pdoc);
2519 Doc *doc = xhtml->doc;
2521 W_L("</option>\r\n");
2527 * It is a handler who processes the DIV tag.
2529 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2530 * destination is specified.
2531 * @param node [i] The DIV tag node is specified.
2532 * @return The conversion result is returned.
2535 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2537 xhtml_t *xhtml = GET_XHTML(pdoc);
2538 Doc *doc = xhtml->doc;
2543 for (attr = qs_get_attr(doc,child);
2545 attr = qs_get_next_attr(doc,attr)) {
2546 char *nm = qs_get_attr_name(doc,attr);
2547 char *val = qs_get_attr_value(doc,attr);
2548 if (STRCASEEQ('a','A',"align",nm)) {
2549 /*=====================================================================*/
2550 /* CHTML version 3.2 */
2551 /*=====================================================================*/
2552 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2553 align = apr_pstrdup(doc->buf.pool, val);
2568 * It is a handler who processes the DIV tag.
2570 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2571 * destination is specified.
2572 * @param node [i] The DIV tag node is specified.
2573 * @return The conversion result is returned.
2576 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2578 xhtml_t *xhtml = GET_XHTML(pdoc);
2579 Doc *doc = xhtml->doc;
2586 * It is a handler who processes the B tag.
2588 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2589 * destination is specified.
2590 * @param node [i] The B tag node is specified.
2591 * @return The conversion result is returned.
2594 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2596 xhtml_t *xhtml = GET_XHTML(pdoc);
2597 Doc *doc = xhtml->doc;
2599 W_L("<div style=\"font-weight:bold\">");
2605 * It is a handler who processes the B tag.
2607 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2608 * destination is specified.
2609 * @param node [i] The B tag node is specified.
2610 * @return The conversion result is returned.
2613 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2615 xhtml_t *xhtml = GET_XHTML(pdoc);
2616 Doc *doc = xhtml->doc;
2624 * It is a handler who processes the CHXJ:IF tag.
2626 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2627 * destination is specified.
2628 * @param node [i] The CHXJ:IF tag node is specified.
2631 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2633 xhtml_t *xhtml = GET_XHTML(pdoc);
2634 Doc *doc = xhtml->doc;
2637 for (child = qs_get_child_node(doc, node);
2639 child = qs_get_next_node(doc, child)) {
2641 s_xhtml_1_0_chxjif_tag(xhtml, child);
2649 * It is a handler who processes the TEXTARE tag.
2651 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2652 * destination is specified.
2653 * @param node [i] The TEXTAREA tag node is specified.
2654 * @return The conversion result is returned.
2657 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2659 xhtml_t *xhtml = GET_XHTML(pdoc);
2660 Doc *doc = xhtml->doc;
2663 xhtml->textarea_flag++;
2665 for (attr = qs_get_attr(doc,node);
2667 attr = qs_get_next_attr(doc,attr)) {
2668 char *name = qs_get_attr_name(doc,attr);
2669 char *value = qs_get_attr_value(doc,attr);
2670 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2675 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2680 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2685 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2686 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2691 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2692 W_L(" accesskey=\"");
2703 * It is a handler who processes the TEXTAREA tag.
2705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2706 * destination is specified.
2707 * @param node [i] The TEXTAREA tag node is specified.
2708 * @return The conversion result is returned.
2711 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2713 xhtml_t *xhtml = GET_XHTML(pdoc);
2714 Doc *doc = xhtml->doc;
2716 W_L("</textarea>\r\n");
2717 xhtml->textarea_flag--;
2723 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2725 xhtml_t *xhtml = GET_XHTML(pdoc);
2726 Doc *doc = xhtml->doc;
2727 request_rec *r = doc->r;
2735 textval = qs_get_node_value(doc,child);
2736 if (strlen(textval) == 0) {
2740 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2741 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2743 tdst = qs_alloc_zero_byte_string(r);
2744 memset(one_byte, 0, sizeof(one_byte));
2747 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2749 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2751 DBG(r,"[%s][%d]", out, rtn);
2752 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2756 if (is_sjis_kanji(textval[ii])) {
2757 one_byte[0] = textval[ii+0];
2758 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2759 one_byte[0] = textval[ii+1];
2760 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2763 else if (xhtml->pre_flag) {
2764 one_byte[0] = textval[ii+0];
2765 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2767 else if (xhtml->textarea_flag) {
2768 one_byte[0] = textval[ii+0];
2769 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2771 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2772 one_byte[0] = textval[ii+0];
2773 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2782 * It is a handler who processes the BLOCKQUOTE tag.
2784 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2785 * destination is specified.
2786 * @param node [i] The BLOCKQUOTE tag node is specified.
2787 * @return The conversion result is returned.
2790 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2792 xhtml_t *xhtml = GET_XHTML(pdoc);
2793 Doc *doc = xhtml->doc;
2794 W_L("<blockquote>");
2800 * It is a handler who processes the BLOCKQUOTE tag.
2802 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2803 * destination is specified.
2804 * @param node [i] The BLOCKQUOTE tag node is specified.
2805 * @return The conversion result is returned.
2808 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2810 xhtml_t *xhtml = GET_XHTML(pdoc);
2811 Doc *doc = xhtml->doc;
2812 W_L("</blockquote>");
2818 * It is a handler who processes the DIR tag.
2820 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2821 * destination is specified.
2822 * @param node [i] The DIR tag node is specified.
2823 * @return The conversion result is returned.
2826 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *UNUSED(child))
2828 xhtml_t *xhtml = GET_XHTML(pdoc);
2829 Doc *doc = xhtml->doc;
2836 * It is a handler who processes the DIR tag.
2838 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2839 * destination is specified.
2840 * @param node [i] The DIR tag node is specified.
2841 * @return The conversion result is returned.
2844 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2846 xhtml_t *xhtml = GET_XHTML(pdoc);
2847 Doc *doc = xhtml->doc;
2854 * It is a handler who processes the DL tag.
2856 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2857 * destination is specified.
2858 * @param node [i] The DL tag node is specified.
2859 * @return The conversion result is returned.
2862 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2864 xhtml_t *xhtml = GET_XHTML(pdoc);
2865 Doc *doc = xhtml->doc;
2872 * It is a handler who processes the DL tag.
2874 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2875 * destination is specified.
2876 * @param node [i] The DL tag node is specified.
2877 * @return The conversion result is returned.
2880 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2882 xhtml_t *xhtml = GET_XHTML(pdoc);
2883 Doc *doc = xhtml->doc;
2890 * It is a handter who processes the DT tag.
2892 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2893 * destination is specified.
2894 * @param node [i] The DT tag node is specified.
2895 * @return The conversion result is returned.
2898 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
2900 xhtml_t *xhtml = GET_XHTML(pdoc);
2901 Doc *doc = xhtml->doc;
2908 * It is a handter who processes the DT tag.
2910 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2911 * destination is specified.
2912 * @param node [i] The DT tag node is specified.
2913 * @return The conversion result is returned.
2916 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
2918 xhtml_t *xhtml = GET_XHTML(pdoc);
2919 Doc *doc = xhtml->doc;
2926 * It is a handder who processes the DD tag.
2928 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2929 * destination is specified.
2930 * @param node [i] The DD tag node is specified.
2931 * @return The conversion result is returned.
2934 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
2936 xhtml_t *xhtml = GET_XHTML(pdoc);
2937 Doc *doc = xhtml->doc;
2944 * It is a handder who processes the DD tag.
2946 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2947 * destination is specified.
2948 * @param node [i] The DD tag node is specified.
2949 * @return The conversion result is returned.
2952 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
2954 xhtml_t *xhtml = GET_XHTML(pdoc);
2955 Doc *doc = xhtml->doc;
2962 * It is a handler who processes the MENU tag.
2964 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2965 * destination is specified.
2966 * @param node [i] The MENU tag node is specified.
2967 * @return The conversion result is returned.
2970 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *UNUSED(child))
2974 xhtml = GET_XHTML(pdoc);
2982 * It is a hanmenuer who processes the MENU tag.
2984 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2985 * destination is specified.
2986 * @param node [i] The MENU tag node is specified.
2987 * @return The conversion result is returned.
2990 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
2992 xhtml_t *xhtml = GET_XHTML(pdoc);
2993 Doc *doc = xhtml->doc;
3000 * It is a handler who processes the PLAINTEXT tag.
3002 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3003 * destination is specified.
3004 * @param node [i] The PLAINTEXT tag node is specified.
3005 * @return The conversion result is returned.
3008 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3010 xhtml_t *xhtml = GET_XHTML(pdoc);
3011 Doc *doc = xhtml->doc;
3013 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3018 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3020 xhtml_t *xhtml = GET_XHTML(pdoc);
3021 Doc *doc = xhtml->doc;
3023 for (child = qs_get_child_node(doc, node);
3025 child = qs_get_next_node(doc, child)) {
3027 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3034 * It is a handler who processes the PLAINTEXT tag.
3036 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3037 * destination is specified.
3038 * @param node [i] The PLAINTEXT tag node is specified.
3039 * @return The conversion result is returned.
3042 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3044 xhtml_t *xhtml = GET_XHTML(pdoc);
3045 Doc *doc = xhtml->doc;
3046 W_L("</plaintext>");
3052 * It is a hanblinker who processes the BLINK tag.
3054 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3055 * destination is specified.
3056 * @param node [i] The BLINK tag node is specified.
3057 * @return The conversion result is returned.
3060 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3062 xhtml_t *xhtml = GET_XHTML(pdoc);
3063 Doc *doc = xhtml->doc;
3070 * It is a hanblinker who processes the BLINK tag.
3072 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3073 * destination is specified.
3074 * @param node [i] The BLINK tag node is specified.
3075 * @return The conversion result is returned.
3078 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3080 xhtml_t *xhtml = GET_XHTML(pdoc);
3081 Doc *doc = xhtml->doc;
3088 * It is a handler who processes the MARQUEE tag.
3090 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3091 * destination is specified.
3092 * @param node [i] The MARQUEE tag node is specified.
3093 * @return The conversion result is returned.
3096 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3098 xhtml_t *xhtml = GET_XHTML(pdoc);
3099 Doc *doc = xhtml->doc;
3102 /*--------------------------------------------------------------------------*/
3103 /* Get Attributes */
3104 /*--------------------------------------------------------------------------*/
3105 for (attr = qs_get_attr(doc,node);
3107 attr = qs_get_next_attr(doc,attr)) {
3108 char *name = qs_get_attr_name(doc,attr);
3109 char *value = qs_get_attr_value(doc,attr);
3110 if (STRCASEEQ('d','D',"direction", name)) {
3111 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3112 W_L(" direction=\"");
3117 else if (STRCASEEQ('b','B',"behavior",name)) {
3118 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3119 W_L(" behavior=\"");
3124 else if (STRCASEEQ('l','L',"loop",name)) {
3125 if (value && *value) {
3138 * It is a handler who processes the MARQUEE tag.
3140 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3141 * destination is specified.
3142 * @param node [i] The MARQUEE tag node is specified.
3143 * @return The conversion result is returned.
3146 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3148 xhtml_t *xhtml = GET_XHTML(pdoc);
3149 Doc *doc = xhtml->doc;