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,
407 cookie_t *UNUSED(cookie)
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;
433 chxj_set_content_type(r, "text/html; charset=Windows-31J");
435 /*--------------------------------------------------------------------------*/
436 /* The character string of the input is analyzed. */
437 /*--------------------------------------------------------------------------*/
438 qs_init_malloc(&doc);
439 qs_init_root_node(&doc);
441 ss = apr_pcalloc(r->pool, srclen + 1);
442 memset(ss, 0, srclen + 1);
443 memcpy(ss, src, srclen);
446 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
448 qs_parse_string(&doc,ss, strlen(ss));
450 chxj_buffered_write_init(r->pool, &doc.buf);
451 /*--------------------------------------------------------------------------*/
452 /* It converts it from CHTML to XHTML. */
453 /*--------------------------------------------------------------------------*/
454 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
455 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
456 dst = apr_pstrdup(r->pool, xhtml.out);
457 chxj_buffered_write_terminate(&doc.buf);
459 qs_all_free(&doc,QX_LOGMARK);
462 return apr_pstrdup(r->pool,ss);
466 dst = apr_psprintf(r->pool, "\n");
468 *dstlen = strlen(dst);
471 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
474 DBG(r,"end chxj_exchange_xhtml_mobile_1_0()");
480 * The XHTML structure is initialized.
482 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
483 * initialized is specified.
484 * @param doc [i] The Doc structure that should be set to the initialized
485 * HDML structure is specified.
486 * @param r [i] To use POOL, the pointer to request_rec is specified.
487 * @param spec [i] The pointer to the device_table
490 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
492 memset(doc, 0, sizeof(Doc));
493 memset(xhtml, 0, sizeof(xhtml_t));
498 xhtml->out = qs_alloc_zero_byte_string(r);
499 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
500 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
505 * Corresponding EMOJI to a current character-code is retrieved.
506 * The substitution character string is stored in the rslt pointer if agreeing.
508 * @param xhtml [i] The pointer to the XHTML structure is specified.
509 * @param txt [i] The character string to want to examine whether it is
510 * EMOJI is specified.
511 * @param rslt [o] The pointer to the pointer that stores the result is
513 * @return When corresponding EMOJI exists, it returns it excluding 0.
516 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
529 DBG(r,"spec is NULL");
532 for (ee = xhtml->conf->emoji;
535 unsigned char hex1byte;
536 unsigned char hex2byte;
538 DBG(r,"emoji->imode is NULL");
542 if (ee->imode->string != NULL
543 && strlen(ee->imode->string) > 0
544 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
545 if (spec == NULL || spec->emoji_type == NULL) {
546 *rslt = apr_psprintf(r->pool,
549 return strlen(ee->imode->string);
552 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
553 *rslt = apr_psprintf(r->pool,
556 return strlen(ee->imode->string);
559 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
560 *rslt = apr_psprintf(r->pool,
563 return strlen(ee->imode->string);
566 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
567 *rslt = apr_psprintf(r->pool,
570 return strlen(ee->imode->string);
573 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
574 *rslt = apr_psprintf(r->pool,
577 return strlen(ee->imode->string);
580 *rslt = apr_psprintf(r->pool,
583 return strlen(ee->imode->string);
587 hex1byte = ee->imode->hex1byte & 0xff;
588 hex2byte = ee->imode->hex2byte & 0xff;
590 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
591 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
592 if (spec == NULL || spec->emoji_type == NULL) {
593 *rslt = apr_psprintf(r->pool,
594 "<img localsrc=\"%s\">",
599 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
600 *rslt = apr_psprintf(r->pool,
601 "<img localsrc=\"%s\">",
606 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
607 *rslt = apr_psprintf(r->pool,
608 "<img localsrc=\"%s\">",
613 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
614 *rslt = apr_psprintf(r->pool,
615 "<img localsrc=\"%s\">",
620 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
621 *rslt = apr_psprintf(r->pool,
622 "<img localsrc=\"%s\">",
627 *rslt = apr_psprintf(r->pool,
628 "<img localsrc=\"%s\">",
640 * It is a handler who processes the HTML tag.
642 * @param pdoc [i/o] The pointer to the XHTML structure at the output
643 * destination is specified.
644 * @param node [i] The HTML tag node is specified.
645 * @return The conversion result is returned.
648 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
650 xhtml_t *xhtml = GET_XHTML(pdoc);
652 Doc *doc = xhtml->doc;
654 /*--------------------------------------------------------------------------*/
655 /* Add XML Declare */
656 /*--------------------------------------------------------------------------*/
657 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>\r\n");
658 /*--------------------------------------------------------------------------*/
660 /*--------------------------------------------------------------------------*/
661 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"\r\n");
662 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">\r\n");
663 /*--------------------------------------------------------------------------*/
665 /*--------------------------------------------------------------------------*/
666 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
667 /*--------------------------------------------------------------------------*/
669 /*--------------------------------------------------------------------------*/
670 for (attr = qs_get_attr(doc,node);
672 attr = qs_get_next_attr(doc,attr)) {
673 char* name = qs_get_attr_name(doc,attr);
674 char* value = qs_get_attr_value(doc,attr);
675 if (STRCASEEQ('l','L',"lang", name)) {
680 else if (STRCASEEQ('v','V',"version", name)) {
681 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
690 * It is a handler who processes the HTML tag.
692 * @param pdoc [i/o] The pointer to the XHTML structure at the output
693 * destination is specified.
694 * @param node [i] The HTML tag node is specified.
695 * @return The conversion result is returned.
698 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
700 xhtml_t *xhtml = GET_XHTML(pdoc);
701 Doc *doc = xhtml->doc;
708 * It is a handler who processes the META tag.
710 * @param pdoc [i/o] The pointer to the XHTML structure at the output
711 * destination is specified.
712 * @param node [i] The META tag node is specified.
713 * @return The conversion result is returned.
716 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
718 xhtml_t *xhtml = GET_XHTML(pdoc);
720 Doc *doc = xhtml->doc;
721 int content_type_flag = 0;
724 /*--------------------------------------------------------------------------*/
726 /*--------------------------------------------------------------------------*/
727 for (attr = qs_get_attr(doc,node);
729 attr = qs_get_next_attr(doc,attr)) {
730 char *name = qs_get_attr_name(doc,attr);
731 char *value = qs_get_attr_value(doc,attr);
732 if (STRCASEEQ('n','N',"name", name) && value && *value) {
739 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
745 if (STRCASEEQ('c','C', "content-type", value)) {
746 content_type_flag = 1;
749 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
750 if (content_type_flag) {
754 W_L("text/html; charset=Windows-31J");
772 * It is a handler who processes the META tag.
774 * @param pdoc [i/o] The pointer to the XHTML structure at the output
775 * destination is specified.
776 * @param node [i] The META tag node is specified.
777 * @return The conversion result is returned.
780 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
782 xhtml_t *xhtml = GET_XHTML(pdoc);
789 * It is a handler who processes the HEAD tag.
791 * @param pdoc [i/o] The pointer to the XHTML structure at the output
792 * destination is specified.
793 * @param node [i] The HEAD tag node is specified.
794 * @return The conversion result is returned.
797 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
799 xhtml_t *xhtml = GET_XHTML(pdoc);
800 Doc *doc = xhtml->doc;
808 * It is a handler who processes the HEAD tag.
810 * @param pdoc [i/o] The pointer to the XHTML structure at the output
811 * destination is specified.
812 * @param node [i] The HEAD tag node is specified.
813 * @return The conversion result is returned.
816 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
818 xhtml_t *xhtml = GET_XHTML(pdoc);
819 Doc *doc = xhtml->doc;
827 * It is a handler who processes the TITLE tag.
829 * @param pdoc [i/o] The pointer to the XHTML structure at the output
830 * destination is specified.
831 * @param node [i] The TITLE tag node is specified.
832 * @return The conversion result is returned.
835 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
837 xhtml_t *xhtml = GET_XHTML(pdoc);
838 Doc *doc = xhtml->doc;
846 * It is a handler who processes the TITLE tag.
848 * @param pdoc [i/o] The pointer to the XHTML structure at the output
849 * destination is specified.
850 * @param node [i] The TITLE tag node is specified.
851 * @return The conversion result is returned.
854 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
856 xhtml_t *xhtml = GET_XHTML(pdoc);
857 Doc *doc = xhtml->doc;
865 * It is a handler who processes the BASE tag.
867 * @param pdoc [i/o] The pointer to the XHTML structure at the output
868 * destination is specified.
869 * @param node [i] The BASE tag node is specified.
870 * @return The conversion result is returned.
873 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
875 xhtml_t *xhtml = GET_XHTML(pdoc);
877 Doc *doc = xhtml->doc;
880 /*--------------------------------------------------------------------------*/
882 /*--------------------------------------------------------------------------*/
883 for (attr = qs_get_attr(doc,node);
885 attr = qs_get_next_attr(doc,attr)) {
886 char *name = qs_get_attr_name(doc,attr);
887 char *value = qs_get_attr_value(doc,attr);
888 if (STRCASEEQ('h','H',"href",name)) {
901 * It is a handler who processes the BASE tag.
903 * @param pdoc [i/o] The pointer to the XHTML structure at the output
904 * destination is specified.
905 * @param node [i] The BASE tag node is specified.
906 * @return The conversion result is returned.
909 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
911 xhtml_t *xhtml = GET_XHTML(pdoc);
918 * It is a handler who processes the BODY tag.
920 * @param pdoc [i/o] The pointer to the XHTML structure at the output
921 * destination is specified.
922 * @param node [i] The BODY tag node is specified.
923 * @return The conversion result is returned.
926 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
928 xhtml_t *xhtml = GET_XHTML(pdoc);
929 Doc *doc = xhtml->doc;
933 /*--------------------------------------------------------------------------*/
935 /*--------------------------------------------------------------------------*/
936 for (attr = qs_get_attr(doc,node);
938 attr = qs_get_next_attr(doc,attr)) {
939 char *name = qs_get_attr_name(doc,attr);
940 char *value = qs_get_attr_value(doc,attr);
941 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
946 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
951 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
956 else if (STRCASEEQ('a','A',"alink", name)) {
959 else if (STRCASEEQ('v','V',"vlink",name)) {
969 * It is a handler who processes the BODY tag.
971 * @param pdoc [i/o] The pointer to the XHTML structure at the output
972 * destination is specified.
973 * @param node [i] The BODY tag node is specified.
974 * @return The conversion result is returned.
977 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
979 xhtml_t *xhtml = GET_XHTML(pdoc);
980 Doc *doc = xhtml->doc;
988 * It is a handler who processes the A tag.
990 * @param pdoc [i/o] The pointer to the XHTML structure at the output
991 * destination is specified.
992 * @param node [i] The A tag node is specified.
993 * @return The conversion result is returned.
996 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
998 xhtml_t *xhtml = GET_XHTML(pdoc);
999 Doc *doc = xhtml->doc;
1000 request_rec *r = doc->r;
1004 /*--------------------------------------------------------------------------*/
1005 /* Get Attributes */
1006 /*--------------------------------------------------------------------------*/
1007 for (attr = qs_get_attr(doc,node);
1009 attr = qs_get_next_attr(doc,attr)) {
1010 char* name = qs_get_attr_name(doc,attr);
1011 char* value = qs_get_attr_value(doc,attr);
1012 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1017 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1018 value = chxj_encoding_parameter(r, value);
1023 else if (STRCASEEQ('a','A',"accesskey", name)) {
1024 W_L(" accesskey=\"");
1028 else if (STRCASEEQ('c','C',"cti",name)) {
1031 else if (STRCASEEQ('i','I',"ijam", name)) {
1034 else if (STRCASEEQ('u','U',"utn", name)) {
1037 else if (STRCASEEQ('t','T',"telbook",name)) {
1040 else if (STRCASEEQ('k','K',"kana",name)) {
1043 else if (STRCASEEQ('e','E',"email",name)) {
1046 else if (STRCASEEQ('i','I',"ista",name)) {
1049 else if (STRCASEEQ('i','I',"ilet",name)) {
1052 else if (STRCASEEQ('i','I',"iswf",name)) {
1055 else if (STRCASEEQ('i','I',"irst",name)) {
1065 * It is a handler who processes the A tag.
1067 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1068 * destination is specified.
1069 * @param node [i] The A tag node is specified.
1070 * @return The conversion result is returned.
1073 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1075 xhtml_t *xhtml = GET_XHTML(pdoc);
1076 Doc *doc = xhtml->doc;
1084 * It is a handler who processes the BR tag.
1086 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1087 * destination is specified.
1088 * @param node [i] The BR tag node is specified.
1089 * @return The conversion result is returned.
1092 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1094 xhtml_t *xhtml = GET_XHTML(pdoc);
1095 Doc *doc = xhtml->doc;
1099 /*--------------------------------------------------------------------------*/
1100 /* Get Attributes */
1101 /*--------------------------------------------------------------------------*/
1102 for (attr = qs_get_attr(doc,node);
1104 attr = qs_get_next_attr(doc,attr)) {
1105 char *name = qs_get_attr_name(doc,attr);
1106 char *value = qs_get_attr_value(doc,attr);
1107 if (STRCASEEQ('c','C',"clear",name)) {
1108 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1121 * It is a handler who processes the BR tag.
1123 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1124 * destination is specified.
1125 * @param node [i] The BR tag node is specified.
1126 * @return The conversion result is returned.
1129 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1131 xhtml_t *xhtml = GET_XHTML(pdoc);
1138 * It is a handler who processes the TR tag.
1140 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1141 * destination is specified.
1142 * @param node [i] The TR tag node is specified.
1143 * @return The conversion result is returned.
1146 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1148 xhtml_t *xhtml = GET_XHTML(pdoc);
1149 Doc *doc = xhtml->doc;
1157 * It is a handler who processes the TR tag.
1159 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1160 * destination is specified.
1161 * @param node [i] The TR tag node is specified.
1162 * @return The conversion result is returned.
1165 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1167 xhtml_t *xhtml = GET_XHTML(pdoc);
1174 * It is a handler who processes the FONT tag.
1176 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1177 * destination is specified.
1178 * @param node [i] The FONT tag node is specified.
1179 * @return The conversion result is returned.
1182 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1184 xhtml_t *xhtml = GET_XHTML(pdoc);
1185 Doc *doc = xhtml->doc;
1189 /*=========================================================================*/
1190 /* Get Attributes */
1191 /*=========================================================================*/
1192 for (attr = qs_get_attr(doc,node);
1194 attr = qs_get_next_attr(doc,attr)) {
1195 char *name = qs_get_attr_name(doc,attr);
1196 char *value = qs_get_attr_value(doc,attr);
1197 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1202 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1214 * It is a handler who processes the FONT tag.
1216 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1217 * destination is specified.
1218 * @param node [i] The FONT tag node is specified.
1219 * @return The conversion result is returned.
1222 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1224 xhtml_t *xhtml = GET_XHTML(pdoc);
1225 Doc *doc = xhtml->doc;
1233 * It is a handler who processes the FORM tag.
1235 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1236 * destination is specified.
1237 * @param node [i] The FORM tag node is specified.
1238 * @return The conversion result is returned.
1241 s_xhtml_1_0_start_form_tag(void *pdoc, Node *node)
1243 xhtml_t *xhtml = GET_XHTML(pdoc);
1244 Doc *doc = xhtml->doc;
1245 request_rec *r = doc->r;
1249 /*--------------------------------------------------------------------------*/
1250 /* Get Attributes */
1251 /*--------------------------------------------------------------------------*/
1252 for (attr = qs_get_attr(doc,node);
1254 attr = qs_get_next_attr(doc,attr)) {
1255 char *name = qs_get_attr_name(doc,attr);
1256 char *value = qs_get_attr_value(doc,attr);
1257 if (STRCASEEQ('a','A',"action",name)) {
1258 value = chxj_encoding_parameter(r, value);
1263 else if (STRCASEEQ('m','M',"method",name)) {
1268 else if (STRCASEEQ('u','U',"utn",name)) {
1278 * It is a handler who processes the FORM tag.
1280 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1281 * destination is specified.
1282 * @param node [i] The FORM tag node is specified.
1283 * @return The conversion result is returned.
1286 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1288 xhtml_t *xhtml = GET_XHTML(pdoc);
1289 Doc *doc = xhtml->doc;
1297 * It is a handler who processes the INPUT tag.
1299 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1300 * destination is specified.
1301 * @param node [i] The INPUT tag node is specified.
1302 * @return The conversion result is returned.
1305 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1307 xhtml_t *xhtml = GET_XHTML(pdoc);
1308 Doc *doc = xhtml->doc;
1309 request_rec *r = doc->r;
1310 char *max_length = NULL;
1314 char *istyle = NULL;
1316 char *checked = NULL;
1317 char *accesskey = NULL;
1320 /*--------------------------------------------------------------------------*/
1321 /* Get Attributes */
1322 /*--------------------------------------------------------------------------*/
1323 type = qs_get_type_attr(doc, node, r);
1324 name = qs_get_name_attr(doc, node, r);
1325 value = qs_get_value_attr(doc,node,r);
1326 istyle = qs_get_istyle_attr(doc,node,r);
1327 max_length = qs_get_maxlength_attr(doc,node,r);
1328 checked = qs_get_checked_attr(doc,node,r);
1329 accesskey = qs_get_accesskey_attr(doc, node, r);
1330 size = qs_get_size_attr(doc, node, r);
1333 type = qs_trim_string(doc->buf.pool, type);
1334 if (type && (STRCASEEQ('t','T',"text", type) ||
1335 STRCASEEQ('p','P',"password",type) ||
1336 STRCASEEQ('c','C',"checkbox",type) ||
1337 STRCASEEQ('r','R',"radio", type) ||
1338 STRCASEEQ('h','H',"hidden", type) ||
1339 STRCASEEQ('s','S',"submit", type) ||
1340 STRCASEEQ('r','R',"reset", type))) {
1346 if (size && *size) {
1351 if (name && *name) {
1356 if (value && *value) {
1361 if (accesskey && *accesskey) {
1362 W_L(" accesskey=\"");
1366 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1367 char *fmt = qs_conv_istyle_to_format(r,istyle);
1368 if (max_length && *max_length) {
1370 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1371 if (max_length[ii] < '0' || max_length[ii] > '9') {
1372 max_length = apr_psprintf(r->pool, "0");
1377 if (strcmp(max_length, "0")) {
1378 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1390 if (max_length && *max_length) {
1391 if (chxj_chk_numeric(max_length) != 0) {
1392 max_length = apr_psprintf(r->pool, "0");
1394 if (strcmp(max_length, "0")) {
1395 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1400 /*--------------------------------------------------------------------------*/
1401 /* The figure is default for the password. */
1402 /*--------------------------------------------------------------------------*/
1403 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1410 W_L(" FORMAT=\"*N\"");
1414 W_L(" checked=\"checked\"");
1422 * It is a handler who processes the INPUT tag.
1424 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1425 * destination is specified.
1426 * @param node [i] The INPUT tag node is specified.
1427 * @return The conversion result is returned.
1430 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1432 xhtml_t *xhtml = GET_XHTML(pdoc);
1439 * It is a handler who processes the CENTER tag.
1441 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1442 * destination is specified.
1443 * @param node [i] The CENTER tag node is specified.
1444 * @return The conversion result is returned.
1447 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1449 xhtml_t *xhtml = GET_XHTML(pdoc);
1450 Doc *doc = xhtml->doc;
1458 * It is a handler who processes the CENTER tag.
1460 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1461 * destination is specified.
1462 * @param node [i] The CENTER tag node is specified.
1463 * @return The conversion result is returned.
1466 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1468 xhtml_t *xhtml = GET_XHTML(pdoc);
1469 Doc *doc = xhtml->doc;
1477 * It is a handler who processes the HR tag.
1479 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1480 * destination is specified.
1481 * @param node [i] The HR tag node is specified.
1482 * @return The conversion result is returned.
1485 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1487 xhtml_t *xhtml = GET_XHTML(pdoc);
1488 Doc *doc = xhtml->doc;
1493 for (attr = qs_get_attr(doc,node);
1495 attr = qs_get_next_attr(doc,attr)) {
1496 char *name = qs_get_attr_name(doc,attr);
1497 char *value = qs_get_attr_value(doc,attr);
1498 if (STRCASEEQ('a','A',"align", name)) {
1499 /*----------------------------------------------------------------------*/
1501 /*----------------------------------------------------------------------*/
1502 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1508 else if (STRCASEEQ('s','S',"size", name)) {
1509 /*----------------------------------------------------------------------*/
1511 /*----------------------------------------------------------------------*/
1512 if (value && *value) {
1518 else if (STRCASEEQ('w','W',"width", name)) {
1519 /*----------------------------------------------------------------------*/
1521 /*----------------------------------------------------------------------*/
1522 if (value && *value) {
1528 else if (STRCASEEQ('n','N',"noshade", name)) {
1529 /*----------------------------------------------------------------------*/
1531 /*----------------------------------------------------------------------*/
1534 else if (STRCASEEQ('c','C',"color", name)) {
1535 /*----------------------------------------------------------------------*/
1537 /*----------------------------------------------------------------------*/
1547 * It is a handler who processes the HR tag.
1549 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1550 * destination is specified.
1551 * @param node [i] The HR tag node is specified.
1552 * @return The conversion result is returned.
1555 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1557 xhtml_t *xhtml = GET_XHTML(pdoc);
1564 * It is a handler who processes the PRE tag.
1566 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1567 * destination is specified.
1568 * @param node [i] The PRE tag node is specified.
1569 * @return The conversion result is returned.
1572 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1574 xhtml_t *xhtml = GET_XHTML(pdoc);
1575 Doc *doc = xhtml->doc;
1584 * It is a handler who processes the PRE tag.
1586 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1587 * destination is specified.
1588 * @param node [i] The PRE tag node is specified.
1589 * @return The conversion result is returned.
1592 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1594 xhtml_t *xhtml = GET_XHTML(pdoc);
1595 Doc *doc = xhtml->doc;
1605 * It is a handler who processes the P tag.
1607 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1608 * destination is specified.
1609 * @param node [i] The P tag node is specified.
1610 * @return The conversion result is returned.
1613 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1615 xhtml_t *xhtml = GET_XHTML(pdoc);
1616 Doc *doc = xhtml->doc;
1621 for (attr = qs_get_attr(doc,node);
1623 attr = qs_get_next_attr(doc,attr)) {
1624 char *nm = qs_get_attr_name(doc,attr);
1625 char *val = qs_get_attr_value(doc,attr);
1626 if (STRCASEEQ('a','A',"align", nm)) {
1627 /*----------------------------------------------------------------------*/
1628 /* CHTML 1.0 (W3C version 3.2) */
1629 /*----------------------------------------------------------------------*/
1630 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1631 align = apr_pstrdup(doc->buf.pool, val);
1647 * It is a handler who processes the P tag.
1649 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1650 * destination is specified.
1651 * @param node [i] The P tag node is specified.
1652 * @return The conversion result is returned.
1655 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1657 xhtml_t *xhtml = GET_XHTML(pdoc);
1658 Doc *doc = xhtml->doc;
1666 * It is a handler who processes the UL tag.
1668 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1669 * destination is specified.
1670 * @param node [i] The UL tag node is specified.
1671 * @return The conversion result is returned.
1674 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *UNUSED(node))
1676 xhtml_t *xhtml = GET_XHTML(pdoc);
1677 Doc *doc = xhtml->doc;
1685 * It is a handler who processes the UL tag.
1687 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1688 * destination is specified.
1689 * @param node [i] The UL tag node is specified.
1690 * @return The conversion result is returned.
1693 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1695 xhtml_t *xhtml = GET_XHTML(pdoc);
1696 Doc *doc = xhtml->doc;
1704 * It is a handler who processes the H1 tag.
1706 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1707 * destination is specified.
1708 * @param node [i] The H1 tag node is specified.
1709 * @return The conversion result is returned.
1712 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1714 xhtml_t *xhtml = GET_XHTML(pdoc);
1715 Doc *doc = xhtml->doc;
1719 for (attr = qs_get_attr(doc,node);
1721 attr = qs_get_next_attr(doc,attr)) {
1724 name = qs_get_attr_name(doc,attr);
1725 value = qs_get_attr_value(doc,attr);
1726 if (STRCASEEQ('a','A',"align", name)) {
1728 if (STRCASEEQ('l','L',"left",value)) {
1730 W_L("text-align:left");
1733 else if (STRCASEEQ('r','R',"right",value)) {
1735 W_L("text-align:right");
1738 else if (STRCASEEQ('c','C',"center",value)) {
1740 W_L("text-align:center");
1753 * It is a handler who processes the H1 tag.
1755 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1756 * destination is specified.
1757 * @param node [i] The H1 tag node is specified.
1758 * @return The conversion result is returned.
1761 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1763 xhtml_t *xhtml = GET_XHTML(pdoc);
1764 Doc *doc = xhtml->doc;
1772 * It is a handler who processes the H2 tag.
1774 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1775 * destination is specified.
1776 * @param node [i] The H2 tag node is specified.
1777 * @return The conversion result is returned.
1780 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1782 xhtml_t *xhtml = GET_XHTML(pdoc);
1783 Doc *doc = xhtml->doc;
1787 for (attr = qs_get_attr(doc,node);
1789 attr = qs_get_next_attr(doc,attr)) {
1792 name = qs_get_attr_name(doc,attr);
1793 value = qs_get_attr_value(doc,attr);
1794 if (STRCASEEQ('a','A',"align", name)) {
1796 if (STRCASEEQ('l','L',"left",value)) {
1798 W_L("text-align:left");
1801 else if (STRCASEEQ('r','R',"right",value)) {
1803 W_L("text-align:right");
1806 else if (STRCASEEQ('c','C',"center",value)) {
1808 W_L("text-align:center");
1821 * It is a handler who processes the H2 tag.
1823 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1824 * destination is specified.
1825 * @param node [i] The H2 tag node is specified.
1826 * @return The conversion result is returned.
1829 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1831 xhtml_t *xhtml = GET_XHTML(pdoc);
1832 Doc *doc = xhtml->doc;
1840 * It is a handler who processes the H3 tag.
1842 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1843 * destination is specified.
1844 * @param node [i] The H3 tag node is specified.
1845 * @return The conversion result is returned.
1848 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1850 xhtml_t *xhtml = GET_XHTML(pdoc);
1851 Doc *doc = xhtml->doc;
1855 for (attr = qs_get_attr(doc,node);
1857 attr = qs_get_next_attr(doc,attr)) {
1860 name = qs_get_attr_name(doc,attr);
1861 value = qs_get_attr_value(doc,attr);
1862 if (STRCASEEQ('a','A',"align", name)) {
1864 if (STRCASEEQ('l','L',"left",value)) {
1866 W_L("text-align:left");
1869 else if (STRCASEEQ('r','R',"right",value)) {
1871 W_L("text-align:right");
1874 else if (STRCASEEQ('c','C',"center",value)) {
1876 W_L("text-align:center");
1889 * It is a handler who processes the H3 tag.
1891 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1892 * destination is specified.
1893 * @param node [i] The H3 tag node is specified.
1894 * @return The conversion result is returned.
1897 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
1899 xhtml_t *xhtml = GET_XHTML(pdoc);
1900 Doc *doc = xhtml->doc;
1908 * It is a handler who processes the H4 tag.
1910 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1911 * destination is specified.
1912 * @param node [i] The H4 tag node is specified.
1913 * @return The conversion result is returned.
1916 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
1918 xhtml_t *xhtml = GET_XHTML(pdoc);
1919 Doc *doc = xhtml->doc;
1923 for (attr = qs_get_attr(doc,node);
1925 attr = qs_get_next_attr(doc,attr)) {
1928 name = qs_get_attr_name(doc,attr);
1929 value = qs_get_attr_value(doc,attr);
1930 if (STRCASEEQ('a','A',"align", name)) {
1932 if (STRCASEEQ('l','L',"left",value)) {
1934 W_L("text-align:left");
1937 else if (STRCASEEQ('r','R',"right",value)) {
1939 W_L("text-align:right");
1942 else if (STRCASEEQ('c','C',"center",value)) {
1944 W_L("text-align:center");
1957 * It is a handler who processes the H4 tag.
1959 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1960 * destination is specified.
1961 * @param node [i] The H4 tag node is specified.
1962 * @return The conversion result is returned.
1965 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
1967 xhtml_t *xhtml = GET_XHTML(pdoc);
1968 Doc *doc = xhtml->doc;
1976 * It is a handler who processes the H5 tag.
1978 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1979 * destination is specified.
1980 * @param node [i] The H5 tag node is specified.
1981 * @return The conversion result is returned.
1984 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
1986 xhtml_t *xhtml = GET_XHTML(pdoc);
1987 Doc *doc = xhtml->doc;
1991 for (attr = qs_get_attr(doc,node);
1993 attr = qs_get_next_attr(doc,attr)) {
1996 name = qs_get_attr_name(doc,attr);
1997 value = qs_get_attr_value(doc,attr);
1998 if (STRCASEEQ('a','A',"align", name)) {
2000 if (STRCASEEQ('l','L',"left",value)) {
2002 W_L("text-align:left");
2005 else if (STRCASEEQ('r','R',"right",value)) {
2007 W_L("text-align:right");
2010 else if (STRCASEEQ('c','C',"center",value)) {
2012 W_L("text-align:center");
2025 * It is a handler who processes the H5 tag.
2027 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2028 * destination is specified.
2029 * @param node [i] The H5 tag node is specified.
2030 * @return The conversion result is returned.
2033 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2035 xhtml_t *xhtml = GET_XHTML(pdoc);
2036 Doc *doc = xhtml->doc;
2044 * It is a handler who processes the H6 tag.
2046 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2047 * destination is specified.
2048 * @param node [i] The H6 tag node is specified.
2049 * @return The conversion result is returned.
2052 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2054 xhtml_t *xhtml = GET_XHTML(pdoc);
2055 Doc *doc = xhtml->doc;
2059 for (attr = qs_get_attr(doc,node);
2061 attr = qs_get_next_attr(doc,attr)) {
2064 name = qs_get_attr_name(doc,attr);
2065 value = qs_get_attr_value(doc,attr);
2066 if (STRCASEEQ('a','A',"align", name)) {
2068 if (STRCASEEQ('l','L',"left",value)) {
2070 W_L("text-align:left");
2073 else if (STRCASEEQ('r','R',"right",value)) {
2075 W_L("text-align:right");
2078 else if (STRCASEEQ('c','C',"center",value)) {
2080 W_L("text-align:center");
2093 * It is a handler who processes the H6 tag.
2095 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2096 * destination is specified.
2097 * @param node [i] The H6 tag node is specified.
2098 * @return The conversion result is returned.
2101 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2103 xhtml_t *xhtml = GET_XHTML(pdoc);
2104 Doc *doc = xhtml->doc;
2112 * It is a handler who processes the OL tag.
2114 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2115 * destination is specified.
2116 * @param node [i] The OL tag node is specified.
2117 * @return The conversion result is returned.
2120 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2122 xhtml_t *xhtml = GET_XHTML(pdoc);
2123 Doc *doc = xhtml->doc;
2127 /*--------------------------------------------------------------------------*/
2128 /* Get Attributes */
2129 /*--------------------------------------------------------------------------*/
2130 for (attr = qs_get_attr(doc,node);
2132 attr = qs_get_next_attr(doc,attr)) {
2133 char *name = qs_get_attr_name(doc,attr);
2134 char *value = qs_get_attr_value(doc,attr);
2135 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2140 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2152 * It is a handler who processes the OL tag.
2154 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2155 * destination is specified.
2156 * @param node [i] The OL tag node is specified.
2157 * @return The conversion result is returned.
2160 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2162 xhtml_t *xhtml = GET_XHTML(pdoc);
2163 Doc *doc = xhtml->doc;
2171 * It is a handler who processes the LI tag.
2173 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2174 * destination is specified.
2175 * @param node [i] The LI tag node is specified.
2176 * @return The conversion result is returned.
2179 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2181 xhtml_t *xhtml = GET_XHTML(pdoc);
2182 Doc *doc = xhtml->doc;
2186 /*--------------------------------------------------------------------------*/
2187 /* Get Attributes */
2188 /*--------------------------------------------------------------------------*/
2189 for (attr = qs_get_attr(doc,node);
2191 attr = qs_get_next_attr(doc,attr)) {
2192 char *name = qs_get_attr_name(doc,attr);
2193 char *value = qs_get_attr_value(doc,attr);
2194 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2199 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2211 ** It is a handler who processes the LI tag.
2213 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2214 * destination is specified.
2215 * @param node [i] The LI tag node is specified.
2216 * @return The conversion result is returned.
2219 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2221 xhtml_t *xhtml = GET_XHTML(pdoc);
2222 Doc *doc = xhtml->doc;
2229 * It is a handler who processes the IMG tag.
2231 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2232 * destination is specified.
2233 * @param node [i] The IMG tag node is specified.
2234 * @return The conversion result is returned.
2237 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2239 xhtml_t *xhtml = GET_XHTML(pdoc);
2240 Doc *doc = xhtml->doc;
2241 request_rec *r = doc->r;
2244 #ifndef IMG_NOT_CONVERT_FILENAME
2245 device_table *spec = xhtml->spec;
2249 /*--------------------------------------------------------------------------*/
2250 /* Get Attributes */
2251 /*--------------------------------------------------------------------------*/
2252 for (attr = qs_get_attr(doc,node);
2254 attr = qs_get_next_attr(doc,attr)) {
2255 char *name = qs_get_attr_name(doc,attr);
2256 char *value = qs_get_attr_value(doc,attr);
2258 if (STRCASEEQ('s','S',"src",name)) {
2259 value = chxj_encoding_parameter(r, value);
2260 #ifdef IMG_NOT_CONVERT_FILENAME
2270 char *vv = chxj_img_conv(r,spec,value);
2278 if (STRCASEEQ('a','A',"align",name)) {
2279 if (value && (STRCASEEQ('t','T',"top", value) ||
2280 STRCASEEQ('m','M',"middle",value) ||
2281 STRCASEEQ('b','B',"bottom",value) ||
2282 STRCASEEQ('l','L',"left", value) ||
2283 STRCASEEQ('r','R',"right", value))) {
2289 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2294 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2299 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2304 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2309 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2321 * It is a handler who processes the IMG tag.
2323 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2324 * destination is specified.
2325 * @param node [i] The IMG tag node is specified.
2326 * @return The conversion result is returned.
2329 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2331 xhtml_t *xhtml = GET_XHTML(pdoc);
2338 * It is a handler who processes the SELECT tag.
2340 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2341 * destination is specified.
2342 * @param node [i] The SELECT tag node is specified.
2343 * @return The conversion result is returned.
2346 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2348 xhtml_t *xhtml = GET_XHTML(pdoc);
2349 Doc *doc = xhtml->doc;
2352 char *multiple = NULL;
2357 for (attr = qs_get_attr(doc,child);
2359 attr = qs_get_next_attr(doc,attr)) {
2360 char *nm = qs_get_attr_name(doc,attr);
2361 char *val = qs_get_attr_value(doc,attr);
2362 if (STRCASEEQ('s','S',"size",nm)) {
2363 /*----------------------------------------------------------------------*/
2364 /* CHTML 1.0 version 2.0 */
2365 /*----------------------------------------------------------------------*/
2366 size = apr_pstrdup(doc->buf.pool, val);
2368 else if (STRCASEEQ('n','N',"name",nm)) {
2369 /*----------------------------------------------------------------------*/
2370 /* CHTML 1.0 version 2.0 */
2371 /*----------------------------------------------------------------------*/
2372 name = apr_pstrdup(doc->buf.pool, val);
2374 else if (STRCASEEQ('m','M',"multiple",nm)) {
2375 /*----------------------------------------------------------------------*/
2376 /* CHTML 1.0 version 2.0 */
2377 /*----------------------------------------------------------------------*/
2378 multiple = apr_pstrdup(doc->buf.pool, val);
2381 if (size && *size) {
2386 if (name && *name) {
2392 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2393 W_L(" multiple=\"true\"");
2401 * It is a handler who processes the SELECT tag.
2403 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2404 * destination is specified.
2405 * @param node [i] The SELECT tag node is specified.
2406 * @return The conversion result is returned.
2409 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2411 xhtml_t *xhtml = GET_XHTML(pdoc);
2412 Doc *doc = xhtml->doc;
2414 W_L("</select>\r\n");
2420 * It is a handler who processes the OPTION tag.
2422 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2423 * destination is specified.
2424 * @param node [i] The OPTION tag node is specified.
2425 * @return The conversion result is returned.
2428 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2430 xhtml_t *xhtml = GET_XHTML(pdoc);
2431 Doc *doc = xhtml->doc;
2434 char *selected = NULL;
2438 for (attr = qs_get_attr(doc,child);
2440 attr = qs_get_next_attr(doc,attr)) {
2441 char *nm = qs_get_attr_name(doc,attr);
2442 char *val = qs_get_attr_value(doc,attr);
2443 if (STRCASEEQ('s','S',"selected",nm)) {
2444 /* CHTML version 2.0 */
2445 selected = apr_pstrdup(doc->buf.pool, val);
2447 else if (STRCASEEQ('v','V',"value",nm)) {
2448 /* CHTML version 2.0 */
2449 value = apr_pstrdup(doc->buf.pool, val);
2452 if (value && *value) {
2458 W_L(" selected=\"selected\"");
2466 * It is a handler who processes the OPTION tag.
2468 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2469 * destination is specified.
2470 * @param node [i] The OPTION tag node is specified.
2471 * @return The conversion result is returned.
2474 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2476 xhtml_t *xhtml = GET_XHTML(pdoc);
2477 Doc *doc = xhtml->doc;
2479 W_L("</option>\r\n");
2485 * It is a handler who processes the DIV tag.
2487 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2488 * destination is specified.
2489 * @param node [i] The DIV tag node is specified.
2490 * @return The conversion result is returned.
2493 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2495 xhtml_t *xhtml = GET_XHTML(pdoc);
2496 Doc *doc = xhtml->doc;
2501 for (attr = qs_get_attr(doc,child);
2503 attr = qs_get_next_attr(doc,attr)) {
2504 char *nm = qs_get_attr_name(doc,attr);
2505 char *val = qs_get_attr_value(doc,attr);
2506 if (STRCASEEQ('a','A',"align",nm)) {
2507 /*=====================================================================*/
2508 /* CHTML version 3.2 */
2509 /*=====================================================================*/
2510 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2511 align = apr_pstrdup(doc->buf.pool, val);
2526 * It is a handler who processes the DIV tag.
2528 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2529 * destination is specified.
2530 * @param node [i] The DIV tag node is specified.
2531 * @return The conversion result is returned.
2534 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2536 xhtml_t *xhtml = GET_XHTML(pdoc);
2537 Doc *doc = xhtml->doc;
2544 * It is a handler who processes the B tag.
2546 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2547 * destination is specified.
2548 * @param node [i] The B tag node is specified.
2549 * @return The conversion result is returned.
2552 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2554 xhtml_t *xhtml = GET_XHTML(pdoc);
2555 Doc *doc = xhtml->doc;
2557 W_L("<div style=\"font-weight:bold\">");
2563 * It is a handler who processes the B tag.
2565 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2566 * destination is specified.
2567 * @param node [i] The B tag node is specified.
2568 * @return The conversion result is returned.
2571 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2573 xhtml_t *xhtml = GET_XHTML(pdoc);
2574 Doc *doc = xhtml->doc;
2582 * It is a handler who processes the CHXJ:IF tag.
2584 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2585 * destination is specified.
2586 * @param node [i] The CHXJ:IF tag node is specified.
2589 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2591 xhtml_t *xhtml = GET_XHTML(pdoc);
2592 Doc *doc = xhtml->doc;
2595 for (child = qs_get_child_node(doc, node);
2597 child = qs_get_next_node(doc, child)) {
2599 s_xhtml_1_0_chxjif_tag(xhtml, child);
2607 * It is a handler who processes the TEXTARE tag.
2609 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2610 * destination is specified.
2611 * @param node [i] The TEXTAREA tag node is specified.
2612 * @return The conversion result is returned.
2615 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2617 xhtml_t *xhtml = GET_XHTML(pdoc);
2618 Doc *doc = xhtml->doc;
2621 xhtml->textarea_flag++;
2623 for (attr = qs_get_attr(doc,node);
2625 attr = qs_get_next_attr(doc,attr)) {
2626 char *name = qs_get_attr_name(doc,attr);
2627 char *value = qs_get_attr_value(doc,attr);
2628 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2633 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2638 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2643 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2644 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2649 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2650 W_L(" accesskey=\"");
2661 * It is a handler who processes the TEXTAREA tag.
2663 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2664 * destination is specified.
2665 * @param node [i] The TEXTAREA tag node is specified.
2666 * @return The conversion result is returned.
2669 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2671 xhtml_t *xhtml = GET_XHTML(pdoc);
2672 Doc *doc = xhtml->doc;
2674 W_L("</textarea>\r\n");
2675 xhtml->textarea_flag--;
2681 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2683 xhtml_t *xhtml = GET_XHTML(pdoc);
2684 Doc *doc = xhtml->doc;
2685 request_rec *r = doc->r;
2693 textval = qs_get_node_value(doc,child);
2694 if (strlen(textval) == 0) {
2698 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2699 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2701 tdst = qs_alloc_zero_byte_string(r);
2702 memset(one_byte, 0, sizeof(one_byte));
2705 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2707 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2709 DBG(r,"[%s][%d]", out, rtn);
2710 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2714 if (is_sjis_kanji(textval[ii])) {
2715 one_byte[0] = textval[ii+0];
2716 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2717 one_byte[0] = textval[ii+1];
2718 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2721 else if (xhtml->pre_flag) {
2722 one_byte[0] = textval[ii+0];
2723 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2725 else if (xhtml->textarea_flag) {
2726 one_byte[0] = textval[ii+0];
2727 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2729 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2730 one_byte[0] = textval[ii+0];
2731 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2740 * It is a handler who processes the BLOCKQUOTE tag.
2742 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2743 * destination is specified.
2744 * @param node [i] The BLOCKQUOTE tag node is specified.
2745 * @return The conversion result is returned.
2748 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2750 xhtml_t *xhtml = GET_XHTML(pdoc);
2751 Doc *doc = xhtml->doc;
2752 W_L("<blockquote>");
2758 * It is a handler who processes the BLOCKQUOTE tag.
2760 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2761 * destination is specified.
2762 * @param node [i] The BLOCKQUOTE tag node is specified.
2763 * @return The conversion result is returned.
2766 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2768 xhtml_t *xhtml = GET_XHTML(pdoc);
2769 Doc *doc = xhtml->doc;
2770 W_L("</blockquote>");
2776 * It is a handler who processes the DIR tag.
2778 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2779 * destination is specified.
2780 * @param node [i] The DIR tag node is specified.
2781 * @return The conversion result is returned.
2784 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *UNUSED(child))
2786 xhtml_t *xhtml = GET_XHTML(pdoc);
2787 Doc *doc = xhtml->doc;
2794 * It is a handler who processes the DIR tag.
2796 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2797 * destination is specified.
2798 * @param node [i] The DIR tag node is specified.
2799 * @return The conversion result is returned.
2802 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2804 xhtml_t *xhtml = GET_XHTML(pdoc);
2805 Doc *doc = xhtml->doc;
2812 * It is a handler who processes the DL tag.
2814 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2815 * destination is specified.
2816 * @param node [i] The DL tag node is specified.
2817 * @return The conversion result is returned.
2820 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2822 xhtml_t *xhtml = GET_XHTML(pdoc);
2823 Doc *doc = xhtml->doc;
2830 * It is a handler who processes the DL tag.
2832 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2833 * destination is specified.
2834 * @param node [i] The DL tag node is specified.
2835 * @return The conversion result is returned.
2838 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2840 xhtml_t *xhtml = GET_XHTML(pdoc);
2841 Doc *doc = xhtml->doc;
2848 * It is a handter who processes the DT tag.
2850 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2851 * destination is specified.
2852 * @param node [i] The DT tag node is specified.
2853 * @return The conversion result is returned.
2856 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
2858 xhtml_t *xhtml = GET_XHTML(pdoc);
2859 Doc *doc = xhtml->doc;
2866 * It is a handter who processes the DT tag.
2868 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2869 * destination is specified.
2870 * @param node [i] The DT tag node is specified.
2871 * @return The conversion result is returned.
2874 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
2876 xhtml_t *xhtml = GET_XHTML(pdoc);
2877 Doc *doc = xhtml->doc;
2884 * It is a handder who processes the DD tag.
2886 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2887 * destination is specified.
2888 * @param node [i] The DD tag node is specified.
2889 * @return The conversion result is returned.
2892 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
2894 xhtml_t *xhtml = GET_XHTML(pdoc);
2895 Doc *doc = xhtml->doc;
2902 * It is a handder who processes the DD tag.
2904 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2905 * destination is specified.
2906 * @param node [i] The DD tag node is specified.
2907 * @return The conversion result is returned.
2910 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
2912 xhtml_t *xhtml = GET_XHTML(pdoc);
2913 Doc *doc = xhtml->doc;
2920 * It is a handler who processes the MENU tag.
2922 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2923 * destination is specified.
2924 * @param node [i] The MENU tag node is specified.
2925 * @return The conversion result is returned.
2928 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *UNUSED(child))
2932 xhtml = GET_XHTML(pdoc);
2940 * It is a hanmenuer who processes the MENU tag.
2942 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2943 * destination is specified.
2944 * @param node [i] The MENU tag node is specified.
2945 * @return The conversion result is returned.
2948 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
2950 xhtml_t *xhtml = GET_XHTML(pdoc);
2951 Doc *doc = xhtml->doc;
2958 * It is a handler who processes the PLAINTEXT tag.
2960 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2961 * destination is specified.
2962 * @param node [i] The PLAINTEXT tag node is specified.
2963 * @return The conversion result is returned.
2966 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
2968 xhtml_t *xhtml = GET_XHTML(pdoc);
2969 Doc *doc = xhtml->doc;
2971 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
2976 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
2978 xhtml_t *xhtml = GET_XHTML(pdoc);
2979 Doc *doc = xhtml->doc;
2981 for (child = qs_get_child_node(doc, node);
2983 child = qs_get_next_node(doc, child)) {
2985 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
2992 * It is a handler who processes the PLAINTEXT tag.
2994 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2995 * destination is specified.
2996 * @param node [i] The PLAINTEXT tag node is specified.
2997 * @return The conversion result is returned.
3000 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3002 xhtml_t *xhtml = GET_XHTML(pdoc);
3003 Doc *doc = xhtml->doc;
3004 W_L("</plaintext>");
3010 * It is a hanblinker who processes the BLINK tag.
3012 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3013 * destination is specified.
3014 * @param node [i] The BLINK tag node is specified.
3015 * @return The conversion result is returned.
3018 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3020 xhtml_t *xhtml = GET_XHTML(pdoc);
3021 Doc *doc = xhtml->doc;
3028 * It is a hanblinker who processes the BLINK tag.
3030 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3031 * destination is specified.
3032 * @param node [i] The BLINK tag node is specified.
3033 * @return The conversion result is returned.
3036 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3038 xhtml_t *xhtml = GET_XHTML(pdoc);
3039 Doc *doc = xhtml->doc;
3046 * It is a handler who processes the MARQUEE tag.
3048 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3049 * destination is specified.
3050 * @param node [i] The MARQUEE tag node is specified.
3051 * @return The conversion result is returned.
3054 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3056 xhtml_t *xhtml = GET_XHTML(pdoc);
3057 Doc *doc = xhtml->doc;
3060 /*--------------------------------------------------------------------------*/
3061 /* Get Attributes */
3062 /*--------------------------------------------------------------------------*/
3063 for (attr = qs_get_attr(doc,node);
3065 attr = qs_get_next_attr(doc,attr)) {
3066 char *name = qs_get_attr_name(doc,attr);
3067 char *value = qs_get_attr_value(doc,attr);
3068 if (STRCASEEQ('d','D',"direction", name)) {
3069 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3070 W_L(" direction=\"");
3075 else if (STRCASEEQ('b','B',"behavior",name)) {
3076 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3077 W_L(" behavior=\"");
3082 else if (STRCASEEQ('l','L',"loop",name)) {
3083 if (value && *value) {
3096 * It is a handler who processes the MARQUEE tag.
3098 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3099 * destination is specified.
3100 * @param node [i] The MARQUEE tag node is specified.
3101 * @return The conversion result is returned.
3104 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3106 xhtml_t *xhtml = GET_XHTML(pdoc);
3107 Doc *doc = xhtml->doc;