2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_encoding.h"
19 #include "chxj_xhtml_mobile_1_0.h"
20 #include "chxj_hdml.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_buffered_write.h"
25 #include "chxj_str_util.h"
27 #define GET_XHTML(X) ((xhtml_t*)(X))
30 #define W_L(X) do { xhtml->out = BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { xhtml->out = (X) ? BUFFERED_WRITE_VALUE(xhtml->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(xhtml->out, &doc->buf, ""); } while(0)
34 #define W_NLCODE() do { char *nlcode = TO_NLCODE(xhtml->conf); W_V(nlcode); } while (0)
36 static char *s_xhtml_1_0_start_html_tag (void *pdoc, Node *node);
37 static char *s_xhtml_1_0_end_html_tag (void *pdoc, Node *node);
38 static char *s_xhtml_1_0_start_p_tag (void *pdoc, Node *node);
39 static char *s_xhtml_1_0_end_p_tag (void *pdoc, Node *node);
40 static char *s_xhtml_1_0_start_pre_tag (void *pdoc, Node *node);
41 static char *s_xhtml_1_0_end_pre_tag (void *pdoc, Node *node);
42 static char *s_xhtml_1_0_start_ul_tag (void *pdoc, Node *node);
43 static char *s_xhtml_1_0_end_ul_tag (void *pdoc, Node *node);
44 static char *s_xhtml_1_0_start_h1_tag (void *pdoc, Node *node);
45 static char *s_xhtml_1_0_end_h1_tag (void *pdoc, Node *node);
46 static char *s_xhtml_1_0_start_h2_tag (void *pdoc, Node *node);
47 static char *s_xhtml_1_0_end_h2_tag (void *pdoc, Node *node);
48 static char *s_xhtml_1_0_start_h3_tag (void *pdoc, Node *node);
49 static char *s_xhtml_1_0_end_h3_tag (void *pdoc, Node *node);
50 static char *s_xhtml_1_0_start_h4_tag (void *pdoc, Node *node);
51 static char *s_xhtml_1_0_end_h4_tag (void *pdoc, Node *node);
52 static char *s_xhtml_1_0_start_h5_tag (void *pdoc, Node *node);
53 static char *s_xhtml_1_0_end_h5_tag (void *pdoc, Node *node);
54 static char *s_xhtml_1_0_start_h6_tag (void *pdoc, Node *node);
55 static char *s_xhtml_1_0_end_h6_tag (void *pdoc, Node *node);
56 static char *s_xhtml_1_0_start_ol_tag (void *pdoc, Node *node);
57 static char *s_xhtml_1_0_end_ol_tag (void *pdoc, Node *node);
58 static char *s_xhtml_1_0_start_li_tag (void *pdoc, Node *node);
59 static char *s_xhtml_1_0_end_li_tag (void *pdoc, Node *node);
60 static char *s_xhtml_1_0_start_meta_tag (void *pdoc, Node *node);
61 static char *s_xhtml_1_0_end_meta_tag (void *pdoc, Node *node);
62 static char *s_xhtml_1_0_start_head_tag (void *pdoc, Node *node);
63 static char *s_xhtml_1_0_end_head_tag (void *pdoc, Node *node);
64 static char *s_xhtml_1_0_start_title_tag (void *pdoc, Node *node);
65 static char *s_xhtml_1_0_end_title_tag (void *pdoc, Node *node);
66 static char *s_xhtml_1_0_start_base_tag (void *pdoc, Node *node);
67 static char *s_xhtml_1_0_end_base_tag (void *pdoc, Node *node);
68 static char *s_xhtml_1_0_start_body_tag (void *pdoc, Node *node);
69 static char *s_xhtml_1_0_end_body_tag (void *pdoc, Node *node);
70 static char *s_xhtml_1_0_start_a_tag (void *pdoc, Node *node);
71 static char *s_xhtml_1_0_end_a_tag (void *pdoc, Node *node);
72 static char *s_xhtml_1_0_start_br_tag (void *pdoc, Node *node);
73 static char *s_xhtml_1_0_end_br_tag (void *pdoc, Node *node);
74 static char *s_xhtml_1_0_start_tr_tag (void *pdoc, Node *node);
75 static char *s_xhtml_1_0_end_tr_tag (void *pdoc, Node *node);
76 static char *s_xhtml_1_0_start_font_tag (void *pdoc, Node *node);
77 static char *s_xhtml_1_0_end_font_tag (void *pdoc, Node *node);
78 static char *s_xhtml_1_0_start_form_tag (void *pdoc, Node *node);
79 static char *s_xhtml_1_0_end_form_tag (void *pdoc, Node *node);
80 static char *s_xhtml_1_0_start_input_tag (void *pdoc, Node *node);
81 static char *s_xhtml_1_0_end_input_tag (void *pdoc, Node *node);
82 static char *s_xhtml_1_0_start_center_tag (void *pdoc, Node *node);
83 static char *s_xhtml_1_0_end_center_tag (void *pdoc, Node *node);
84 static char *s_xhtml_1_0_start_hr_tag (void *pdoc, Node *node);
85 static char *s_xhtml_1_0_end_hr_tag (void *pdoc, Node *node);
86 static char *s_xhtml_1_0_start_img_tag (void *pdoc, Node *node);
87 static char *s_xhtml_1_0_end_img_tag (void *pdoc, Node *node);
88 static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
89 static char *s_xhtml_1_0_end_select_tag (void *pdoc, Node *node);
90 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
91 static char *s_xhtml_1_0_end_option_tag (void *pdoc, Node *node);
92 static char *s_xhtml_1_0_start_div_tag (void *pdoc, Node *node);
93 static char *s_xhtml_1_0_end_div_tag (void *pdoc, Node *node);
94 static char *s_xhtml_1_0_start_textarea_tag (void *pdoc, Node *node);
95 static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
96 static char *s_xhtml_1_0_start_b_tag (void *pdoc, Node *node);
97 static char *s_xhtml_1_0_end_b_tag (void *pdoc, Node *node);
98 static char *s_xhtml_1_0_chxjif_tag (void *pdoc, Node *node);
99 static char *s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *node);
100 static char *s_xhtml_1_0_end_blockquote_tag (void *pdoc, Node *node);
101 static char *s_xhtml_1_0_start_dir_tag (void *pdoc, Node *node);
102 static char *s_xhtml_1_0_end_dir_tag (void *pdoc, Node *node);
103 static char *s_xhtml_1_0_start_dl_tag (void *pdoc, Node *node);
104 static char *s_xhtml_1_0_end_dl_tag (void *pdoc, Node *node);
105 static char *s_xhtml_1_0_start_dt_tag (void *pdoc, Node *node);
106 static char *s_xhtml_1_0_end_dt_tag (void *pdoc, Node *node);
107 static char *s_xhtml_1_0_start_dd_tag (void *pdoc, Node *node);
108 static char *s_xhtml_1_0_end_dd_tag (void *pdoc, Node *node);
109 static char *s_xhtml_1_0_start_menu_tag (void *pdoc, Node *node);
110 static char *s_xhtml_1_0_end_menu_tag (void *pdoc, Node *node);
111 static char *s_xhtml_1_0_start_plaintext_tag (void *pdoc, Node *node);
112 static char *s_xhtml_1_0_start_plaintext_tag_inner (void *pdoc, Node *node);
113 static char *s_xhtml_1_0_end_plaintext_tag (void *pdoc, Node *node);
114 static char *s_xhtml_1_0_start_blink_tag (void *pdoc, Node *node);
115 static char *s_xhtml_1_0_end_blink_tag (void *pdoc, Node *node);
116 static char *s_xhtml_1_0_start_marquee_tag (void *pdoc, Node *node);
117 static char *s_xhtml_1_0_end_marquee_tag (void *pdoc, Node *node);
119 static void s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
120 static int s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
121 static char *s_xhtml_1_0_text_tag(void *pdoc, Node *child);
124 tag_handler xhtml_handler[] = {
127 s_xhtml_1_0_start_html_tag,
128 s_xhtml_1_0_end_html_tag,
132 s_xhtml_1_0_start_meta_tag,
133 s_xhtml_1_0_end_meta_tag,
137 s_xhtml_1_0_start_textarea_tag,
138 s_xhtml_1_0_end_textarea_tag,
142 s_xhtml_1_0_start_p_tag,
143 s_xhtml_1_0_end_p_tag,
147 s_xhtml_1_0_start_pre_tag,
148 s_xhtml_1_0_end_pre_tag,
152 s_xhtml_1_0_start_ul_tag,
153 s_xhtml_1_0_end_ul_tag,
157 s_xhtml_1_0_start_li_tag,
158 s_xhtml_1_0_end_li_tag,
162 s_xhtml_1_0_start_ol_tag,
163 s_xhtml_1_0_end_ol_tag,
167 s_xhtml_1_0_start_h1_tag,
168 s_xhtml_1_0_end_h1_tag,
172 s_xhtml_1_0_start_h2_tag,
173 s_xhtml_1_0_end_h2_tag,
177 s_xhtml_1_0_start_h3_tag,
178 s_xhtml_1_0_end_h3_tag,
182 s_xhtml_1_0_start_h4_tag,
183 s_xhtml_1_0_end_h4_tag,
187 s_xhtml_1_0_start_h5_tag,
188 s_xhtml_1_0_end_h5_tag,
192 s_xhtml_1_0_start_h6_tag,
193 s_xhtml_1_0_end_h6_tag,
197 s_xhtml_1_0_start_head_tag,
198 s_xhtml_1_0_end_head_tag,
202 s_xhtml_1_0_start_title_tag,
203 s_xhtml_1_0_end_title_tag,
207 s_xhtml_1_0_start_base_tag,
208 s_xhtml_1_0_end_base_tag,
212 s_xhtml_1_0_start_body_tag,
213 s_xhtml_1_0_end_body_tag,
217 s_xhtml_1_0_start_a_tag,
218 s_xhtml_1_0_end_a_tag,
222 s_xhtml_1_0_start_br_tag,
223 s_xhtml_1_0_end_br_tag,
232 s_xhtml_1_0_start_tr_tag,
233 s_xhtml_1_0_end_tr_tag,
247 s_xhtml_1_0_start_font_tag,
248 s_xhtml_1_0_end_font_tag,
252 s_xhtml_1_0_start_form_tag,
253 s_xhtml_1_0_end_form_tag,
257 s_xhtml_1_0_start_input_tag,
258 s_xhtml_1_0_end_input_tag,
262 s_xhtml_1_0_start_center_tag,
263 s_xhtml_1_0_end_center_tag,
267 s_xhtml_1_0_start_hr_tag,
268 s_xhtml_1_0_end_hr_tag,
272 s_xhtml_1_0_start_img_tag,
273 s_xhtml_1_0_end_img_tag,
277 s_xhtml_1_0_start_select_tag,
278 s_xhtml_1_0_end_select_tag,
282 s_xhtml_1_0_start_option_tag,
283 s_xhtml_1_0_end_option_tag,
287 s_xhtml_1_0_start_div_tag,
288 s_xhtml_1_0_end_div_tag,
292 s_xhtml_1_0_chxjif_tag,
317 s_xhtml_1_0_text_tag,
327 s_xhtml_1_0_start_b_tag,
328 s_xhtml_1_0_end_b_tag,
337 s_xhtml_1_0_start_dt_tag,
338 s_xhtml_1_0_end_dt_tag,
352 s_xhtml_1_0_start_blockquote_tag,
353 s_xhtml_1_0_end_blockquote_tag,
357 s_xhtml_1_0_start_dir_tag,
358 s_xhtml_1_0_end_dir_tag,
362 s_xhtml_1_0_start_dl_tag,
363 s_xhtml_1_0_end_dl_tag,
367 s_xhtml_1_0_start_dd_tag,
368 s_xhtml_1_0_end_dd_tag,
372 s_xhtml_1_0_start_menu_tag,
373 s_xhtml_1_0_end_menu_tag,
377 s_xhtml_1_0_start_plaintext_tag,
378 s_xhtml_1_0_end_plaintext_tag,
382 s_xhtml_1_0_start_blink_tag,
383 s_xhtml_1_0_end_blink_tag,
387 s_xhtml_1_0_start_marquee_tag,
388 s_xhtml_1_0_end_marquee_tag,
393 * converts from CHTML to XHTML.
395 * @param r [i] Requet_rec is appointed.
396 * @param spec [i] The result of the device specification processing which
397 * was done in advance is appointed.
398 * @param src [i] The character string before the converting is appointed.
399 * @return The character string after the converting is returned.
402 chxj_convert_xhtml_mobile_1_0(
408 chxjconvrule_entry *entryp,
409 cookie_t *UNUSED(cookie)
417 DBG(r,"start chxj_convert_xhtml_mobile_1_0()");
418 /*--------------------------------------------------------------------------*/
420 /*--------------------------------------------------------------------------*/
422 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
424 DBG(r,"end chxj_convert_xhtml_mobile_1_0() (found qrcode.xml)");
428 /*--------------------------------------------------------------------------*/
429 /* The XHTML structure is initialized. */
430 /*--------------------------------------------------------------------------*/
431 s_init_xhtml(&xhtml, &doc, r, spec);
433 xhtml.entryp = entryp;
435 chxj_set_content_type(r, "text/html; charset=Windows-31J");
437 /*--------------------------------------------------------------------------*/
438 /* The character string of the input is analyzed. */
439 /*--------------------------------------------------------------------------*/
440 qs_init_malloc(&doc);
441 qs_init_root_node(&doc);
443 ss = apr_pcalloc(r->pool, srclen + 1);
444 memset(ss, 0, srclen + 1);
445 memcpy(ss, src, srclen);
448 chxj_dump_out("[src] CHTML->XHTML", ss, srclen);
450 qs_parse_string(&doc,ss, strlen(ss));
452 chxj_buffered_write_init(r->pool, &doc.buf);
453 /*--------------------------------------------------------------------------*/
454 /* It converts it from CHTML to XHTML. */
455 /*--------------------------------------------------------------------------*/
456 chxj_node_convert(spec,r,(void *)&xhtml, &doc, qs_get_root(&doc), 0);
457 xhtml.out = chxj_buffered_write_flush(xhtml.out, &doc.buf);
458 dst = apr_pstrdup(r->pool, xhtml.out);
459 chxj_buffered_write_terminate(&doc.buf);
461 qs_all_free(&doc,QX_LOGMARK);
464 return apr_pstrdup(r->pool,ss);
468 dst = apr_psprintf(r->pool, "\n");
470 *dstlen = strlen(dst);
473 chxj_dump_out("[dst] CHTML->XHTML", dst, *dstlen);
476 DBG(r,"end chxj_convert_xhtml_mobile_1_0()");
482 * The XHTML structure is initialized.
484 * @param xhtml [i/o] The pointer to the HDML structure that wants to be
485 * initialized is specified.
486 * @param doc [i] The Doc structure that should be set to the initialized
487 * HDML structure is specified.
488 * @param r [i] To use POOL, the pointer to request_rec is specified.
489 * @param spec [i] The pointer to the device_table
492 s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec)
494 memset(doc, 0, sizeof(Doc));
495 memset(xhtml, 0, sizeof(xhtml_t));
500 xhtml->out = qs_alloc_zero_byte_string(r->pool);
501 xhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
502 xhtml->doc->parse_mode = PARSE_MODE_CHTML;
507 * Corresponding EMOJI to a current character-code is retrieved.
508 * The substitution character string is stored in the rslt pointer if agreeing.
510 * @param xhtml [i] The pointer to the XHTML structure is specified.
511 * @param txt [i] The character string to want to examine whether it is
512 * EMOJI is specified.
513 * @param rslt [o] The pointer to the pointer that stores the result is
515 * @return When corresponding EMOJI exists, it returns it excluding 0.
518 s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt)
531 DBG(r,"spec is NULL");
534 for (ee = xhtml->conf->emoji;
537 unsigned char hex1byte;
538 unsigned char hex2byte;
540 DBG(r,"emoji->imode is NULL");
544 if (ee->imode->string != NULL
545 && strlen(ee->imode->string) > 0
546 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
547 if (spec == NULL || spec->emoji_type == NULL) {
548 *rslt = apr_psprintf(r->pool,
551 return strlen(ee->imode->string);
554 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
555 *rslt = apr_psprintf(r->pool,
558 return strlen(ee->imode->string);
561 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
562 *rslt = apr_psprintf(r->pool,
565 return strlen(ee->imode->string);
568 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
569 *rslt = apr_psprintf(r->pool,
572 return strlen(ee->imode->string);
575 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
576 *rslt = apr_psprintf(r->pool,
579 return strlen(ee->imode->string);
582 *rslt = apr_psprintf(r->pool,
585 return strlen(ee->imode->string);
589 hex1byte = ee->imode->hex1byte & 0xff;
590 hex2byte = ee->imode->hex2byte & 0xff;
592 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
593 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
594 if (spec == NULL || spec->emoji_type == NULL) {
595 *rslt = apr_psprintf(r->pool,
596 "<img localsrc=\"%s\">",
601 if (strcasecmp(xhtml->spec->emoji_type, "a") == 0) {
602 *rslt = apr_psprintf(r->pool,
603 "<img localsrc=\"%s\">",
608 if (strcasecmp(xhtml->spec->emoji_type, "b") == 0) {
609 *rslt = apr_psprintf(r->pool,
610 "<img localsrc=\"%s\">",
615 if (strcasecmp(xhtml->spec->emoji_type, "c") == 0) {
616 *rslt = apr_psprintf(r->pool,
617 "<img localsrc=\"%s\">",
622 if (strcasecmp(xhtml->spec->emoji_type, "d") == 0) {
623 *rslt = apr_psprintf(r->pool,
624 "<img localsrc=\"%s\">",
629 *rslt = apr_psprintf(r->pool,
630 "<img localsrc=\"%s\">",
642 * It is a handler who processes the HTML tag.
644 * @param pdoc [i/o] The pointer to the XHTML structure at the output
645 * destination is specified.
646 * @param node [i] The HTML tag node is specified.
647 * @return The conversion result is returned.
650 s_xhtml_1_0_start_html_tag(void *pdoc, Node *node)
652 xhtml_t *xhtml = GET_XHTML(pdoc);
654 Doc *doc = xhtml->doc;
656 /*--------------------------------------------------------------------------*/
657 /* Add XML Declare */
658 /*--------------------------------------------------------------------------*/
659 W_L("<?xml version=\"1.0\" encoding=\"Windows-31J\"?>");
661 /*--------------------------------------------------------------------------*/
663 /*--------------------------------------------------------------------------*/
664 W_L("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\"");
666 W_L(" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">");
668 /*--------------------------------------------------------------------------*/
670 /*--------------------------------------------------------------------------*/
671 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\"");
672 /*--------------------------------------------------------------------------*/
674 /*--------------------------------------------------------------------------*/
675 for (attr = qs_get_attr(doc,node);
677 attr = qs_get_next_attr(doc,attr)) {
678 char* name = qs_get_attr_name(doc,attr);
679 char* value = qs_get_attr_value(doc,attr);
680 if (STRCASEEQ('l','L',"lang", name)) {
685 else if (STRCASEEQ('v','V',"version", name)) {
686 W_L(" version=\"-//OPENWAVE//DTD XHTML Mobile 1.0//EN\"");
696 * It is a handler who processes the HTML tag.
698 * @param pdoc [i/o] The pointer to the XHTML structure at the output
699 * destination is specified.
700 * @param node [i] The HTML tag node is specified.
701 * @return The conversion result is returned.
704 s_xhtml_1_0_end_html_tag(void *pdoc, Node *UNUSED(child))
706 xhtml_t *xhtml = GET_XHTML(pdoc);
707 Doc *doc = xhtml->doc;
715 * It is a handler who processes the META tag.
717 * @param pdoc [i/o] The pointer to the XHTML structure at the output
718 * destination is specified.
719 * @param node [i] The META tag node is specified.
720 * @return The conversion result is returned.
723 s_xhtml_1_0_start_meta_tag(void *pdoc, Node *node)
725 xhtml_t *xhtml = GET_XHTML(pdoc);
727 Doc *doc = xhtml->doc;
728 int content_type_flag = 0;
731 /*--------------------------------------------------------------------------*/
733 /*--------------------------------------------------------------------------*/
734 for (attr = qs_get_attr(doc,node);
736 attr = qs_get_next_attr(doc,attr)) {
737 char *name = qs_get_attr_name(doc,attr);
738 char *value = qs_get_attr_value(doc,attr);
739 if (STRCASEEQ('n','N',"name", name) && value && *value) {
746 else if (STRCASEEQ('h','H',"http-equiv", name) && value && *value) {
752 if (STRCASEEQ('c','C', "content-type", value)) {
753 content_type_flag = 1;
756 else if (STRCASEEQ('c','C',"content", name) && value && *value) {
757 if (content_type_flag) {
761 W_L("text/html; charset=Windows-31J");
780 * It is a handler who processes the META tag.
782 * @param pdoc [i/o] The pointer to the XHTML structure at the output
783 * destination is specified.
784 * @param node [i] The META tag node is specified.
785 * @return The conversion result is returned.
788 s_xhtml_1_0_end_meta_tag(void *pdoc, Node *UNUSED(child))
790 xhtml_t *xhtml = GET_XHTML(pdoc);
797 * It is a handler who processes the HEAD tag.
799 * @param pdoc [i/o] The pointer to the XHTML structure at the output
800 * destination is specified.
801 * @param node [i] The HEAD tag node is specified.
802 * @return The conversion result is returned.
805 s_xhtml_1_0_start_head_tag(void *pdoc, Node *UNUSED(node))
807 xhtml_t *xhtml = GET_XHTML(pdoc);
808 Doc *doc = xhtml->doc;
817 * It is a handler who processes the HEAD tag.
819 * @param pdoc [i/o] The pointer to the XHTML structure at the output
820 * destination is specified.
821 * @param node [i] The HEAD tag node is specified.
822 * @return The conversion result is returned.
825 s_xhtml_1_0_end_head_tag(void *pdoc, Node *UNUSED(child))
827 xhtml_t *xhtml = GET_XHTML(pdoc);
828 Doc *doc = xhtml->doc;
837 * It is a handler who processes the TITLE tag.
839 * @param pdoc [i/o] The pointer to the XHTML structure at the output
840 * destination is specified.
841 * @param node [i] The TITLE tag node is specified.
842 * @return The conversion result is returned.
845 s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
847 xhtml_t *xhtml = GET_XHTML(pdoc);
848 Doc *doc = xhtml->doc;
856 * It is a handler who processes the TITLE tag.
858 * @param pdoc [i/o] The pointer to the XHTML structure at the output
859 * destination is specified.
860 * @param node [i] The TITLE tag node is specified.
861 * @return The conversion result is returned.
864 s_xhtml_1_0_end_title_tag(void *pdoc, Node *UNUSED(child))
866 xhtml_t *xhtml = GET_XHTML(pdoc);
867 Doc *doc = xhtml->doc;
877 * It is a handler who processes the BASE tag.
879 * @param pdoc [i/o] The pointer to the XHTML structure at the output
880 * destination is specified.
881 * @param node [i] The BASE tag node is specified.
882 * @return The conversion result is returned.
885 s_xhtml_1_0_start_base_tag(void *pdoc, Node *node)
887 xhtml_t *xhtml = GET_XHTML(pdoc);
889 Doc *doc = xhtml->doc;
892 /*--------------------------------------------------------------------------*/
894 /*--------------------------------------------------------------------------*/
895 for (attr = qs_get_attr(doc,node);
897 attr = qs_get_next_attr(doc,attr)) {
898 char *name = qs_get_attr_name(doc,attr);
899 char *value = qs_get_attr_value(doc,attr);
900 if (STRCASEEQ('h','H',"href",name)) {
915 * It is a handler who processes the BASE tag.
917 * @param pdoc [i/o] The pointer to the XHTML structure at the output
918 * destination is specified.
919 * @param node [i] The BASE tag node is specified.
920 * @return The conversion result is returned.
923 s_xhtml_1_0_end_base_tag(void *pdoc, Node *UNUSED(child))
925 xhtml_t *xhtml = GET_XHTML(pdoc);
932 * It is a handler who processes the BODY tag.
934 * @param pdoc [i/o] The pointer to the XHTML structure at the output
935 * destination is specified.
936 * @param node [i] The BODY tag node is specified.
937 * @return The conversion result is returned.
940 s_xhtml_1_0_start_body_tag(void *pdoc, Node *node)
942 xhtml_t *xhtml = GET_XHTML(pdoc);
943 Doc *doc = xhtml->doc;
947 /*--------------------------------------------------------------------------*/
949 /*--------------------------------------------------------------------------*/
950 for (attr = qs_get_attr(doc,node);
952 attr = qs_get_next_attr(doc,attr)) {
953 char *name = qs_get_attr_name(doc,attr);
954 char *value = qs_get_attr_value(doc,attr);
955 if (STRCASEEQ('b','B',"bgcolor", name) && value && *value) {
960 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
965 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
970 else if (STRCASEEQ('a','A',"alink", name)) {
973 else if (STRCASEEQ('v','V',"vlink",name)) {
984 * It is a handler who processes the BODY tag.
986 * @param pdoc [i/o] The pointer to the XHTML structure at the output
987 * destination is specified.
988 * @param node [i] The BODY tag node is specified.
989 * @return The conversion result is returned.
992 s_xhtml_1_0_end_body_tag(void *pdoc, Node *UNUSED(child))
994 xhtml_t *xhtml = GET_XHTML(pdoc);
995 Doc *doc = xhtml->doc;
1004 * It is a handler who processes the A tag.
1006 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1007 * destination is specified.
1008 * @param node [i] The A tag node is specified.
1009 * @return The conversion result is returned.
1012 s_xhtml_1_0_start_a_tag(void *pdoc, Node *node)
1014 xhtml_t *xhtml = GET_XHTML(pdoc);
1015 Doc *doc = xhtml->doc;
1016 request_rec *r = doc->r;
1020 /*--------------------------------------------------------------------------*/
1021 /* Get Attributes */
1022 /*--------------------------------------------------------------------------*/
1023 for (attr = qs_get_attr(doc,node);
1025 attr = qs_get_next_attr(doc,attr)) {
1026 char* name = qs_get_attr_name(doc,attr);
1027 char* value = qs_get_attr_value(doc,attr);
1028 if (STRCASEEQ('n','N',"name",name) && value && *value) {
1033 else if (STRCASEEQ('h','H',"href", name) && value && *value) {
1034 value = chxj_encoding_parameter(r, value);
1039 else if (STRCASEEQ('a','A',"accesskey", name)) {
1040 W_L(" accesskey=\"");
1044 else if (STRCASEEQ('c','C',"cti",name)) {
1047 else if (STRCASEEQ('i','I',"ijam", name)) {
1050 else if (STRCASEEQ('u','U',"utn", name)) {
1053 else if (STRCASEEQ('t','T',"telbook",name)) {
1056 else if (STRCASEEQ('k','K',"kana",name)) {
1059 else if (STRCASEEQ('e','E',"email",name)) {
1062 else if (STRCASEEQ('i','I',"ista",name)) {
1065 else if (STRCASEEQ('i','I',"ilet",name)) {
1068 else if (STRCASEEQ('i','I',"iswf",name)) {
1071 else if (STRCASEEQ('i','I',"irst",name)) {
1081 * It is a handler who processes the A tag.
1083 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1084 * destination is specified.
1085 * @param node [i] The A tag node is specified.
1086 * @return The conversion result is returned.
1089 s_xhtml_1_0_end_a_tag(void *pdoc, Node *UNUSED(child))
1091 xhtml_t *xhtml = GET_XHTML(pdoc);
1092 Doc *doc = xhtml->doc;
1102 * It is a handler who processes the BR tag.
1104 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1105 * destination is specified.
1106 * @param node [i] The BR tag node is specified.
1107 * @return The conversion result is returned.
1110 s_xhtml_1_0_start_br_tag(void *pdoc, Node *node)
1112 xhtml_t *xhtml = GET_XHTML(pdoc);
1113 Doc *doc = xhtml->doc;
1117 /*--------------------------------------------------------------------------*/
1118 /* Get Attributes */
1119 /*--------------------------------------------------------------------------*/
1120 for (attr = qs_get_attr(doc,node);
1122 attr = qs_get_next_attr(doc,attr)) {
1123 char *name = qs_get_attr_name(doc,attr);
1124 char *value = qs_get_attr_value(doc,attr);
1125 if (STRCASEEQ('c','C',"clear",name)) {
1126 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1141 * It is a handler who processes the BR tag.
1143 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1144 * destination is specified.
1145 * @param node [i] The BR tag node is specified.
1146 * @return The conversion result is returned.
1149 s_xhtml_1_0_end_br_tag(void *pdoc, Node *UNUSED(child))
1151 xhtml_t *xhtml = GET_XHTML(pdoc);
1158 * It is a handler who processes the TR tag.
1160 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1161 * destination is specified.
1162 * @param node [i] The TR tag node is specified.
1163 * @return The conversion result is returned.
1166 s_xhtml_1_0_start_tr_tag(void *pdoc, Node *UNUSED(node))
1168 xhtml_t *xhtml = GET_XHTML(pdoc);
1169 Doc *doc = xhtml->doc;
1179 * It is a handler who processes the TR tag.
1181 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1182 * destination is specified.
1183 * @param node [i] The TR tag node is specified.
1184 * @return The conversion result is returned.
1187 s_xhtml_1_0_end_tr_tag(void *pdoc, Node *UNUSED(child))
1189 xhtml_t *xhtml = GET_XHTML(pdoc);
1196 * It is a handler who processes the FONT tag.
1198 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1199 * destination is specified.
1200 * @param node [i] The FONT tag node is specified.
1201 * @return The conversion result is returned.
1204 s_xhtml_1_0_start_font_tag(void *pdoc, Node *node)
1206 xhtml_t *xhtml = GET_XHTML(pdoc);
1207 Doc *doc = xhtml->doc;
1212 /*=========================================================================*/
1213 /* Get Attributes */
1214 /*=========================================================================*/
1215 for (attr = qs_get_attr(doc,node);
1217 attr = qs_get_next_attr(doc,attr)) {
1218 char *name = qs_get_attr_name(doc,attr);
1219 char *value = qs_get_attr_value(doc,attr);
1220 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1221 color = apr_pstrdup(doc->buf.pool, value);
1223 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1224 size = apr_pstrdup(doc->buf.pool, value);
1228 W_L("<font color=\"");
1231 xhtml->font_color_flag++;
1234 xhtml->font_size_flag++;
1236 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1237 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1238 case '3': W_L("<span style=\"font-size: small\">"); break;
1239 case '4': W_L("<span style=\"font-size: medium\">"); break;
1240 case '5': W_L("<span style=\"font-size: large\">"); break;
1241 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1242 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1244 if (*(size + 1) == '1') {
1245 W_L("<span style=\"font-size: small\">");
1248 if (*(size + 1) == '2') {
1249 W_L("<span style=\"font-size: x-small\">");
1252 if (*(size + 1) == '3') {
1253 W_L("<span style=\"font-size: xx-small\">");
1256 xhtml->font_size_flag--;
1260 if (*(size + 1) == '1') {
1261 W_L("<span style=\"font-size: large\">");
1264 if (*(size + 1) == '2') {
1265 W_L("<span style=\"font-size: x-large\">");
1268 if (*(size + 1) == '3') {
1269 W_L("<span style=\"font-size: xx-large\">");
1272 xhtml->font_size_flag--;
1276 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1277 xhtml->font_size_flag--;
1285 * It is a handler who processes the FONT tag.
1287 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1288 * destination is specified.
1289 * @param node [i] The FONT tag node is specified.
1290 * @return The conversion result is returned.
1293 s_xhtml_1_0_end_font_tag(void *pdoc, Node *UNUSED(child))
1295 xhtml_t *xhtml = GET_XHTML(pdoc);
1296 Doc *doc = xhtml->doc;
1298 if (xhtml->font_size_flag) {
1300 xhtml->font_size_flag--;
1302 if (xhtml->font_color_flag) {
1305 xhtml->font_color_flag--;
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_start_form_tag(void *pdoc, Node *node)
1322 xhtml_t *xhtml = GET_XHTML(pdoc);
1323 Doc *doc = xhtml->doc;
1324 request_rec *r = doc->r;
1328 /*--------------------------------------------------------------------------*/
1329 /* Get Attributes */
1330 /*--------------------------------------------------------------------------*/
1331 for (attr = qs_get_attr(doc,node);
1333 attr = qs_get_next_attr(doc,attr)) {
1334 char *name = qs_get_attr_name(doc,attr);
1335 char *value = qs_get_attr_value(doc,attr);
1336 if (STRCASEEQ('a','A',"action",name)) {
1337 value = chxj_encoding_parameter(r, value);
1342 else if (STRCASEEQ('m','M',"method",name)) {
1347 else if (STRCASEEQ('u','U',"utn",name)) {
1358 * It is a handler who processes the FORM tag.
1360 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1361 * destination is specified.
1362 * @param node [i] The FORM tag node is specified.
1363 * @return The conversion result is returned.
1366 s_xhtml_1_0_end_form_tag(void *pdoc, Node *UNUSED(child))
1368 xhtml_t *xhtml = GET_XHTML(pdoc);
1369 Doc *doc = xhtml->doc;
1379 * It is a handler who processes the INPUT tag.
1381 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1382 * destination is specified.
1383 * @param node [i] The INPUT tag node is specified.
1384 * @return The conversion result is returned.
1387 s_xhtml_1_0_start_input_tag(void *pdoc, Node *node)
1389 xhtml_t *xhtml = GET_XHTML(pdoc);
1390 Doc *doc = xhtml->doc;
1391 request_rec *r = doc->r;
1392 char *max_length = NULL;
1396 char *istyle = NULL;
1398 char *checked = NULL;
1399 char *accesskey = NULL;
1402 /*--------------------------------------------------------------------------*/
1403 /* Get Attributes */
1404 /*--------------------------------------------------------------------------*/
1405 type = qs_get_type_attr(doc, node, doc->buf.pool);
1406 name = qs_get_name_attr(doc, node, doc->buf.pool);
1407 value = qs_get_value_attr(doc,node, doc->buf.pool);
1408 istyle = qs_get_istyle_attr(doc,node,r);
1409 max_length = qs_get_maxlength_attr(doc,node,r);
1410 checked = qs_get_checked_attr(doc,node, doc->buf.pool);
1411 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1412 size = qs_get_size_attr(doc, node, doc->buf.pool);
1415 type = qs_trim_string(doc->buf.pool, type);
1416 if (type && (STRCASEEQ('t','T',"text", type) ||
1417 STRCASEEQ('p','P',"password",type) ||
1418 STRCASEEQ('c','C',"checkbox",type) ||
1419 STRCASEEQ('r','R',"radio", type) ||
1420 STRCASEEQ('h','H',"hidden", type) ||
1421 STRCASEEQ('s','S',"submit", type) ||
1422 STRCASEEQ('r','R',"reset", type))) {
1428 if (size && *size) {
1433 if (name && *name) {
1438 if (value && *value) {
1443 if (accesskey && *accesskey) {
1444 W_L(" accesskey=\"");
1448 if (istyle && *istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1449 char *fmt = qs_conv_istyle_to_format(r,istyle);
1450 if (max_length && *max_length) {
1452 for (ii=0; (unsigned int)ii<strlen(max_length); ii++) {
1453 if (max_length[ii] < '0' || max_length[ii] > '9') {
1454 max_length = apr_psprintf(r->pool, "0");
1459 if (strcmp(max_length, "0")) {
1460 char *vv = apr_psprintf(r->pool, " FORMAT=\"%d%s\"", atoi(max_length), fmt);
1472 if (max_length && *max_length) {
1473 if (chxj_chk_numeric(max_length) != 0) {
1474 max_length = apr_psprintf(r->pool, "0");
1476 if (strcmp(max_length, "0")) {
1477 char *vv = apr_psprintf(r->pool, " FORMAT=\"%dm\"", atoi(max_length));
1482 /*--------------------------------------------------------------------------*/
1483 /* The figure is default for the password. */
1484 /*--------------------------------------------------------------------------*/
1485 if (type && (istyle == NULL || *istyle == 0) && STRCASEEQ('p','P',"password", type) && ! xhtml->entryp->pc_flag) {
1492 W_L(" FORMAT=\"*N\"");
1496 W_L(" checked=\"checked\"");
1506 * It is a handler who processes the INPUT tag.
1508 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1509 * destination is specified.
1510 * @param node [i] The INPUT tag node is specified.
1511 * @return The conversion result is returned.
1514 s_xhtml_1_0_end_input_tag(void *pdoc, Node *UNUSED(child))
1516 xhtml_t *xhtml = GET_XHTML(pdoc);
1523 * It is a handler who processes the CENTER tag.
1525 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1526 * destination is specified.
1527 * @param node [i] The CENTER tag node is specified.
1528 * @return The conversion result is returned.
1531 s_xhtml_1_0_start_center_tag(void *pdoc, Node *UNUSED(node))
1533 xhtml_t *xhtml = GET_XHTML(pdoc);
1534 Doc *doc = xhtml->doc;
1543 * It is a handler who processes the CENTER tag.
1545 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1546 * destination is specified.
1547 * @param node [i] The CENTER tag node is specified.
1548 * @return The conversion result is returned.
1551 s_xhtml_1_0_end_center_tag(void *pdoc, Node *UNUSED(child))
1553 xhtml_t *xhtml = GET_XHTML(pdoc);
1554 Doc *doc = xhtml->doc;
1563 * It is a handler who processes the HR tag.
1565 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1566 * destination is specified.
1567 * @param node [i] The HR tag node is specified.
1568 * @return The conversion result is returned.
1571 s_xhtml_1_0_start_hr_tag(void *pdoc, Node *node)
1573 xhtml_t *xhtml = GET_XHTML(pdoc);
1574 Doc *doc = xhtml->doc;
1579 for (attr = qs_get_attr(doc,node);
1581 attr = qs_get_next_attr(doc,attr)) {
1582 char *name = qs_get_attr_name(doc,attr);
1583 char *value = qs_get_attr_value(doc,attr);
1584 if (STRCASEEQ('a','A',"align", name)) {
1585 /*----------------------------------------------------------------------*/
1587 /*----------------------------------------------------------------------*/
1588 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1594 else if (STRCASEEQ('s','S',"size", name)) {
1595 /*----------------------------------------------------------------------*/
1597 /*----------------------------------------------------------------------*/
1598 if (value && *value) {
1604 else if (STRCASEEQ('w','W',"width", name)) {
1605 /*----------------------------------------------------------------------*/
1607 /*----------------------------------------------------------------------*/
1608 if (value && *value) {
1614 else if (STRCASEEQ('n','N',"noshade", name)) {
1615 /*----------------------------------------------------------------------*/
1617 /*----------------------------------------------------------------------*/
1620 else if (STRCASEEQ('c','C',"color", name) && value && *value) {
1621 /*----------------------------------------------------------------------*/
1623 /*----------------------------------------------------------------------*/
1636 * It is a handler who processes the HR tag.
1638 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1639 * destination is specified.
1640 * @param node [i] The HR tag node is specified.
1641 * @return The conversion result is returned.
1644 s_xhtml_1_0_end_hr_tag(void *pdoc, Node *UNUSED(child))
1646 xhtml_t *xhtml = GET_XHTML(pdoc);
1653 * It is a handler who processes the PRE tag.
1655 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1656 * destination is specified.
1657 * @param node [i] The PRE tag node is specified.
1658 * @return The conversion result is returned.
1661 s_xhtml_1_0_start_pre_tag(void* pdoc, Node* UNUSED(node))
1663 xhtml_t *xhtml = GET_XHTML(pdoc);
1664 Doc *doc = xhtml->doc;
1674 * It is a handler who processes the PRE tag.
1676 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1677 * destination is specified.
1678 * @param node [i] The PRE tag node is specified.
1679 * @return The conversion result is returned.
1682 s_xhtml_1_0_end_pre_tag(void *pdoc, Node *UNUSED(child))
1684 xhtml_t *xhtml = GET_XHTML(pdoc);
1685 Doc *doc = xhtml->doc;
1696 * It is a handler who processes the P tag.
1698 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1699 * destination is specified.
1700 * @param node [i] The P tag node is specified.
1701 * @return The conversion result is returned.
1704 s_xhtml_1_0_start_p_tag(void *pdoc, Node *node)
1706 xhtml_t *xhtml = GET_XHTML(pdoc);
1707 Doc *doc = xhtml->doc;
1712 for (attr = qs_get_attr(doc,node);
1714 attr = qs_get_next_attr(doc,attr)) {
1715 char *nm = qs_get_attr_name(doc,attr);
1716 char *val = qs_get_attr_value(doc,attr);
1717 if (STRCASEEQ('a','A',"align", nm)) {
1718 /*----------------------------------------------------------------------*/
1719 /* CHTML 1.0 (W3C version 3.2) */
1720 /*----------------------------------------------------------------------*/
1721 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1722 align = apr_pstrdup(doc->buf.pool, val);
1739 * It is a handler who processes the P tag.
1741 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1742 * destination is specified.
1743 * @param node [i] The P tag node is specified.
1744 * @return The conversion result is returned.
1747 s_xhtml_1_0_end_p_tag(void *pdoc, Node *UNUSED(child))
1749 xhtml_t *xhtml = GET_XHTML(pdoc);
1750 Doc *doc = xhtml->doc;
1759 * It is a handler who processes the UL tag.
1761 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1762 * destination is specified.
1763 * @param node [i] The UL tag node is specified.
1764 * @return The conversion result is returned.
1767 s_xhtml_1_0_start_ul_tag(void *pdoc, Node *node)
1769 xhtml_t *xhtml = GET_XHTML(pdoc);
1770 Doc *doc = xhtml->doc;
1773 /*--------------------------------------------------------------------------*/
1774 /* Get Attributes */
1775 /*--------------------------------------------------------------------------*/
1776 for (attr = qs_get_attr(doc,node);
1778 attr = qs_get_next_attr(doc,attr)) {
1779 char *name = qs_get_attr_name(doc,attr);
1780 char *value = qs_get_attr_value(doc,attr);
1781 if (STRCASEEQ('t','T',"type",name)) {
1782 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1796 * It is a handler who processes the UL tag.
1798 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1799 * destination is specified.
1800 * @param node [i] The UL tag node is specified.
1801 * @return The conversion result is returned.
1804 s_xhtml_1_0_end_ul_tag(void *pdoc, Node *UNUSED(child))
1806 xhtml_t *xhtml = GET_XHTML(pdoc);
1807 Doc *doc = xhtml->doc;
1816 * It is a handler who processes the H1 tag.
1818 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1819 * destination is specified.
1820 * @param node [i] The H1 tag node is specified.
1821 * @return The conversion result is returned.
1824 s_xhtml_1_0_start_h1_tag(void *pdoc, Node *node)
1826 xhtml_t *xhtml = GET_XHTML(pdoc);
1827 Doc *doc = xhtml->doc;
1831 for (attr = qs_get_attr(doc,node);
1833 attr = qs_get_next_attr(doc,attr)) {
1836 name = qs_get_attr_name(doc,attr);
1837 value = qs_get_attr_value(doc,attr);
1838 if (STRCASEEQ('a','A',"align", name)) {
1840 if (STRCASEEQ('l','L',"left",value)) {
1842 W_L("text-align:left");
1845 else if (STRCASEEQ('r','R',"right",value)) {
1847 W_L("text-align:right");
1850 else if (STRCASEEQ('c','C',"center",value)) {
1852 W_L("text-align:center");
1865 * It is a handler who processes the H1 tag.
1867 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1868 * destination is specified.
1869 * @param node [i] The H1 tag node is specified.
1870 * @return The conversion result is returned.
1873 s_xhtml_1_0_end_h1_tag(void *pdoc, Node *UNUSED(child))
1875 xhtml_t *xhtml = GET_XHTML(pdoc);
1876 Doc *doc = xhtml->doc;
1885 * It is a handler who processes the H2 tag.
1887 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1888 * destination is specified.
1889 * @param node [i] The H2 tag node is specified.
1890 * @return The conversion result is returned.
1893 s_xhtml_1_0_start_h2_tag(void *pdoc, Node *node)
1895 xhtml_t *xhtml = GET_XHTML(pdoc);
1896 Doc *doc = xhtml->doc;
1900 for (attr = qs_get_attr(doc,node);
1902 attr = qs_get_next_attr(doc,attr)) {
1905 name = qs_get_attr_name(doc,attr);
1906 value = qs_get_attr_value(doc,attr);
1907 if (STRCASEEQ('a','A',"align", name)) {
1909 if (STRCASEEQ('l','L',"left",value)) {
1911 W_L("text-align:left");
1914 else if (STRCASEEQ('r','R',"right",value)) {
1916 W_L("text-align:right");
1919 else if (STRCASEEQ('c','C',"center",value)) {
1921 W_L("text-align:center");
1934 * It is a handler who processes the H2 tag.
1936 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1937 * destination is specified.
1938 * @param node [i] The H2 tag node is specified.
1939 * @return The conversion result is returned.
1942 s_xhtml_1_0_end_h2_tag(void *pdoc, Node *UNUSED(child))
1944 xhtml_t *xhtml = GET_XHTML(pdoc);
1945 Doc *doc = xhtml->doc;
1954 * It is a handler who processes the H3 tag.
1956 * @param pdoc [i/o] The pointer to the XHTML structure at the output
1957 * destination is specified.
1958 * @param node [i] The H3 tag node is specified.
1959 * @return The conversion result is returned.
1962 s_xhtml_1_0_start_h3_tag(void *pdoc, Node *node)
1964 xhtml_t *xhtml = GET_XHTML(pdoc);
1965 Doc *doc = xhtml->doc;
1969 for (attr = qs_get_attr(doc,node);
1971 attr = qs_get_next_attr(doc,attr)) {
1974 name = qs_get_attr_name(doc,attr);
1975 value = qs_get_attr_value(doc,attr);
1976 if (STRCASEEQ('a','A',"align", name)) {
1978 if (STRCASEEQ('l','L',"left",value)) {
1980 W_L("text-align:left");
1983 else if (STRCASEEQ('r','R',"right",value)) {
1985 W_L("text-align:right");
1988 else if (STRCASEEQ('c','C',"center",value)) {
1990 W_L("text-align:center");
2003 * It is a handler who processes the H3 tag.
2005 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2006 * destination is specified.
2007 * @param node [i] The H3 tag node is specified.
2008 * @return The conversion result is returned.
2011 s_xhtml_1_0_end_h3_tag(void *pdoc, Node *UNUSED(child))
2013 xhtml_t *xhtml = GET_XHTML(pdoc);
2014 Doc *doc = xhtml->doc;
2023 * It is a handler who processes the H4 tag.
2025 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2026 * destination is specified.
2027 * @param node [i] The H4 tag node is specified.
2028 * @return The conversion result is returned.
2031 s_xhtml_1_0_start_h4_tag(void *pdoc, Node *node)
2033 xhtml_t *xhtml = GET_XHTML(pdoc);
2034 Doc *doc = xhtml->doc;
2038 for (attr = qs_get_attr(doc,node);
2040 attr = qs_get_next_attr(doc,attr)) {
2043 name = qs_get_attr_name(doc,attr);
2044 value = qs_get_attr_value(doc,attr);
2045 if (STRCASEEQ('a','A',"align", name)) {
2047 if (STRCASEEQ('l','L',"left",value)) {
2049 W_L("text-align:left");
2052 else if (STRCASEEQ('r','R',"right",value)) {
2054 W_L("text-align:right");
2057 else if (STRCASEEQ('c','C',"center",value)) {
2059 W_L("text-align:center");
2072 * It is a handler who processes the H4 tag.
2074 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2075 * destination is specified.
2076 * @param node [i] The H4 tag node is specified.
2077 * @return The conversion result is returned.
2080 s_xhtml_1_0_end_h4_tag(void *pdoc, Node *UNUSED(child))
2082 xhtml_t *xhtml = GET_XHTML(pdoc);
2083 Doc *doc = xhtml->doc;
2092 * It is a handler who processes the H5 tag.
2094 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2095 * destination is specified.
2096 * @param node [i] The H5 tag node is specified.
2097 * @return The conversion result is returned.
2100 s_xhtml_1_0_start_h5_tag(void *pdoc, Node *node)
2102 xhtml_t *xhtml = GET_XHTML(pdoc);
2103 Doc *doc = xhtml->doc;
2107 for (attr = qs_get_attr(doc,node);
2109 attr = qs_get_next_attr(doc,attr)) {
2112 name = qs_get_attr_name(doc,attr);
2113 value = qs_get_attr_value(doc,attr);
2114 if (STRCASEEQ('a','A',"align", name)) {
2116 if (STRCASEEQ('l','L',"left",value)) {
2118 W_L("text-align:left");
2121 else if (STRCASEEQ('r','R',"right",value)) {
2123 W_L("text-align:right");
2126 else if (STRCASEEQ('c','C',"center",value)) {
2128 W_L("text-align:center");
2141 * It is a handler who processes the H5 tag.
2143 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2144 * destination is specified.
2145 * @param node [i] The H5 tag node is specified.
2146 * @return The conversion result is returned.
2149 s_xhtml_1_0_end_h5_tag(void *pdoc, Node *UNUSED(child))
2151 xhtml_t *xhtml = GET_XHTML(pdoc);
2152 Doc *doc = xhtml->doc;
2161 * It is a handler who processes the H6 tag.
2163 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2164 * destination is specified.
2165 * @param node [i] The H6 tag node is specified.
2166 * @return The conversion result is returned.
2169 s_xhtml_1_0_start_h6_tag(void *pdoc, Node *node)
2171 xhtml_t *xhtml = GET_XHTML(pdoc);
2172 Doc *doc = xhtml->doc;
2176 for (attr = qs_get_attr(doc,node);
2178 attr = qs_get_next_attr(doc,attr)) {
2181 name = qs_get_attr_name(doc,attr);
2182 value = qs_get_attr_value(doc,attr);
2183 if (STRCASEEQ('a','A',"align", name)) {
2185 if (STRCASEEQ('l','L',"left",value)) {
2187 W_L("text-align:left");
2190 else if (STRCASEEQ('r','R',"right",value)) {
2192 W_L("text-align:right");
2195 else if (STRCASEEQ('c','C',"center",value)) {
2197 W_L("text-align:center");
2210 * It is a handler who processes the H6 tag.
2212 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2213 * destination is specified.
2214 * @param node [i] The H6 tag node is specified.
2215 * @return The conversion result is returned.
2218 s_xhtml_1_0_end_h6_tag(void *pdoc, Node *UNUSED(child))
2220 xhtml_t *xhtml = GET_XHTML(pdoc);
2221 Doc *doc = xhtml->doc;
2230 * It is a handler who processes the OL tag.
2232 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2233 * destination is specified.
2234 * @param node [i] The OL tag node is specified.
2235 * @return The conversion result is returned.
2238 s_xhtml_1_0_start_ol_tag(void *pdoc, Node *node)
2240 xhtml_t *xhtml = GET_XHTML(pdoc);
2241 Doc *doc = xhtml->doc;
2245 /*--------------------------------------------------------------------------*/
2246 /* Get Attributes */
2247 /*--------------------------------------------------------------------------*/
2248 for (attr = qs_get_attr(doc,node);
2250 attr = qs_get_next_attr(doc,attr)) {
2251 char *name = qs_get_attr_name(doc,attr);
2252 char *value = qs_get_attr_value(doc,attr);
2253 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2258 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2271 * It is a handler who processes the OL tag.
2273 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2274 * destination is specified.
2275 * @param node [i] The OL tag node is specified.
2276 * @return The conversion result is returned.
2279 s_xhtml_1_0_end_ol_tag(void *pdoc, Node *UNUSED(child))
2281 xhtml_t *xhtml = GET_XHTML(pdoc);
2282 Doc *doc = xhtml->doc;
2291 * It is a handler who processes the LI tag.
2293 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2294 * destination is specified.
2295 * @param node [i] The LI tag node is specified.
2296 * @return The conversion result is returned.
2299 s_xhtml_1_0_start_li_tag(void *pdoc, Node *node)
2301 xhtml_t *xhtml = GET_XHTML(pdoc);
2302 Doc *doc = xhtml->doc;
2306 /*--------------------------------------------------------------------------*/
2307 /* Get Attributes */
2308 /*--------------------------------------------------------------------------*/
2309 for (attr = qs_get_attr(doc,node);
2311 attr = qs_get_next_attr(doc,attr)) {
2312 char *name = qs_get_attr_name(doc,attr);
2313 char *value = qs_get_attr_value(doc,attr);
2314 if (STRCASEEQ('t','T',"type",name)) {
2315 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2321 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2333 ** It is a handler who processes the LI tag.
2335 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2336 * destination is specified.
2337 * @param node [i] The LI tag node is specified.
2338 * @return The conversion result is returned.
2341 s_xhtml_1_0_end_li_tag(void *pdoc, Node *UNUSED(child))
2343 xhtml_t *xhtml = GET_XHTML(pdoc);
2344 Doc *doc = xhtml->doc;
2352 * It is a handler who processes the IMG tag.
2354 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2355 * destination is specified.
2356 * @param node [i] The IMG tag node is specified.
2357 * @return The conversion result is returned.
2360 s_xhtml_1_0_start_img_tag(void *pdoc, Node *node)
2362 xhtml_t *xhtml = GET_XHTML(pdoc);
2363 Doc *doc = xhtml->doc;
2364 request_rec *r = doc->r;
2367 #ifndef IMG_NOT_CONVERT_FILENAME
2368 device_table *spec = xhtml->spec;
2372 /*--------------------------------------------------------------------------*/
2373 /* Get Attributes */
2374 /*--------------------------------------------------------------------------*/
2375 for (attr = qs_get_attr(doc,node);
2377 attr = qs_get_next_attr(doc,attr)) {
2378 char *name = qs_get_attr_name(doc,attr);
2379 char *value = qs_get_attr_value(doc,attr);
2381 if (STRCASEEQ('s','S',"src",name)) {
2382 value = chxj_encoding_parameter(r, value);
2383 #ifdef IMG_NOT_CONVERT_FILENAME
2393 char *vv = chxj_img_conv(r,spec,value);
2401 if (STRCASEEQ('a','A',"align",name)) {
2403 if (STRCASEEQ('t','T',"top", value) ||
2404 STRCASEEQ('m','M',"middle",value) ||
2405 STRCASEEQ('b','B',"bottom",value) ||
2406 STRCASEEQ('l','L',"left", value) ||
2407 STRCASEEQ('r','R',"right", value)) {
2412 else if (STRCASEEQ('c','C',"center", value)) {
2419 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2424 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2429 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2434 else if (STRCASEEQ('h','H',"hspace",name) && value && *value) {
2439 else if (STRCASEEQ('v','V',"vspace",name) && value && *value) {
2452 * It is a handler who processes the IMG tag.
2454 * @param xhtml [i/o] The pointer to the XHTML structure at the output
2455 * destination is specified.
2456 * @param node [i] The IMG tag node is specified.
2457 * @return The conversion result is returned.
2460 s_xhtml_1_0_end_img_tag(void *pdoc, Node *UNUSED(child))
2462 xhtml_t *xhtml = GET_XHTML(pdoc);
2469 * It is a handler who processes the SELECT tag.
2471 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2472 * destination is specified.
2473 * @param node [i] The SELECT tag node is specified.
2474 * @return The conversion result is returned.
2477 s_xhtml_1_0_start_select_tag(void *pdoc, Node *child)
2479 xhtml_t *xhtml = GET_XHTML(pdoc);
2480 Doc *doc = xhtml->doc;
2483 char *multiple = NULL;
2488 for (attr = qs_get_attr(doc,child);
2490 attr = qs_get_next_attr(doc,attr)) {
2491 char *nm = qs_get_attr_name(doc,attr);
2492 char *val = qs_get_attr_value(doc,attr);
2493 if (STRCASEEQ('s','S',"size",nm)) {
2494 /*----------------------------------------------------------------------*/
2495 /* CHTML 1.0 version 2.0 */
2496 /*----------------------------------------------------------------------*/
2497 size = apr_pstrdup(doc->buf.pool, val);
2499 else if (STRCASEEQ('n','N',"name",nm)) {
2500 /*----------------------------------------------------------------------*/
2501 /* CHTML 1.0 version 2.0 */
2502 /*----------------------------------------------------------------------*/
2503 name = apr_pstrdup(doc->buf.pool, val);
2505 else if (STRCASEEQ('m','M',"multiple",nm)) {
2506 /*----------------------------------------------------------------------*/
2507 /* CHTML 1.0 version 2.0 */
2508 /*----------------------------------------------------------------------*/
2509 multiple = apr_pstrdup(doc->buf.pool, val);
2512 if (size && *size) {
2517 if (name && *name) {
2523 /* "true" is *NOT* W3C. it is specification of WAP2.0 for EZWEB */
2524 W_L(" multiple=\"true\"");
2533 * It is a handler who processes the SELECT tag.
2535 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2536 * destination is specified.
2537 * @param node [i] The SELECT tag node is specified.
2538 * @return The conversion result is returned.
2541 s_xhtml_1_0_end_select_tag(void *pdoc, Node *UNUSED(child))
2543 xhtml_t *xhtml = GET_XHTML(pdoc);
2544 Doc *doc = xhtml->doc;
2553 * It is a handler who processes the OPTION tag.
2555 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2556 * destination is specified.
2557 * @param node [i] The OPTION tag node is specified.
2558 * @return The conversion result is returned.
2561 s_xhtml_1_0_start_option_tag(void *pdoc, Node *child)
2563 xhtml_t *xhtml = GET_XHTML(pdoc);
2564 Doc *doc = xhtml->doc;
2567 char *selected = NULL;
2571 for (attr = qs_get_attr(doc,child);
2573 attr = qs_get_next_attr(doc,attr)) {
2574 char *nm = qs_get_attr_name(doc,attr);
2575 char *val = qs_get_attr_value(doc,attr);
2576 if (STRCASEEQ('s','S',"selected",nm)) {
2577 /* CHTML version 2.0 */
2578 selected = apr_pstrdup(doc->buf.pool, val);
2580 else if (STRCASEEQ('v','V',"value",nm)) {
2581 /* CHTML version 2.0 */
2582 value = apr_pstrdup(doc->buf.pool, val);
2585 if (value && *value) {
2591 W_L(" selected=\"selected\"");
2599 * It is a handler who processes the OPTION tag.
2601 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2602 * destination is specified.
2603 * @param node [i] The OPTION tag node is specified.
2604 * @return The conversion result is returned.
2607 s_xhtml_1_0_end_option_tag(void *pdoc, Node *UNUSED(child))
2609 xhtml_t *xhtml = GET_XHTML(pdoc);
2610 Doc *doc = xhtml->doc;
2619 * It is a handler who processes the DIV tag.
2621 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2622 * destination is specified.
2623 * @param node [i] The DIV tag node is specified.
2624 * @return The conversion result is returned.
2627 s_xhtml_1_0_start_div_tag(void *pdoc, Node *child)
2629 xhtml_t *xhtml = GET_XHTML(pdoc);
2630 Doc *doc = xhtml->doc;
2635 for (attr = qs_get_attr(doc,child);
2637 attr = qs_get_next_attr(doc,attr)) {
2638 char *nm = qs_get_attr_name(doc,attr);
2639 char *val = qs_get_attr_value(doc,attr);
2640 if (STRCASEEQ('a','A',"align",nm)) {
2641 /*=====================================================================*/
2642 /* CHTML version 3.2 */
2643 /*=====================================================================*/
2644 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2645 align = apr_pstrdup(doc->buf.pool, val);
2661 * It is a handler who processes the DIV tag.
2663 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2664 * destination is specified.
2665 * @param node [i] The DIV tag node is specified.
2666 * @return The conversion result is returned.
2669 s_xhtml_1_0_end_div_tag(void *pdoc, Node *UNUSED(child))
2671 xhtml_t *xhtml = GET_XHTML(pdoc);
2672 Doc *doc = xhtml->doc;
2680 * It is a handler who processes the B tag.
2682 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2683 * destination is specified.
2684 * @param node [i] The B tag node is specified.
2685 * @return The conversion result is returned.
2688 s_xhtml_1_0_start_b_tag(void *pdoc, Node *UNUSED(child))
2690 xhtml_t *xhtml = GET_XHTML(pdoc);
2691 Doc *doc = xhtml->doc;
2693 W_L("<div style=\"font-weight:bold\">");
2699 * It is a handler who processes the B tag.
2701 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2702 * destination is specified.
2703 * @param node [i] The B tag node is specified.
2704 * @return The conversion result is returned.
2707 s_xhtml_1_0_end_b_tag(void *pdoc, Node *UNUSED(child))
2709 xhtml_t *xhtml = GET_XHTML(pdoc);
2710 Doc *doc = xhtml->doc;
2719 * It is a handler who processes the CHXJ:IF tag.
2721 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2722 * destination is specified.
2723 * @param node [i] The CHXJ:IF tag node is specified.
2726 s_xhtml_1_0_chxjif_tag(void *pdoc, Node *node)
2728 xhtml_t *xhtml = GET_XHTML(pdoc);
2729 Doc *doc = xhtml->doc;
2732 for (child = qs_get_child_node(doc, node);
2734 child = qs_get_next_node(doc, child)) {
2736 s_xhtml_1_0_chxjif_tag(xhtml, child);
2744 * It is a handler who processes the TEXTARE tag.
2746 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2747 * destination is specified.
2748 * @param node [i] The TEXTAREA tag node is specified.
2749 * @return The conversion result is returned.
2752 s_xhtml_1_0_start_textarea_tag(void *pdoc, Node *node)
2754 xhtml_t *xhtml = GET_XHTML(pdoc);
2755 Doc *doc = xhtml->doc;
2758 xhtml->textarea_flag++;
2760 for (attr = qs_get_attr(doc,node);
2762 attr = qs_get_next_attr(doc,attr)) {
2763 char *name = qs_get_attr_name(doc,attr);
2764 char *value = qs_get_attr_value(doc,attr);
2765 if (STRCASEEQ('n','N',"name",name) && value && *value) {
2770 else if (STRCASEEQ('r','R',"rows",name) && value && *value) {
2775 else if (STRCASEEQ('c','C',"cols",name) && value && *value) {
2780 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2781 char *fmt = qs_conv_istyle_to_format(doc->r,value);
2786 else if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2787 W_L(" accesskey=\"");
2798 * It is a handler who processes the TEXTAREA tag.
2800 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2801 * destination is specified.
2802 * @param node [i] The TEXTAREA tag node is specified.
2803 * @return The conversion result is returned.
2806 s_xhtml_1_0_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2808 xhtml_t *xhtml = GET_XHTML(pdoc);
2809 Doc *doc = xhtml->doc;
2813 xhtml->textarea_flag--;
2819 s_xhtml_1_0_text_tag(void *pdoc, Node *child)
2821 xhtml_t *xhtml = GET_XHTML(pdoc);
2822 Doc *doc = xhtml->doc;
2823 request_rec *r = doc->r;
2831 textval = qs_get_node_value(doc,child);
2832 if (strlen(textval) == 0) {
2836 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2837 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2839 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2840 memset(one_byte, 0, sizeof(one_byte));
2843 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2845 int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
2847 DBG(r,"[%s][%d]", out, rtn);
2848 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2852 if (is_sjis_kanji(textval[ii])) {
2853 one_byte[0] = textval[ii+0];
2854 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2855 one_byte[0] = textval[ii+1];
2856 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2859 else if (xhtml->pre_flag) {
2860 one_byte[0] = textval[ii+0];
2861 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2863 else if (xhtml->textarea_flag) {
2864 one_byte[0] = textval[ii+0];
2865 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2867 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2868 one_byte[0] = textval[ii+0];
2869 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2878 * It is a handler who processes the BLOCKQUOTE tag.
2880 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2881 * destination is specified.
2882 * @param node [i] The BLOCKQUOTE tag node is specified.
2883 * @return The conversion result is returned.
2886 s_xhtml_1_0_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2888 xhtml_t *xhtml = GET_XHTML(pdoc);
2889 Doc *doc = xhtml->doc;
2890 W_L("<blockquote>");
2897 * It is a handler who processes the BLOCKQUOTE tag.
2899 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2900 * destination is specified.
2901 * @param node [i] The BLOCKQUOTE tag node is specified.
2902 * @return The conversion result is returned.
2905 s_xhtml_1_0_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2907 xhtml_t *xhtml = GET_XHTML(pdoc);
2908 Doc *doc = xhtml->doc;
2909 W_L("</blockquote>");
2916 * It is a handler who processes the DIR tag.
2918 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2919 * destination is specified.
2920 * @param node [i] The DIR tag node is specified.
2921 * @return The conversion result is returned.
2924 s_xhtml_1_0_start_dir_tag(void *pdoc, Node *node)
2926 xhtml_t *xhtml = GET_XHTML(pdoc);
2927 Doc *doc = xhtml->doc;
2930 for (attr = qs_get_attr(doc,node);
2932 attr = qs_get_next_attr(doc,attr)) {
2933 char *name = qs_get_attr_name(doc,attr);
2934 char *value = qs_get_attr_value(doc,attr);
2935 if (STRCASEEQ('t','T',"type",name)) {
2936 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2950 * It is a handler who processes the DIR tag.
2952 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2953 * destination is specified.
2954 * @param node [i] The DIR tag node is specified.
2955 * @return The conversion result is returned.
2958 s_xhtml_1_0_end_dir_tag(void *pdoc, Node *UNUSED(child))
2960 xhtml_t *xhtml = GET_XHTML(pdoc);
2961 Doc *doc = xhtml->doc;
2969 * It is a handler who processes the DL tag.
2971 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2972 * destination is specified.
2973 * @param node [i] The DL tag node is specified.
2974 * @return The conversion result is returned.
2977 s_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
2979 xhtml_t *xhtml = GET_XHTML(pdoc);
2980 Doc *doc = xhtml->doc;
2988 * It is a handler who processes the DL tag.
2990 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2991 * destination is specified.
2992 * @param node [i] The DL tag node is specified.
2993 * @return The conversion result is returned.
2996 s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
2998 xhtml_t *xhtml = GET_XHTML(pdoc);
2999 Doc *doc = xhtml->doc;
3007 * It is a handter who processes the DT tag.
3009 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3010 * destination is specified.
3011 * @param node [i] The DT tag node is specified.
3012 * @return The conversion result is returned.
3015 s_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
3017 xhtml_t *xhtml = GET_XHTML(pdoc);
3018 Doc *doc = xhtml->doc;
3025 * It is a handter who processes the DT tag.
3027 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3028 * destination is specified.
3029 * @param node [i] The DT tag node is specified.
3030 * @return The conversion result is returned.
3033 s_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
3035 xhtml_t *xhtml = GET_XHTML(pdoc);
3036 Doc *doc = xhtml->doc;
3043 * It is a handder who processes the DD tag.
3045 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3046 * destination is specified.
3047 * @param node [i] The DD tag node is specified.
3048 * @return The conversion result is returned.
3051 s_xhtml_1_0_start_dd_tag(void *pdoc, Node *UNUSED(child))
3053 xhtml_t *xhtml = GET_XHTML(pdoc);
3054 Doc *doc = xhtml->doc;
3061 * It is a handder who processes the DD tag.
3063 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3064 * destination is specified.
3065 * @param node [i] The DD tag node is specified.
3066 * @return The conversion result is returned.
3069 s_xhtml_1_0_end_dd_tag(void *pdoc, Node *UNUSED(child))
3071 xhtml_t *xhtml = GET_XHTML(pdoc);
3072 Doc *doc = xhtml->doc;
3079 * It is a handler who processes the MENU tag.
3081 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3082 * destination is specified.
3083 * @param node [i] The MENU tag node is specified.
3084 * @return The conversion result is returned.
3087 s_xhtml_1_0_start_menu_tag(void *pdoc, Node *node)
3089 xhtml_t *xhtml = GET_XHTML(pdoc);
3090 Doc *doc = xhtml->doc;
3093 /*--------------------------------------------------------------------------*/
3094 /* Get Attributes */
3095 /*--------------------------------------------------------------------------*/
3096 for (attr = qs_get_attr(doc,node);
3098 attr = qs_get_next_attr(doc,attr)) {
3099 char *name = qs_get_attr_name(doc,attr);
3100 char *value = qs_get_attr_value(doc,attr);
3101 if (STRCASEEQ('t','T',"type",name)) {
3102 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3116 * It is a hanmenuer who processes the MENU tag.
3118 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3119 * destination is specified.
3120 * @param node [i] The MENU tag node is specified.
3121 * @return The conversion result is returned.
3124 s_xhtml_1_0_end_menu_tag(void *pdoc, Node *UNUSED(child))
3126 xhtml_t *xhtml = GET_XHTML(pdoc);
3127 Doc *doc = xhtml->doc;
3135 * It is a handler who processes the PLAINTEXT tag.
3137 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3138 * destination is specified.
3139 * @param node [i] The PLAINTEXT tag node is specified.
3140 * @return The conversion result is returned.
3143 s_xhtml_1_0_start_plaintext_tag(void *pdoc, Node *node)
3145 xhtml_t *xhtml = GET_XHTML(pdoc);
3146 Doc *doc = xhtml->doc;
3148 s_xhtml_1_0_start_plaintext_tag_inner(pdoc,node);
3153 s_xhtml_1_0_start_plaintext_tag_inner(void *pdoc, Node *node)
3155 xhtml_t *xhtml = GET_XHTML(pdoc);
3156 Doc *doc = xhtml->doc;
3158 for (child = qs_get_child_node(doc, node);
3160 child = qs_get_next_node(doc, child)) {
3162 s_xhtml_1_0_start_plaintext_tag_inner(pdoc, child);
3169 * It is a handler who processes the PLAINTEXT tag.
3171 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3172 * destination is specified.
3173 * @param node [i] The PLAINTEXT tag node is specified.
3174 * @return The conversion result is returned.
3177 s_xhtml_1_0_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3179 xhtml_t *xhtml = GET_XHTML(pdoc);
3180 Doc *doc = xhtml->doc;
3181 W_L("</plaintext>");
3187 * It is a hanblinker who processes the BLINK tag.
3189 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3190 * destination is specified.
3191 * @param node [i] The BLINK tag node is specified.
3192 * @return The conversion result is returned.
3195 s_xhtml_1_0_start_blink_tag(void *pdoc, Node *UNUSED(child))
3197 xhtml_t *xhtml = GET_XHTML(pdoc);
3198 Doc *doc = xhtml->doc;
3205 * It is a hanblinker who processes the BLINK tag.
3207 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3208 * destination is specified.
3209 * @param node [i] The BLINK tag node is specified.
3210 * @return The conversion result is returned.
3213 s_xhtml_1_0_end_blink_tag(void *pdoc, Node *UNUSED(child))
3215 xhtml_t *xhtml = GET_XHTML(pdoc);
3216 Doc *doc = xhtml->doc;
3224 * It is a handler who processes the MARQUEE tag.
3226 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3227 * destination is specified.
3228 * @param node [i] The MARQUEE tag node is specified.
3229 * @return The conversion result is returned.
3232 s_xhtml_1_0_start_marquee_tag(void *pdoc, Node *node)
3234 xhtml_t *xhtml = GET_XHTML(pdoc);
3235 Doc *doc = xhtml->doc;
3238 /*--------------------------------------------------------------------------*/
3239 /* Get Attributes */
3240 /*--------------------------------------------------------------------------*/
3241 for (attr = qs_get_attr(doc,node);
3243 attr = qs_get_next_attr(doc,attr)) {
3244 char *name = qs_get_attr_name(doc,attr);
3245 char *value = qs_get_attr_value(doc,attr);
3246 if (STRCASEEQ('d','D',"direction", name)) {
3247 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3248 W_L(" direction=\"");
3253 else if (STRCASEEQ('b','B',"behavior",name)) {
3254 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3255 W_L(" behavior=\"");
3260 else if (STRCASEEQ('l','L',"loop",name)) {
3261 if (value && *value) {
3267 else if (STRCASEEQ('b','B',"bgcolor",name)) {
3268 if (value && *value) {
3281 * It is a handler who processes the MARQUEE tag.
3283 * @param pdoc [i/o] The pointer to the XHTML structure at the output
3284 * destination is specified.
3285 * @param node [i] The MARQUEE tag node is specified.
3286 * @return The conversion result is returned.
3289 s_xhtml_1_0_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3291 xhtml_t *xhtml = GET_XHTML(pdoc);
3292 Doc *doc = xhtml->doc;