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.
17 #include "chxj_jxhtml.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_header_inf.h"
28 #define GET_JXHTML(X) ((jxhtml_t *)(X))
31 #define W_L(X) do { jxhtml->out = BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, (X)); } while(0)
32 #define W_V(X) do { jxhtml->out = (X) ? BUFFERED_WRITE_VALUE(jxhtml->out, &doc->buf, (X)) \
33 : BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, ""); } while(0)
35 #define W_NLCODE() do { char *nlcode = TO_NLCODE(jxhtml->conf); W_V(nlcode); } while (0)
37 static char *s_jxhtml_start_html_tag (void *pdoc, Node *node);
38 static char *s_jxhtml_end_html_tag (void *pdoc, Node *node);
39 static char *s_jxhtml_start_meta_tag (void *pdoc, Node *node);
40 static char *s_jxhtml_end_meta_tag (void *pdoc, Node *node);
41 static char *s_jxhtml_start_head_tag (void *pdoc, Node *node);
42 static char *s_jxhtml_end_head_tag (void *pdoc, Node *node);
43 static char *s_jxhtml_start_title_tag (void *pdoc, Node *node);
44 static char *s_jxhtml_end_title_tag (void *pdoc, Node *node);
45 static char *s_jxhtml_start_base_tag (void *pdoc, Node *node);
46 static char *s_jxhtml_end_base_tag (void *pdoc, Node *node);
47 static char *s_jxhtml_start_body_tag (void *pdoc, Node *node);
48 static char *s_jxhtml_end_body_tag (void *pdoc, Node *node);
49 static char *s_jxhtml_start_a_tag (void *pdoc, Node *node);
50 static char *s_jxhtml_end_a_tag (void *pdoc, Node *node);
51 static char *s_jxhtml_start_pre_tag (void *pdoc, Node *node);
52 static char *s_jxhtml_end_pre_tag (void *pdoc, Node *node);
53 static char *s_jxhtml_start_p_tag (void *pdoc, Node *node);
54 static char *s_jxhtml_end_p_tag (void *pdoc, Node *node);
55 static char *s_jxhtml_start_ul_tag (void *pdoc, Node *node);
56 static char *s_jxhtml_end_ul_tag (void *pdoc, Node *node);
57 static char *s_jxhtml_start_ol_tag (void *pdoc, Node *node);
58 static char *s_jxhtml_end_ol_tag (void *pdoc, Node *node);
59 static char *s_jxhtml_start_li_tag (void *pdoc, Node *node);
60 static char *s_jxhtml_end_li_tag (void *pdoc, Node *node);
61 static char *s_jxhtml_start_br_tag (void *pdoc, Node *node);
62 static char *s_jxhtml_end_br_tag (void *pdoc, Node *node);
63 static char *s_jxhtml_start_tr_tag (void *pdoc, Node *node);
64 static char *s_jxhtml_end_tr_tag (void *pdoc, Node *node);
65 static char *s_jxhtml_start_font_tag (void *pdoc, Node *node);
66 static char *s_jxhtml_end_font_tag (void *pdoc, Node *node);
67 static char *s_jxhtml_start_form_tag (void *pdoc, Node *node);
68 static char *s_jxhtml_end_form_tag (void *pdoc, Node *node);
69 static char *s_jxhtml_start_input_tag (void *pdoc, Node *node);
70 static char *s_jxhtml_end_input_tag (void *pdoc, Node *node);
71 static char *s_jxhtml_start_center_tag (void *pdoc, Node *node);
72 static char *s_jxhtml_end_center_tag (void *pdoc, Node *node);
73 static char *s_jxhtml_start_hr_tag (void *pdoc, Node *node);
74 static char *s_jxhtml_end_hr_tag (void *pdoc, Node *node);
75 static char *s_jxhtml_start_img_tag (void *pdoc, Node *node);
76 static char *s_jxhtml_end_img_tag (void *pdoc, Node *node);
77 static char *s_jxhtml_start_select_tag (void *pdoc, Node *node);
78 static char *s_jxhtml_end_select_tag (void *pdoc, Node *node);
79 static char *s_jxhtml_start_option_tag (void *pdoc, Node *node);
80 static char *s_jxhtml_end_option_tag (void *pdoc, Node *node);
81 static char *s_jxhtml_start_div_tag (void *pdoc, Node *node);
82 static char *s_jxhtml_end_div_tag (void *pdoc, Node *node);
83 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
84 static char *s_jxhtml_end_textarea_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_start_b_tag (void *pdoc, Node *node);
86 static char *s_jxhtml_end_b_tag (void *pdoc, Node *node);
87 static char *s_jxhtml_chxjif_tag (void *pdoc, Node *node);
88 static char *s_jxhtml_text_tag (void *pdoc, Node *node);
89 static char *s_jxhtml_start_blockquote_tag(void *pdoc, Node *node);
90 static char *s_jxhtml_end_blockquote_tag (void *pdoc, Node *node);
91 static char *s_jxhtml_start_dir_tag (void *pdoc, Node *node);
92 static char *s_jxhtml_end_dir_tag (void *pdoc, Node *node);
93 static char *s_jxhtml_start_dl_tag (void *pdoc, Node *node);
94 static char *s_jxhtml_end_dl_tag (void *pdoc, Node *node);
95 static char *s_jxhtml_start_dt_tag (void *pdoc, Node *node);
96 static char *s_jxhtml_end_dt_tag (void *pdoc, Node *node);
97 static char *s_jxhtml_start_dd_tag (void *pdoc, Node *node);
98 static char *s_jxhtml_end_dd_tag (void *pdoc, Node *node);
99 static char *s_jxhtml_start_h1_tag (void *pdoc, Node *node);
100 static char *s_jxhtml_end_h1_tag (void *pdoc, Node *node);
101 static char *s_jxhtml_start_h2_tag (void *pdoc, Node *node);
102 static char *s_jxhtml_end_h2_tag (void *pdoc, Node *node);
103 static char *s_jxhtml_start_h3_tag (void *pdoc, Node *node);
104 static char *s_jxhtml_end_h3_tag (void *pdoc, Node *node);
105 static char *s_jxhtml_start_h4_tag (void *pdoc, Node *node);
106 static char *s_jxhtml_end_h4_tag (void *pdoc, Node *node);
107 static char *s_jxhtml_start_h5_tag (void *pdoc, Node *node);
108 static char *s_jxhtml_end_h5_tag (void *pdoc, Node *node);
109 static char *s_jxhtml_start_h6_tag (void *pdoc, Node *node);
110 static char *s_jxhtml_end_h6_tag (void *pdoc, Node *node);
111 static char *s_jxhtml_start_menu_tag (void *pdoc, Node *node);
112 static char *s_jxhtml_end_menu_tag (void *pdoc, Node *node);
113 static char *s_jxhtml_start_plaintext_tag (void *pdoc, Node *node);
114 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
115 static char *s_jxhtml_end_plaintext_tag (void *pdoc, Node *node);
116 static char *s_jxhtml_start_blink_tag (void *pdoc, Node *node);
117 static char *s_jxhtml_end_blink_tag (void *pdoc, Node *node);
118 static char *s_jxhtml_start_marquee_tag(void *pdoc, Node *node);
119 static char *s_jxhtml_end_marquee_tag (void *pdoc, Node *node);
120 static char *s_jxhtml_newline_mark (void *pdoc, Node *node);
122 static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
124 static int s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
126 static char *s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s);
130 tag_handler jxhtml_handler[] = {
133 s_jxhtml_start_html_tag,
134 s_jxhtml_end_html_tag,
138 s_jxhtml_start_meta_tag,
139 s_jxhtml_end_meta_tag,
143 s_jxhtml_start_textarea_tag,
144 s_jxhtml_end_textarea_tag,
148 s_jxhtml_start_p_tag,
153 s_jxhtml_start_pre_tag,
154 s_jxhtml_end_pre_tag,
158 s_jxhtml_start_ul_tag,
163 s_jxhtml_start_li_tag,
168 s_jxhtml_start_ol_tag,
173 s_jxhtml_start_h1_tag,
178 s_jxhtml_start_h2_tag,
183 s_jxhtml_start_h3_tag,
188 s_jxhtml_start_h4_tag,
193 s_jxhtml_start_h5_tag,
198 s_jxhtml_start_h6_tag,
203 s_jxhtml_start_head_tag,
204 s_jxhtml_end_head_tag,
208 s_jxhtml_start_title_tag,
209 s_jxhtml_end_title_tag,
213 s_jxhtml_start_base_tag,
214 s_jxhtml_end_base_tag,
218 s_jxhtml_start_body_tag,
219 s_jxhtml_end_body_tag,
223 s_jxhtml_start_a_tag,
228 s_jxhtml_start_br_tag,
238 s_jxhtml_start_tr_tag,
253 s_jxhtml_start_font_tag,
254 s_jxhtml_end_font_tag,
258 s_jxhtml_start_form_tag,
259 s_jxhtml_end_form_tag,
263 s_jxhtml_start_input_tag,
264 s_jxhtml_end_input_tag,
268 s_jxhtml_start_center_tag,
269 s_jxhtml_end_center_tag,
273 s_jxhtml_start_hr_tag,
278 s_jxhtml_start_img_tag,
279 s_jxhtml_end_img_tag,
283 s_jxhtml_start_select_tag,
284 s_jxhtml_end_select_tag,
288 s_jxhtml_start_option_tag,
289 s_jxhtml_end_option_tag,
293 s_jxhtml_start_div_tag,
294 s_jxhtml_end_div_tag,
333 s_jxhtml_start_b_tag,
343 s_jxhtml_start_dt_tag,
358 s_jxhtml_start_blockquote_tag,
359 s_jxhtml_end_blockquote_tag,
363 s_jxhtml_start_dir_tag,
364 s_jxhtml_end_dir_tag,
368 s_jxhtml_start_dl_tag,
373 s_jxhtml_start_dd_tag,
378 s_jxhtml_start_menu_tag,
379 s_jxhtml_end_menu_tag,
383 s_jxhtml_start_plaintext_tag,
384 s_jxhtml_end_plaintext_tag,
388 s_jxhtml_start_blink_tag,
389 s_jxhtml_end_blink_tag,
393 s_jxhtml_start_marquee_tag,
394 s_jxhtml_end_marquee_tag,
398 s_jxhtml_newline_mark,
405 * converts from CHTML5.0 to JXHTML.
407 * @param r [i] Requet_rec is appointed.
408 * @param spec [i] The result of the device specification processing which
409 * was done in advance is appointed.
410 * @param src [i] The character string before the converting is appointed.
411 * @return The character string after the converting is returned.
420 chxjconvrule_entry *entryp,
431 /*--------------------------------------------------------------------------*/
433 /*--------------------------------------------------------------------------*/
435 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
437 DBG(r,"I found qrcode xml");
440 DBG(r,"not found qrcode xml");
442 /*--------------------------------------------------------------------------*/
443 /* The CHTML structure is initialized. */
444 /*--------------------------------------------------------------------------*/
445 s_init_jxhtml(&jxhtml, &doc, r, spec);
447 jxhtml.entryp = entryp;
448 jxhtml.cookie = cookie;
450 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
452 /*--------------------------------------------------------------------------*/
453 /* The character string of the input is analyzed. */
454 /*--------------------------------------------------------------------------*/
455 qs_init_malloc(&doc);
456 qs_init_root_node(&doc);
458 ss = apr_pcalloc(r->pool, srclen + 1);
460 memset(ss, 0, srclen + 1);
461 memcpy(ss, src, srclen);
464 chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
467 qs_parse_string(&doc,ss,strlen(ss));
469 chxj_buffered_write_init(r->pool, &doc.buf);
470 /*--------------------------------------------------------------------------*/
471 /* It converts it from CHTML to JXHTML. */
472 /*--------------------------------------------------------------------------*/
473 chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
474 jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
475 dst = apr_pstrdup(r->pool, jxhtml.out);
476 chxj_buffered_write_terminate(&doc.buf);
479 qs_all_free(&doc,QX_LOGMARK);
482 return apr_pstrdup(r->pool,ss);
485 dst = apr_psprintf(r->pool, "\n");
487 *dstlen = strlen(dst);
490 chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
498 * The CHTML structure is initialized.
500 * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
501 * initialized is specified.
502 * @param doc [i] The Doc structure that should be set to the initialized
503 * JXHTML structure is specified.
504 * @param r [i] To use POOL, the pointer to request_rec is specified.
505 * @param spec [i] The pointer to the device_table
508 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
510 memset(doc, 0, sizeof(Doc));
511 memset(jxhtml, 0, sizeof(jxhtml_t));
516 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
517 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
518 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
523 * Corresponding EMOJI to a current character-code is retrieved.
524 * The substitution character string is stored in the rslt pointer if agreeing.
526 * @param jxhtml [i] The pointer to the CHTML structure is specified.
527 * @param txt [i] The character string to want to examine whether it is
528 * EMOJI is specified.
529 * @param rslt [o] The pointer to the pointer that stores the result is
531 * @return When corresponding EMOJI exists, it returns it excluding 0.
534 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
546 if (! spec) DBG(r,"spec is NULL");
548 for (ee = jxhtml->conf->emoji;
552 unsigned char hex1byte;
553 unsigned char hex2byte;
556 DBG(r,"emoji->imode is NULL");
560 hex1byte = ee->imode->hex1byte & 0xff;
561 hex2byte = ee->imode->hex2byte & 0xff;
563 if (ee->imode->string
564 && strlen(ee->imode->string) > 0
565 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
566 if (spec == NULL || spec->emoji_type == NULL) {
567 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
568 return strlen(ee->imode->string);
575 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
576 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
577 if (spec == NULL || spec->emoji_type == NULL) {
578 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
591 * It is a handler who processes the HTML tag.
593 * @param pdoc [i/o] The pointer to the CHTML structure at the output
594 * destination is specified.
595 * @param node [i] The HTML tag node is specified.
596 * @return The conversion result is returned.
599 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
606 jxhtml = GET_JXHTML(pdoc);
609 DBG(r, "start s_jxhtml_start_html_tag()");
611 W_L("<?xml version='1.0' encoding='Shift_JIS' ?>");
613 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"html-basic10-plus.dtd\">");
616 /*--------------------------------------------------------------------------*/
618 /*--------------------------------------------------------------------------*/
621 DBG(r, "end s_jxhtml_start_html_tag()");
628 * It is a handler who processes the HTML tag.
630 * @param pdoc [i/o] The pointer to the CHTML structure at the output
631 * destination is specified.
632 * @param node [i] The HTML tag node is specified.
633 * @return The conversion result is returned.
636 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
638 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
639 Doc *doc = jxhtml->doc;
648 * It is a handler who processes the META tag.
650 * @param pdoc [i/o] The pointer to the CHTML structure at the output
651 * destination is specified.
652 * @param node [i] The META tag node is specified.
653 * @return The conversion result is returned.
656 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
662 int content_type_flag;
665 jxhtml = GET_JXHTML(pdoc);
669 content_type_flag = 0;
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);
683 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
684 /*----------------------------------------------------------------------*/
686 /*----------------------------------------------------------------------*/
687 W_L(" http-equiv=\"");
690 if (STRCASEEQ('c','C',"content-type",value)) {
691 content_type_flag = 1;
693 if (STRCASEEQ('r','R',"refresh",value)) {
701 if (strcasecmp(name, "content") == 0 && value && *value) {
702 /*----------------------------------------------------------------------*/
704 /*----------------------------------------------------------------------*/
705 if (content_type_flag) {
709 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
718 buf = apr_pstrdup(r->pool, value);
720 url = strchr(buf, ';');
722 sec = apr_pstrdup(r->pool, buf);
725 url = chxj_encoding_parameter(r, url);
755 * It is a handler who processes the META tag.
757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
758 * destination is specified.
759 * @param node [i] The META tag node is specified.
760 * @return The conversion result is returned.
763 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
765 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
772 * It is a handler who processes the HEAD tag.
774 * @param pdoc [i/o] The pointer to the CHTML structure at the output
775 * destination is specified.
776 * @param node [i] The HEAD tag node is specified.
777 * @return The conversion result is returned.
780 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
786 jxhtml = GET_JXHTML(pdoc);
796 * It is a handler who processes the HEAD tag.
798 * @param pdoc [i/o] The pointer to the CHTML structure at the output
799 * destination is specified.
800 * @param node [i] The HEAD tag node is specified.
801 * @return The conversion result is returned.
804 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
810 jxhtml = GET_JXHTML(pdoc);
820 * It is a handler who processes the TITLE tag.
822 * @param pdoc [i/o] The pointer to the CHTML structure at the output
823 * destination is specified.
824 * @param node [i] The TITLE tag node is specified.
825 * @return The conversion result is returned.
828 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
834 jxhtml = GET_JXHTML(pdoc);
844 * It is a handler who processes the TITLE tag.
846 * @param pdoc [i/o] The pointer to the CHTML structure at the output
847 * destination is specified.
848 * @param node [i] The TITLE tag node is specified.
849 * @return The conversion result is returned.
852 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
858 jxhtml = GET_JXHTML(pdoc);
868 * It is a handler who processes the BASE tag.
870 * @param pdoc [i/o] The pointer to the CHTML structure at the output
871 * destination is specified.
872 * @param node [i] The BASE tag node is specified.
873 * @return The conversion result is returned.
876 s_jxhtml_start_base_tag(void *pdoc, Node *node)
883 jxhtml = GET_JXHTML(pdoc);
888 /*--------------------------------------------------------------------------*/
890 /*--------------------------------------------------------------------------*/
891 for (attr = qs_get_attr(doc,node);
893 attr = qs_get_next_attr(doc,attr)) {
894 char *name = qs_get_attr_name(doc,attr);
895 char *value = qs_get_attr_value(doc,attr);
896 if (STRCASEEQ('h','H',"href",name)) {
908 * It is a handler who processes the BASE tag.
910 * @param pdoc [i/o] The pointer to the CHTML structure at the output
911 * destination is specified.
912 * @param node [i] The BASE tag node is specified.
913 * @return The conversion result is returned.
916 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
918 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
924 * It is a handler who processes the BODY tag.
926 * @param pdoc [i/o] The pointer to the CHTML structure at the output
927 * destination is specified.
928 * @param node [i] The BODY tag node is specified.
929 * @return The conversion result is returned.
932 s_jxhtml_start_body_tag(void *pdoc, Node *node)
939 jxhtml = GET_JXHTML(pdoc);
944 /*--------------------------------------------------------------------------*/
946 /*--------------------------------------------------------------------------*/
947 for (attr = qs_get_attr(doc,node);
949 attr = qs_get_next_attr(doc,attr)) {
950 char *name = qs_get_attr_name(doc,attr);
951 char *value = qs_get_attr_value(doc,attr);
952 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
953 /*----------------------------------------------------------------------*/
955 /*----------------------------------------------------------------------*/
960 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
961 /*----------------------------------------------------------------------*/
963 /*----------------------------------------------------------------------*/
968 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
969 /*----------------------------------------------------------------------*/
971 /*----------------------------------------------------------------------*/
976 else if (STRCASEEQ('a','A',"alink",name)) {
977 /*----------------------------------------------------------------------*/
979 /*----------------------------------------------------------------------*/
982 else if (STRCASEEQ('v','V',"vlink",name)) {
983 /*----------------------------------------------------------------------*/
985 /*----------------------------------------------------------------------*/
995 * It is a handler who processes the BODY tag.
997 * @param pdoc [i/o] The pointer to the CHTML structure at the output
998 * destination is specified.
999 * @param node [i] The BODY tag node is specified.
1000 * @return The conversion result is returned.
1003 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1009 jxhtml = GET_JXHTML(pdoc);
1013 W_L("</div></body>");
1019 * It is a handler who processes the A tag.
1021 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1022 * destination is specified.
1023 * @param node [i] The A tag node is specified.
1024 * @return The conversion result is returned.
1027 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1034 jxhtml = GET_JXHTML(pdoc);
1039 /*--------------------------------------------------------------------------*/
1040 /* Get Attributes */
1041 /*--------------------------------------------------------------------------*/
1042 for (attr = qs_get_attr(doc,node);
1044 attr = qs_get_next_attr(doc,attr)) {
1045 char *name = qs_get_attr_name(doc,attr);
1046 char *value = qs_get_attr_value(doc,attr);
1047 if (STRCASEEQ('n','N',"name",name)) {
1048 /*----------------------------------------------------------------------*/
1050 /*----------------------------------------------------------------------*/
1055 else if (STRCASEEQ('h','H',"href",name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1059 value = chxj_encoding_parameter(r, value);
1064 else if (STRCASEEQ('a','A',"accesskey",name)) {
1065 /*----------------------------------------------------------------------*/
1067 /*----------------------------------------------------------------------*/
1068 W_L(" accesskey=\"");
1072 else if (STRCASEEQ('c','C',"cti",name)) {
1073 /*----------------------------------------------------------------------*/
1075 /*----------------------------------------------------------------------*/
1080 else if (STRCASEEQ('i','I',"ijam",name)) {
1081 /*----------------------------------------------------------------------*/
1083 /*----------------------------------------------------------------------*/
1086 else if (STRCASEEQ('u','U',"utn",name)) {
1087 /*----------------------------------------------------------------------*/
1089 /* It is special only for CHTML. */
1090 /*----------------------------------------------------------------------*/
1093 else if (STRCASEEQ('t','T',"telbook",name)) {
1094 /*----------------------------------------------------------------------*/
1096 /*----------------------------------------------------------------------*/
1099 else if (STRCASEEQ('k','K',"kana",name)) {
1100 /*----------------------------------------------------------------------*/
1102 /*----------------------------------------------------------------------*/
1105 else if (STRCASEEQ('e','E',"email",name)) {
1106 /*----------------------------------------------------------------------*/
1108 /*----------------------------------------------------------------------*/
1111 else if (STRCASEEQ('i','I',"ista",name)) {
1112 /*----------------------------------------------------------------------*/
1114 /*----------------------------------------------------------------------*/
1117 else if (STRCASEEQ('i','I',"ilet",name)) {
1118 /*----------------------------------------------------------------------*/
1120 /*----------------------------------------------------------------------*/
1123 else if (STRCASEEQ('i','I',"iswf",name)) {
1124 /*----------------------------------------------------------------------*/
1126 /*----------------------------------------------------------------------*/
1129 else if (STRCASEEQ('i','I',"irst",name)) {
1130 /*----------------------------------------------------------------------*/
1132 /*----------------------------------------------------------------------*/
1142 * It is a handler who processes the A tag.
1144 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1145 * destination is specified.
1146 * @param node [i] The A tag node is specified.
1147 * @return The conversion result is returned.
1150 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1156 jxhtml = GET_JXHTML(pdoc);
1166 * It is a handler who processes the BR tag.
1168 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1169 * destination is specified.
1170 * @param node [i] The BR tag node is specified.
1171 * @return The conversion result is returned.
1174 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1181 jxhtml = GET_JXHTML(pdoc);
1186 /*--------------------------------------------------------------------------*/
1187 /* Get Attributes */
1188 /*--------------------------------------------------------------------------*/
1189 for (attr = qs_get_attr(doc,node);
1191 attr = qs_get_next_attr(doc,attr)) {
1192 char *name = qs_get_attr_name(doc,attr);
1193 char *value = qs_get_attr_value(doc,attr);
1194 if (STRCASEEQ('c','C',"clear",name)) {
1195 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1208 * It is a handler who processes the BR tag.
1210 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1211 * destination is specified.
1212 * @param node [i] The BR tag node is specified.
1213 * @return The conversion result is returned.
1216 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1218 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1224 * It is a handler who processes the TR tag.
1226 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1227 * destination is specified.
1228 * @param node [i] The TR tag node is specified.
1229 * @return The conversion result is returned.
1232 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1238 jxhtml = GET_JXHTML(pdoc);
1248 * It is a handler who processes the TR tag.
1250 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1251 * destination is specified.
1252 * @param node [i] The TR tag node is specified.
1253 * @return The conversion result is returned.
1256 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1258 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1264 * It is a handler who processes the FONT tag.
1266 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1267 * destination is specified.
1268 * @param node [i] The FONT tag node is specified.
1269 * @return The conversion result is returned.
1272 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1281 jxhtml = GET_JXHTML(pdoc);
1285 /*--------------------------------------------------------------------------*/
1286 /* Get Attributes */
1287 /*--------------------------------------------------------------------------*/
1288 for (attr = qs_get_attr(doc,node);
1290 attr = qs_get_next_attr(doc,attr)) {
1291 char *name = qs_get_attr_name(doc,attr);
1292 char *value = qs_get_attr_value(doc,attr);
1293 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1294 color = apr_pstrdup(doc->buf.pool, value);
1296 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1297 /*----------------------------------------------------------------------*/
1299 /*----------------------------------------------------------------------*/
1300 size = apr_pstrdup(doc->buf.pool, value);
1304 W_L("<font color=\"");
1307 jxhtml->font_flag++;
1310 jxhtml->font_size_flag++;
1312 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1313 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1314 case '3': W_L("<span style=\"font-size: small\">"); break;
1315 case '4': W_L("<span style=\"font-size: medium\">"); break;
1316 case '5': W_L("<span style=\"font-size: large\">"); break;
1317 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1318 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1320 if (*(size + 1) == '1') {
1321 W_L("<span style=\"font-size: small\">");
1324 if (*(size + 1) == '2') {
1325 W_L("<span style=\"font-size: x-small\">");
1328 if (*(size + 1) == '3') {
1329 W_L("<span style=\"font-size: xx-small\">");
1332 jxhtml->font_size_flag--;
1336 if (*(size + 1) == '1') {
1337 W_L("<span style=\"font-size: large\">");
1340 if (*(size + 1) == '2') {
1341 W_L("<span style=\"font-size: x-large\">");
1344 if (*(size + 1) == '3') {
1345 W_L("<span style=\"font-size: xx-large\">");
1348 jxhtml->font_size_flag--;
1352 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1353 jxhtml->font_size_flag--;
1361 * It is a handler who processes the FONT tag.
1363 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1364 * destination is specified.
1365 * @param node [i] The FONT tag node is specified.
1366 * @return The conversion result is returned.
1369 s_jxhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1375 jxhtml = GET_JXHTML(pdoc);
1379 if (jxhtml->font_size_flag) {
1381 jxhtml->font_size_flag--;
1383 if (jxhtml->font_flag) {
1385 jxhtml->font_flag--;
1392 * It is a handler who processes the FORM tag.
1394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1395 * destination is specified.
1396 * @param node [i] The FORM tag node is specified.
1397 * @return The conversion result is returned.
1400 s_jxhtml_start_form_tag(void *pdoc, Node *node)
1406 char *new_hidden_tag = NULL;
1407 char *attr_method = NULL;
1408 char *attr_action = NULL;
1409 char *attr_utn = NULL;
1411 jxhtml = GET_JXHTML(pdoc);
1415 /*--------------------------------------------------------------------------*/
1416 /* Get Attributes */
1417 /*--------------------------------------------------------------------------*/
1418 for (attr = qs_get_attr(doc,node);
1420 attr = qs_get_next_attr(doc,attr)) {
1421 char *name = qs_get_attr_name(doc,attr);
1422 char *value = qs_get_attr_value(doc,attr);
1423 if (STRCASEEQ('a','A',"action", name)) {
1424 /*----------------------------------------------------------------------*/
1426 /*----------------------------------------------------------------------*/
1427 attr_action = chxj_encoding_parameter(r, value);
1428 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1430 else if (STRCASEEQ('m','M',"method", name)) {
1431 /*----------------------------------------------------------------------*/
1433 /*----------------------------------------------------------------------*/
1434 attr_method = apr_pstrdup(doc->pool, value);
1436 else if (STRCASEEQ('u','U',"utn", name)) {
1437 /*----------------------------------------------------------------------*/
1439 /* It is special only for CHTML. */
1440 /*----------------------------------------------------------------------*/
1445 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1450 q = strchr(attr_action, '?');
1452 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag);
1453 if (new_hidden_tag) {
1470 if (new_hidden_tag) {
1471 W_V(new_hidden_tag);
1478 * It is a handler who processes the FORM tag.
1480 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1481 * destination is specified.
1482 * @param node [i] The FORM tag node is specified.
1483 * @return The conversion result is returned.
1486 s_jxhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1488 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1489 Doc *doc = jxhtml->doc;
1496 * It is a handler who processes the INPUT tag.
1498 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1499 * destination is specified.
1500 * @param node [i] The INPUT tag node is specified.
1501 * @return The conversion result is returned.
1504 s_jxhtml_start_input_tag(void *pdoc, Node *node)
1518 jxhtml = GET_JXHTML(pdoc);
1531 /*--------------------------------------------------------------------------*/
1532 /* Get Attributes */
1533 /*--------------------------------------------------------------------------*/
1534 type = qs_get_type_attr(doc, node, doc->buf.pool);
1535 name = qs_get_name_attr(doc, node, doc->buf.pool);
1536 value = qs_get_value_attr(doc,node, doc->buf.pool);
1537 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1538 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1539 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1540 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1541 size = qs_get_size_attr(doc, node, doc->buf.pool);
1544 if (type && (STRCASEEQ('t','T',"text", type) ||
1545 STRCASEEQ('p','P',"password",type) ||
1546 STRCASEEQ('c','C',"checkbox",type) ||
1547 STRCASEEQ('r','R',"radio", type) ||
1548 STRCASEEQ('h','H',"hidden", type) ||
1549 STRCASEEQ('s','S',"submit", type) ||
1550 STRCASEEQ('r','R',"reset", type))) {
1556 if (size && *size) {
1561 if (name && *name) {
1566 if (value && *value) {
1568 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1571 if (accesskey && *accesskey) {
1572 W_L(" accesskey=\"");
1576 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1577 /*------------------------------------------------------------------------*/
1579 /*------------------------------------------------------------------------*/
1580 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
1586 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,istyle);
1592 else if (type && STRCASEEQ('p','P',"password",type)) {
1597 /*--------------------------------------------------------------------------*/
1598 /* The figure is default for the password. */
1599 /*--------------------------------------------------------------------------*/
1600 if (max_length && *max_length) {
1601 if (chxj_chk_numeric(max_length) == 0) {
1602 W_L(" maxlength=\"");
1609 W_L(" checked=\"checked\"");
1617 * It is a handler who processes the INPUT tag.
1619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1620 * destination is specified.
1621 * @param node [i] The INPUT tag node is specified.
1622 * @return The conversion result is returned.
1625 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1627 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1633 * It is a handler who processes the CENTER tag.
1635 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1636 * destination is specified.
1637 * @param node [i] The CENTER tag node is specified.
1638 * @return The conversion result is returned.
1641 s_jxhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1643 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1644 Doc *doc = jxhtml->doc;
1651 * It is a handler who processes the CENTER tag.
1653 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1654 * destination is specified.
1655 * @param node [i] The CENTER tag node is specified.
1656 * @return The conversion result is returned.
1659 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1665 jxhtml = GET_JXHTML(pdoc);
1675 * It is a handler who processes the li tag.
1677 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1678 * destination is specified.
1679 * @param node [i] The li tag node is specified.
1680 * @return The conversion result is returned.
1683 s_jxhtml_start_li_tag(void *pdoc, Node *node)
1690 jxhtml = GET_JXHTML(pdoc);
1695 /*--------------------------------------------------------------------------*/
1696 /* Get Attributes */
1697 /*--------------------------------------------------------------------------*/
1698 for (attr = qs_get_attr(doc,node);
1700 attr = qs_get_next_attr(doc,attr)) {
1701 char *name = qs_get_attr_name(doc,attr);
1702 char *value = qs_get_attr_value(doc,attr);
1703 if (STRCASEEQ('t','T',"type",name)) {
1704 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1710 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1722 * It is a handler who processes the li tag.
1724 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1725 * destination is specified.
1726 * @param node [i] The li tag node is specified.
1727 * @return The conversion result is returned.
1730 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1736 jxhtml = GET_JXHTML(pdoc);
1746 * It is a handler who processes the OL tag.
1748 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1749 * destination is specified.
1750 * @param node [i] The OL tag node is specified.
1751 * @return The conversion result is returned.
1754 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
1761 jxhtml = GET_JXHTML(pdoc);
1766 /*--------------------------------------------------------------------------*/
1767 /* Get Attributes */
1768 /*--------------------------------------------------------------------------*/
1769 for (attr = qs_get_attr(doc,node);
1771 attr = qs_get_next_attr(doc,attr)) {
1772 char *name = qs_get_attr_name(doc,attr);
1773 char *value = qs_get_attr_value(doc,attr);
1774 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1779 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1791 * It is a handler who processes the OL tag.
1793 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1794 * destination is specified.
1795 * @param node [i] The OL tag node is specified.
1796 * @return The conversion result is returned.
1799 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1805 jxhtml = GET_JXHTML(pdoc);
1815 * It is a handler who processes the P tag.
1817 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1818 * destination is specified.
1819 * @param node [i] The P tag node is specified.
1820 * @return The conversion result is returned.
1823 s_jxhtml_start_p_tag(void *pdoc, Node *node)
1831 jxhtml = GET_JXHTML(pdoc);
1836 for (attr = qs_get_attr(doc,node);
1838 attr = qs_get_next_attr(doc,attr)) {
1839 char *nm = qs_get_attr_name(doc,attr);
1840 char *val = qs_get_attr_value(doc,attr);
1841 if (STRCASEEQ('a','A',"align", nm)) {
1842 /*----------------------------------------------------------------------*/
1843 /* CHTML 1.0 (W3C version 3.2) */
1844 /*----------------------------------------------------------------------*/
1845 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1846 align = apr_pstrdup(doc->buf.pool, val);
1862 * It is a handler who processes the P tag.
1864 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1865 * destination is specified.
1866 * @param node [i] The P tag node is specified.
1867 * @return The conversion result is returned.
1870 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1872 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1873 Doc *doc = jxhtml->doc;
1881 * It is a handler who processes the PRE tag.
1883 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1884 * destination is specified.
1885 * @param node [i] The PRE tag node is specified.
1886 * @return The conversion result is returned.
1889 s_jxhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1891 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1892 Doc *doc = jxhtml->doc;
1901 * It is a handler who processes the PRE tag.
1903 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1904 * destination is specified.
1905 * @param node [i] The PRE tag node is specified.
1906 * @return The conversion result is returned.
1909 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1911 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1912 Doc *doc = jxhtml->doc;
1922 * It is a handler who processes the UL tag.
1924 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1925 * destination is specified.
1926 * @param node [i] The UL tag node is specified.
1927 * @return The conversion result is returned.
1930 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
1932 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1933 Doc *doc = jxhtml->doc;
1936 /*--------------------------------------------------------------------------*/
1937 /* Get Attributes */
1938 /*--------------------------------------------------------------------------*/
1939 for (attr = qs_get_attr(doc,node);
1941 attr = qs_get_next_attr(doc,attr)) {
1942 char *name = qs_get_attr_name(doc,attr);
1943 char *value = qs_get_attr_value(doc,attr);
1944 if (STRCASEEQ('t','T',"type",name)) {
1945 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1958 * It is a handler who processes the UL tag.
1960 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1961 * destination is specified.
1962 * @param node [i] The UL tag node is specified.
1963 * @return The conversion result is returned.
1966 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1968 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1969 Doc *doc = jxhtml->doc;
1977 * It is a handler who processes the HR tag.
1979 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1980 * destination is specified.
1981 * @param node [i] The HR tag node is specified.
1982 * @return The conversion result is returned.
1985 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
1987 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1988 Doc *doc = jxhtml->doc;
1992 for (attr = qs_get_attr(doc,node);
1994 attr = qs_get_next_attr(doc,attr)) {
1995 char *name = qs_get_attr_name(doc,attr);
1996 char *value = qs_get_attr_value(doc,attr);
1997 if (STRCASEEQ('a','A',"align",name)) {
1998 /*----------------------------------------------------------------------*/
2000 /*----------------------------------------------------------------------*/
2001 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2007 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2008 /*----------------------------------------------------------------------*/
2010 /*----------------------------------------------------------------------*/
2015 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2016 /*----------------------------------------------------------------------*/
2018 /*----------------------------------------------------------------------*/
2023 else if (STRCASEEQ('n','N',"noshade",name)) {
2024 /*----------------------------------------------------------------------*/
2026 /*----------------------------------------------------------------------*/
2029 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2030 /*----------------------------------------------------------------------*/
2032 /*----------------------------------------------------------------------*/
2044 * It is a handler who processes the HR tag.
2046 * @param jxhtml [i/o] The pointer to the CHTML structure at the output
2047 * destination is specified.
2048 * @param node [i] The HR tag node is specified.
2049 * @return The conversion result is returned.
2052 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2054 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2060 * It is a handler who processes the IMG tag.
2062 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2063 * destination is specified.
2064 * @param node [i] The IMG tag node is specified.
2065 * @return The conversion result is returned.
2068 s_jxhtml_start_img_tag(void *pdoc, Node *node)
2070 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2071 Doc *doc = jxhtml->doc;
2072 request_rec *r = doc->r;
2074 #ifndef IMG_NOT_CONVERT_FILENAME
2075 device_table *spec = jxhtml->spec;
2080 /*--------------------------------------------------------------------------*/
2081 /* Get Attributes */
2082 /*--------------------------------------------------------------------------*/
2083 for (attr = qs_get_attr(doc,node);
2085 attr = qs_get_next_attr(doc,attr)) {
2086 char *name = qs_get_attr_name(doc,attr);
2087 char *value = qs_get_attr_value(doc,attr);
2088 if (STRCASEEQ('s','S',"src",name)) {
2089 /*----------------------------------------------------------------------*/
2091 /*----------------------------------------------------------------------*/
2092 #ifdef IMG_NOT_CONVERT_FILENAME
2093 value = chxj_encoding_parameter(r, value);
2094 value = chxj_add_cookie_no_update_parameter(r, value);
2099 value = chxj_img_conv(r, spec, value);
2100 value = chxj_encoding_parameter(r, value);
2101 value = chxj_add_cookie_no_update_parameter(r, value);
2107 else if (STRCASEEQ('a','A',"align",name)) {
2108 /*----------------------------------------------------------------------*/
2110 /*----------------------------------------------------------------------*/
2112 if (STRCASEEQ('t','T',"top", value) ||
2113 STRCASEEQ('m','M',"middle",value) ||
2114 STRCASEEQ('b','B',"bottom",value) ||
2115 STRCASEEQ('l','L',"left", value) ||
2116 STRCASEEQ('r','R',"right", value)) {
2121 else if (STRCASEEQ('c','C',"center",value)) {
2128 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2129 /*----------------------------------------------------------------------*/
2131 /*----------------------------------------------------------------------*/
2136 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2137 /*----------------------------------------------------------------------*/
2139 /*----------------------------------------------------------------------*/
2144 else if (STRCASEEQ('h','H',"hspace",name)) {
2145 /*----------------------------------------------------------------------*/
2147 /*----------------------------------------------------------------------*/
2150 else if (STRCASEEQ('v','V',"vspace",name)) {
2151 /*----------------------------------------------------------------------*/
2153 /*----------------------------------------------------------------------*/
2156 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2157 /*----------------------------------------------------------------------*/
2159 /*----------------------------------------------------------------------*/
2175 * It is a handler who processes the IMG tag.
2177 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2178 * destination is specified.
2179 * @param node [i] The IMG tag node is specified.
2180 * @return The conversion result is returned.
2183 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2185 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2191 * It is a handler who processes the SELECT tag.
2193 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2194 * destination is specified.
2195 * @param node [i] The SELECT tag node is specified.
2196 * @return The conversion result is returned.
2199 s_jxhtml_start_select_tag(void *pdoc, Node *child)
2201 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2202 Doc *doc = jxhtml->doc;
2206 char *multiple = NULL;
2209 for (attr = qs_get_attr(doc,child);
2211 attr = qs_get_next_attr(doc,attr)) {
2212 char *nm = qs_get_attr_name(doc,attr);
2213 char *val = qs_get_attr_value(doc,attr);
2214 if (STRCASEEQ('s','S',"size",nm)) {
2215 /*----------------------------------------------------------------------*/
2216 /* CHTML 1.0 version 2.0 */
2217 /*----------------------------------------------------------------------*/
2218 size = apr_pstrdup(doc->buf.pool, val);
2220 else if (STRCASEEQ('n','N',"name",nm)) {
2221 /*----------------------------------------------------------------------*/
2222 /* CHTML 1.0 version 2.0 */
2223 /*----------------------------------------------------------------------*/
2224 name = apr_pstrdup(doc->buf.pool, val);
2226 else if (STRCASEEQ('m','M',"multiple", nm)) {
2227 /*----------------------------------------------------------------------*/
2228 /* CHTML 1.0 version 2.0 */
2229 /*----------------------------------------------------------------------*/
2230 multiple = apr_pstrdup(doc->buf.pool, val);
2233 if (size && *size) {
2238 if (name && *name) {
2252 * It is a handler who processes the SELECT tag.
2254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2255 * destination is specified.
2256 * @param node [i] The SELECT tag node is specified.
2257 * @return The conversion result is returned.
2260 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2262 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2263 Doc *doc = jxhtml->doc;
2270 * It is a handler who processes the OPTION tag.
2272 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2273 * destination is specified.
2274 * @param node [i] The OPTION tag node is specified.
2275 * @return The conversion result is returned.
2278 s_jxhtml_start_option_tag(void *pdoc, Node *child)
2280 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2281 Doc *doc = jxhtml->doc;
2284 char *selected = NULL;
2288 for (attr = qs_get_attr(doc,child);
2290 attr = qs_get_next_attr(doc,attr)) {
2291 char *nm = qs_get_attr_name(doc,attr);
2292 char *val = qs_get_attr_value(doc,attr);
2293 if (STRCASEEQ('s','S',"selected",nm)) {
2294 /*----------------------------------------------------------------------*/
2295 /* CHTML 1.0 version 2.0 */
2296 /*----------------------------------------------------------------------*/
2297 selected = apr_pstrdup(doc->buf.pool, val);
2299 else if (STRCASEEQ('v','V',"value",nm)) {
2300 /*----------------------------------------------------------------------*/
2301 /* CHTML 1.0 version 2.0 */
2302 /*----------------------------------------------------------------------*/
2303 value = apr_pstrdup(doc->buf.pool, val);
2306 if (value && *value) {
2320 * It is a handler who processes the OPTION tag.
2322 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2323 * destination is specified.
2324 * @param node [i] The OPTION tag node is specified.
2325 * @return The conversion result is returned.
2328 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2330 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2331 Doc *doc = jxhtml->doc;
2338 * It is a handler who processes the DIV tag.
2340 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2341 * destination is specified.
2342 * @param node [i] The DIV tag node is specified.
2343 * @return The conversion result is returned.
2346 s_jxhtml_start_div_tag(void *pdoc, Node *child)
2354 jxhtml = GET_JXHTML(pdoc);
2359 for (attr = qs_get_attr(doc,child);
2361 attr = qs_get_next_attr(doc,attr)) {
2362 char *nm = qs_get_attr_name(doc,attr);
2363 char *val = qs_get_attr_value(doc,attr);
2364 if (STRCASEEQ('a','A',"align",nm)) {
2365 /*----------------------------------------------------------------------*/
2366 /* CHTML 1.0 (W3C version 3.2) */
2367 /*----------------------------------------------------------------------*/
2368 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2369 align = apr_pstrdup(doc->buf.pool, val);
2384 * It is a handler who processes the DIV tag.
2386 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2387 * destination is specified.
2388 * @param node [i] The DIV tag node is specified.
2389 * @return The conversion result is returned.
2392 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2398 jxhtml = GET_JXHTML(pdoc);
2408 s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s)
2414 case '1': return apr_psprintf(p, "hiragana");
2415 case '2': return apr_psprintf(p, "hankakukana");
2416 case '3': return apr_psprintf(p, "alphabet");
2417 case '4': return apr_psprintf(p, "numeric");
2419 tmp = apr_palloc(p, 1);
2421 return apr_pstrdup(p, tmp);
2425 tmp = apr_palloc(p, 1);
2427 return apr_pstrdup(p,tmp);
2432 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
2439 jxhtml = GET_JXHTML(pdoc);
2443 for (child = qs_get_child_node(doc, node);
2445 child = qs_get_next_node(doc, child)) {
2447 s_jxhtml_chxjif_tag(jxhtml, child);
2454 * It is a handler who processes the TEXTARE tag.
2456 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2457 * destination is specified.
2458 * @param node [i] The TEXTAREA tag node is specified.
2459 * @return The conversion result is returned.
2462 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
2469 jxhtml = GET_JXHTML(pdoc);
2473 jxhtml->textarea_flag++;
2475 for (attr = qs_get_attr(doc,node);
2477 attr = qs_get_next_attr(doc,attr)) {
2478 char *name = qs_get_attr_name(doc,attr);
2479 char *value = qs_get_attr_value(doc,attr);
2480 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2481 W_L(" accesskey=\"");
2485 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2486 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,value);
2491 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2496 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2501 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2513 * It is a handler who processes the TEXTAREA tag.
2515 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2516 * destination is specified.
2517 * @param node [i] The TEXTAREA tag node is specified.
2518 * @return The conversion result is returned.
2521 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2527 jxhtml = GET_JXHTML(pdoc);
2532 jxhtml->textarea_flag--;
2539 * It is a handler who processes the B tag.
2541 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2542 * destination is specified.
2543 * @param node [i] The B tag node is specified.
2544 * @return The conversion result is returned.
2547 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2553 jxhtml = GET_JXHTML(pdoc);
2563 * It is a handler who processes the B tag.
2565 * @param pdoc [i/o] The pointer to the CHTML 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_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2573 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
2574 Doc* doc = jxhtml->doc;
2581 s_jxhtml_text_tag(void* pdoc, Node* child)
2593 jxhtml = GET_JXHTML(pdoc);
2597 textval = qs_get_node_value(doc,child);
2598 if (strlen(textval) == 0) {
2602 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2603 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2605 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2606 memset(one_byte, 0, sizeof(one_byte));
2609 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2611 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
2613 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2618 if (is_sjis_kanji(textval[ii])) {
2619 one_byte[0] = textval[ii+0];
2620 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2621 one_byte[0] = textval[ii+1];
2622 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2626 if (jxhtml->pre_flag) {
2627 one_byte[0] = textval[ii+0];
2628 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2631 if (jxhtml->textarea_flag) {
2632 one_byte[0] = textval[ii+0];
2633 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2636 if (textval[ii] != '\r' && textval[ii] != '\n') {
2637 one_byte[0] = textval[ii+0];
2638 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2648 * It is a handler who processes the BLOCKQUOTE tag.
2650 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2651 * destination is specified.
2652 * @param node [i] The BLOCKQUOTE tag node is specified.
2653 * @return The conversion result is returned.
2656 s_jxhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2658 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2659 Doc *doc = jxhtml->doc;
2660 W_L("<blockquote>");
2666 * It is a handler who processes the BLOCKQUOTE tag.
2668 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2669 * destination is specified.
2670 * @param node [i] The BLOCKQUOTE tag node is specified.
2671 * @return The conversion result is returned.
2674 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2676 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2677 Doc *doc = jxhtml->doc;
2678 W_L("</blockquote>");
2684 * It is a handler who processes the DIR tag.
2686 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2687 * destination is specified.
2688 * @param node [i] The DIR tag node is specified.
2689 * @return The conversion result is returned.
2692 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
2694 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2695 Doc *doc = jxhtml->doc;
2698 for (attr = qs_get_attr(doc,node);
2700 attr = qs_get_next_attr(doc,attr)) {
2701 char *name = qs_get_attr_name(doc,attr);
2702 char *value = qs_get_attr_value(doc,attr);
2703 if (STRCASEEQ('t','T',"type",name)) {
2704 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2717 * It is a handler who processes the DIR tag.
2719 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2720 * destination is specified.
2721 * @param node [i] The DIR tag node is specified.
2722 * @return The conversion result is returned.
2725 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2727 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2728 Doc *doc = jxhtml->doc;
2735 * It is a handler who processes the DL tag.
2737 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2738 * destination is specified.
2739 * @param node [i] The DL tag node is specified.
2740 * @return The conversion result is returned.
2743 s_jxhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2745 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2746 Doc *doc = jxhtml->doc;
2753 * It is a handler who processes the DL tag.
2755 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2756 * destination is specified.
2757 * @param node [i] The DL tag node is specified.
2758 * @return The conversion result is returned.
2761 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2763 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2764 Doc *doc = jxhtml->doc;
2771 * It is a handler who processes the DT tag.
2773 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2774 * destination is specified.
2775 * @param node [i] The DT tag node is specified.
2776 * @return The conversion result is returned.
2779 s_jxhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2781 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2782 Doc *doc = jxhtml->doc;
2789 * It is a handler who processes the DT tag.
2791 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2792 * destination is specified.
2793 * @param node [i] The DT tag node is specified.
2794 * @return The conversion result is returned.
2797 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2799 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2805 * It is a handler who processes the DD tag.
2807 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2808 * destination is specified.
2809 * @param node [i] The DD tag node is specified.
2810 * @return The conversion result is returned.
2813 s_jxhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2815 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2816 Doc *doc = jxhtml->doc;
2823 * It is a handler who processes the DD tag.
2825 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2826 * destination is specified.
2827 * @param node [i] The DD tag node is specified.
2828 * @return The conversion result is returned.
2831 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2833 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2839 * It is a handler who processes the H1 tag.
2841 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2842 * destination is specified.
2843 * @param node [i] The H1 tag node is specified.
2844 * @return The conversion result is returned.
2847 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
2855 jxhtml = GET_JXHTML(pdoc);
2859 for (attr = qs_get_attr(doc,node);
2861 attr = qs_get_next_attr(doc,attr)) {
2862 char *name = qs_get_attr_name(doc,attr);
2863 char *value = qs_get_attr_value(doc,attr);
2864 if (STRCASEEQ('a','A',"align", name)) {
2865 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2866 jxhtml->h1_align_flag++;
2867 align = apr_pstrdup(doc->buf.pool, value);
2873 W_L("<div align=\"");
2882 * It is a handler who processes the H1 tag.
2884 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2885 * destination is specified.
2886 * @param node [i] The H1 tag node is specified.
2887 * @return The conversion result is returned.
2890 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2896 jxhtml = GET_JXHTML(pdoc);
2900 if (jxhtml->h1_align_flag) {
2901 jxhtml->h1_align_flag--;
2909 * It is a handler who processes the H2 tag.
2911 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2912 * destination is specified.
2913 * @param node [i] The H1 tag node is specified.
2914 * @return The conversion result is returned.
2917 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
2925 jxhtml = GET_JXHTML(pdoc);
2929 for (attr = qs_get_attr(doc,node);
2931 attr = qs_get_next_attr(doc,attr)) {
2932 char *name = qs_get_attr_name(doc,attr);
2933 char *value = qs_get_attr_value(doc,attr);
2934 if (STRCASEEQ('a','A',"align", name)) {
2935 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2936 jxhtml->h2_align_flag++;
2937 align = apr_pstrdup(doc->buf.pool, value);
2943 W_L("<div align=\"");
2952 * It is a handler who processes the H2 tag.
2954 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2955 * destination is specified.
2956 * @param node [i] The H1 tag node is specified.
2957 * @return The conversion result is returned.
2960 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
2966 jxhtml = GET_JXHTML(pdoc);
2970 if (jxhtml->h2_align_flag) {
2971 jxhtml->h2_align_flag--;
2979 * It is a handler who processes the H3 tag.
2981 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2982 * destination is specified.
2983 * @param node [i] The H1 tag node is specified.
2984 * @return The conversion result is returned.
2987 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
2995 jxhtml = GET_JXHTML(pdoc);
2999 for (attr = qs_get_attr(doc,node);
3001 attr = qs_get_next_attr(doc,attr)) {
3004 name = qs_get_attr_name(doc,attr);
3005 value = qs_get_attr_value(doc,attr);
3006 if (STRCASEEQ('a','A',"align", name)) {
3007 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3008 jxhtml->h3_align_flag++;
3009 align = apr_pstrdup(doc->buf.pool, value);
3015 W_L("<div align=\"");
3024 * It is a handler who processes the H3 tag.
3026 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3027 * destination is specified.
3028 * @param node [i] The H1 tag node is specified.
3029 * @return The conversion result is returned.
3032 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
3038 jxhtml = GET_JXHTML(pdoc);
3042 if (jxhtml->h3_align_flag) {
3043 jxhtml->h3_align_flag--;
3051 * It is a handler who processes the H4 tag.
3053 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3054 * destination is specified.
3055 * @param node [i] The H1 tag node is specified.
3056 * @return The conversion result is returned.
3059 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
3067 jxhtml = GET_JXHTML(pdoc);
3071 for (attr = qs_get_attr(doc,node);
3073 attr = qs_get_next_attr(doc,attr)) {
3074 char *name = qs_get_attr_name(doc,attr);
3075 char *value = qs_get_attr_value(doc,attr);
3076 if (STRCASEEQ('a','A',"align", name)) {
3077 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3078 jxhtml->h4_align_flag++;
3079 align = apr_pstrdup(doc->buf.pool, value);
3085 W_L("<div align=\"");
3094 * It is a handler who processes the H4 tag.
3096 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3097 * destination is specified.
3098 * @param node [i] The H1 tag node is specified.
3099 * @return The conversion result is returned.
3102 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3108 jxhtml = GET_JXHTML(pdoc);
3112 if (jxhtml->h4_align_flag) {
3113 jxhtml->h4_align_flag--;
3121 * It is a handler who processes the H5 tag.
3123 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3124 * destination is specified.
3125 * @param node [i] The H1 tag node is specified.
3126 * @return The conversion result is returned.
3129 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
3137 jxhtml = GET_JXHTML(pdoc);
3141 for (attr = qs_get_attr(doc,node);
3143 attr = qs_get_next_attr(doc,attr)) {
3144 char *name = qs_get_attr_name(doc,attr);
3145 char *value = qs_get_attr_value(doc,attr);
3146 if (STRCASEEQ('a','A',"align", name)) {
3147 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3148 jxhtml->h5_align_flag++;
3149 align = apr_pstrdup(doc->buf.pool, value);
3155 W_L("<div align=\"");
3164 * It is a handler who processes the H5 tag.
3166 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3167 * destination is specified.
3168 * @param node [i] The H1 tag node is specified.
3169 * @return The conversion result is returned.
3172 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3178 jxhtml = GET_JXHTML(pdoc);
3182 if (jxhtml->h5_align_flag) {
3183 jxhtml->h5_align_flag--;
3191 * It is a handler who processes the H6 tag.
3193 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3194 * destination is specified.
3195 * @param node [i] The H1 tag node is specified.
3196 * @return The conversion result is returned.
3199 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
3207 jxhtml = GET_JXHTML(pdoc);
3211 for (attr = qs_get_attr(doc,node);
3213 attr = qs_get_next_attr(doc,attr)) {
3214 char *name = qs_get_attr_name(doc,attr);
3215 char *value = qs_get_attr_value(doc,attr);
3216 if (STRCASEEQ('a','A',"align", name)) {
3217 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3218 jxhtml->h6_align_flag++;
3219 align = apr_pstrdup(doc->buf.pool, value);
3225 W_L("<div align=\"");
3234 * It is a handler who processes the H6 tag.
3236 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3237 * destination is specified.
3238 * @param node [i] The H1 tag node is specified.
3239 * @return The conversion result is returned.
3242 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3248 jxhtml = GET_JXHTML(pdoc);
3252 if (jxhtml->h6_align_flag) {
3253 jxhtml->h6_align_flag--;
3261 * It is a handler who processes the MENU tag.
3263 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3264 * destination is specified.
3265 * @param node [i] The MENU tag node is specified.
3266 * @return The conversion result is returned.
3269 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
3271 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3272 Doc *doc = jxhtml->doc;
3275 /*--------------------------------------------------------------------------*/
3276 /* Get Attributes */
3277 /*--------------------------------------------------------------------------*/
3278 for (attr = qs_get_attr(doc,node);
3280 attr = qs_get_next_attr(doc,attr)) {
3281 char *name = qs_get_attr_name(doc,attr);
3282 char *value = qs_get_attr_value(doc,attr);
3283 if (STRCASEEQ('t','T',"type",name)) {
3284 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3297 * It is a handler who processes the MENU tag.
3299 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3300 * destination is specified.
3301 * @param node [i] The MENU tag node is specified.
3302 * @return The conversion result is returned.
3305 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3307 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3308 Doc *doc = jxhtml->doc;
3315 * It is a handler who processes the PLAINTEXT tag.
3317 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3318 * destination is specified.
3319 * @param node [i] The PLAINTEXT tag node is specified.
3320 * @return The conversion result is returned.
3323 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
3328 jxhtml = GET_JXHTML(pdoc);
3331 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
3336 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3341 jxhtml = GET_JXHTML(pdoc);
3343 for (child = qs_get_child_node(doc, node);
3345 child = qs_get_next_node(doc, child)) {
3347 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
3354 * It is a handler who processes the PLAINTEXT tag.
3356 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3357 * destination is specified.
3358 * @param node [i] The PLAINTEXT tag node is specified.
3359 * @return The conversion result is returned.
3362 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3364 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3370 * It is a handler who processes the BLINK tag.
3372 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3373 * destination is specified.
3374 * @param node [i] The BLINK tag node is specified.
3375 * @return The conversion result is returned.
3378 s_jxhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3380 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3381 Doc *doc = jxhtml->doc;
3388 * It is a handler who processes the BLINK tag.
3390 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3391 * destination is specified.
3392 * @param node [i] The BLINK tag node is specified.
3393 * @return The conversion result is returned.
3396 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3398 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3399 Doc *doc = jxhtml->doc;
3406 * It is a handler who processes the MARQUEE tag.
3408 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3409 * destination is specified.
3410 * @param node [i] The MARQUEE tag node is specified.
3411 * @return The conversion result is returned.
3414 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
3416 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3417 Doc *doc = jxhtml->doc;
3420 /*--------------------------------------------------------------------------*/
3421 /* Get Attributes */
3422 /*--------------------------------------------------------------------------*/
3423 for (attr = qs_get_attr(doc,node);
3425 attr = qs_get_next_attr(doc,attr)) {
3426 char *name = qs_get_attr_name(doc,attr);
3427 char *value = qs_get_attr_value(doc,attr);
3428 if (STRCASEEQ('d','D',"direction", name)) {
3429 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3430 W_L(" direction=\"");
3435 else if (STRCASEEQ('b','B',"behavior",name)) {
3438 else if (STRCASEEQ('l','L',"loop",name)) {
3441 else if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
3453 * It is a handler who processes the MARQUEE tag.
3455 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3456 * destination is specified.
3457 * @param node [i] The MARQUEE tag node is specified.
3458 * @return The conversion result is returned.
3461 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3463 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3464 Doc *doc = jxhtml->doc;
3471 * It is handler who processes the New Line Code.
3474 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3476 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3477 Doc *doc = jxhtml->doc;