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_jhtml.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"
27 #define GET_JHTML(X) ((jhtml_t *)(X))
30 #define W_L(X) do { jhtml->out = BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, (X)); } while(0)
31 #define W_V(X) do { jhtml->out = (X) ? BUFFERED_WRITE_VALUE(jhtml->out, &doc->buf, (X)) \
32 : BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, ""); } while(0)
34 static char *s_jhtml_start_html_tag (void *pdoc, Node *node);
35 static char *s_jhtml_end_html_tag (void *pdoc, Node *node);
36 static char *s_jhtml_start_meta_tag (void *pdoc, Node *node);
37 static char *s_jhtml_end_meta_tag (void *pdoc, Node *node);
38 static char *s_jhtml_start_head_tag (void *pdoc, Node *node);
39 static char *s_jhtml_end_head_tag (void *pdoc, Node *node);
40 static char *s_jhtml_start_title_tag (void *pdoc, Node *node);
41 static char *s_jhtml_end_title_tag (void *pdoc, Node *node);
42 static char *s_jhtml_start_base_tag (void *pdoc, Node *node);
43 static char *s_jhtml_end_base_tag (void *pdoc, Node *node);
44 static char *s_jhtml_start_body_tag (void *pdoc, Node *node);
45 static char *s_jhtml_end_body_tag (void *pdoc, Node *node);
46 static char *s_jhtml_start_a_tag (void *pdoc, Node *node);
47 static char *s_jhtml_end_a_tag (void *pdoc, Node *node);
48 static char *s_jhtml_start_pre_tag (void *pdoc, Node *node);
49 static char *s_jhtml_end_pre_tag (void *pdoc, Node *node);
50 static char *s_jhtml_start_p_tag (void *pdoc, Node *node);
51 static char *s_jhtml_end_p_tag (void *pdoc, Node *node);
52 static char *s_jhtml_start_ul_tag (void *pdoc, Node *node);
53 static char *s_jhtml_end_ul_tag (void *pdoc, Node *node);
54 static char *s_jhtml_start_ol_tag (void *pdoc, Node *node);
55 static char *s_jhtml_end_ol_tag (void *pdoc, Node *node);
56 static char *s_jhtml_start_li_tag (void *pdoc, Node *node);
57 static char *s_jhtml_end_li_tag (void *pdoc, Node *node);
58 static char *s_jhtml_start_br_tag (void *pdoc, Node *node);
59 static char *s_jhtml_end_br_tag (void *pdoc, Node *node);
60 static char *s_jhtml_start_tr_tag (void *pdoc, Node *node);
61 static char *s_jhtml_end_tr_tag (void *pdoc, Node *node);
62 static char *s_jhtml_start_font_tag (void *pdoc, Node *node);
63 static char *s_jhtml_end_font_tag (void *pdoc, Node *node);
64 static char *s_jhtml_start_form_tag (void *pdoc, Node *node);
65 static char *s_jhtml_end_form_tag (void *pdoc, Node *node);
66 static char *s_jhtml_start_input_tag (void *pdoc, Node *node);
67 static char *s_jhtml_end_input_tag (void *pdoc, Node *node);
68 static char *s_jhtml_start_center_tag (void *pdoc, Node *node);
69 static char *s_jhtml_end_center_tag (void *pdoc, Node *node);
70 static char *s_jhtml_start_hr_tag (void *pdoc, Node *node);
71 static char *s_jhtml_end_hr_tag (void *pdoc, Node *node);
72 static char *s_jhtml_start_img_tag (void *pdoc, Node *node);
73 static char *s_jhtml_end_img_tag (void *pdoc, Node *node);
74 static char *s_jhtml_start_select_tag (void *pdoc, Node *node);
75 static char *s_jhtml_end_select_tag (void *pdoc, Node *node);
76 static char *s_jhtml_start_option_tag (void *pdoc, Node *node);
77 static char *s_jhtml_end_option_tag (void *pdoc, Node *node);
78 static char *s_jhtml_start_div_tag (void *pdoc, Node *node);
79 static char *s_jhtml_end_div_tag (void *pdoc, Node *node);
80 static char *s_jhtml_start_textarea_tag (void *pdoc, Node *node);
81 static char *s_jhtml_end_textarea_tag (void *pdoc, Node *node);
82 static char *s_jhtml_start_b_tag (void *pdoc, Node *node);
83 static char *s_jhtml_end_b_tag (void *pdoc, Node *node);
84 static char *s_jhtml_chxjif_tag (void *pdoc, Node *node);
85 static char *s_jhtml_text_tag (void *pdoc, Node *node);
86 static char *s_jhtml_start_blockquote_tag(void *pdoc, Node *node);
87 static char *s_jhtml_end_blockquote_tag (void *pdoc, Node *node);
88 static char *s_jhtml_start_dir_tag (void *pdoc, Node *node);
89 static char *s_jhtml_end_dir_tag (void *pdoc, Node *node);
90 static char *s_jhtml_start_dl_tag (void *pdoc, Node *node);
91 static char *s_jhtml_end_dl_tag (void *pdoc, Node *node);
92 static char *s_jhtml_start_dt_tag (void *pdoc, Node *node);
93 static char *s_jhtml_end_dt_tag (void *pdoc, Node *node);
94 static char *s_jhtml_start_dd_tag (void *pdoc, Node *node);
95 static char *s_jhtml_end_dd_tag (void *pdoc, Node *node);
96 static char *s_jhtml_start_h1_tag (void *pdoc, Node *node);
97 static char *s_jhtml_end_h1_tag (void *pdoc, Node *node);
98 static char *s_jhtml_start_h2_tag (void *pdoc, Node *node);
99 static char *s_jhtml_end_h2_tag (void *pdoc, Node *node);
100 static char *s_jhtml_start_h3_tag (void *pdoc, Node *node);
101 static char *s_jhtml_end_h3_tag (void *pdoc, Node *node);
102 static char *s_jhtml_start_h4_tag (void *pdoc, Node *node);
103 static char *s_jhtml_end_h4_tag (void *pdoc, Node *node);
104 static char *s_jhtml_start_h5_tag (void *pdoc, Node *node);
105 static char *s_jhtml_end_h5_tag (void *pdoc, Node *node);
106 static char *s_jhtml_start_h6_tag (void *pdoc, Node *node);
107 static char *s_jhtml_end_h6_tag (void *pdoc, Node *node);
108 static char *s_jhtml_start_menu_tag (void *pdoc, Node *node);
109 static char *s_jhtml_end_menu_tag (void *pdoc, Node *node);
110 static char *s_jhtml_start_plaintext_tag (void *pdoc, Node *node);
111 static char *s_jhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
112 static char *s_jhtml_end_plaintext_tag (void *pdoc, Node *node);
113 static char *s_jhtml_start_blink_tag (void *pdoc, Node *node);
114 static char *s_jhtml_end_blink_tag (void *pdoc, Node *node);
115 static char *s_jhtml_start_marquee_tag(void *pdoc, Node *node);
116 static char *s_jhtml_end_marquee_tag (void *pdoc, Node *node);
118 static void s_init_jhtml(jhtml_t *jhtml, Doc *doc, request_rec *r, device_table *spec);
120 static int s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt);
122 static char *chxj_istyle_to_mode(apr_pool_t *p, const char *s);
126 tag_handler jhtml_handler[] = {
129 s_jhtml_start_html_tag,
130 s_jhtml_end_html_tag,
134 s_jhtml_start_meta_tag,
135 s_jhtml_end_meta_tag,
139 s_jhtml_start_textarea_tag,
140 s_jhtml_end_textarea_tag,
149 s_jhtml_start_pre_tag,
154 s_jhtml_start_ul_tag,
159 s_jhtml_start_li_tag,
164 s_jhtml_start_ol_tag,
169 s_jhtml_start_h1_tag,
174 s_jhtml_start_h2_tag,
179 s_jhtml_start_h3_tag,
184 s_jhtml_start_h4_tag,
189 s_jhtml_start_h5_tag,
194 s_jhtml_start_h6_tag,
199 s_jhtml_start_head_tag,
200 s_jhtml_end_head_tag,
204 s_jhtml_start_title_tag,
205 s_jhtml_end_title_tag,
209 s_jhtml_start_base_tag,
210 s_jhtml_end_base_tag,
214 s_jhtml_start_body_tag,
215 s_jhtml_end_body_tag,
224 s_jhtml_start_br_tag,
234 s_jhtml_start_tr_tag,
249 s_jhtml_start_font_tag,
250 s_jhtml_end_font_tag,
254 s_jhtml_start_form_tag,
255 s_jhtml_end_form_tag,
259 s_jhtml_start_input_tag,
260 s_jhtml_end_input_tag,
264 s_jhtml_start_center_tag,
265 s_jhtml_end_center_tag,
269 s_jhtml_start_hr_tag,
274 s_jhtml_start_img_tag,
279 s_jhtml_start_select_tag,
280 s_jhtml_end_select_tag,
284 s_jhtml_start_option_tag,
285 s_jhtml_end_option_tag,
289 s_jhtml_start_div_tag,
339 s_jhtml_start_dt_tag,
354 s_jhtml_start_blockquote_tag,
355 s_jhtml_end_blockquote_tag,
359 s_jhtml_start_dir_tag,
364 s_jhtml_start_dl_tag,
369 s_jhtml_start_dd_tag,
374 s_jhtml_start_menu_tag,
375 s_jhtml_end_menu_tag,
379 s_jhtml_start_plaintext_tag,
380 s_jhtml_end_plaintext_tag,
384 s_jhtml_start_blink_tag,
385 s_jhtml_end_blink_tag,
389 s_jhtml_start_marquee_tag,
390 s_jhtml_end_marquee_tag,
396 * converts from CHTML5.0 to JHTML.
398 * @param r [i] Requet_rec is appointed.
399 * @param spec [i] The result of the device specification processing which
400 * was done in advance is appointed.
401 * @param src [i] The character string before the converting is appointed.
402 * @return The character string after the converting is returned.
411 chxjconvrule_entry *entryp,
423 /*--------------------------------------------------------------------------*/
425 /*--------------------------------------------------------------------------*/
427 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
429 DBG(r,"I found qrcode xml");
432 DBG(r,"not found qrcode xml");
434 /*--------------------------------------------------------------------------*/
435 /* The CHTML structure is initialized. */
436 /*--------------------------------------------------------------------------*/
437 s_init_jhtml(&jhtml, &doc, r, spec);
439 jhtml.entryp = entryp;
440 jhtml.cookie = cookie;
442 chxj_set_content_type(r, "text/html; charset=Windows-31J");
444 /*--------------------------------------------------------------------------*/
445 /* The character string of the input is analyzed. */
446 /*--------------------------------------------------------------------------*/
447 qs_init_malloc(&doc);
448 qs_init_root_node(&doc);
450 apr_pool_create(&pool, r->pool);
451 ss = apr_pcalloc(pool, srclen + 1);
453 memset(ss, 0, srclen + 1);
454 memcpy(ss, src, srclen);
457 chxj_dump_out("[src] CHTML -> JHTML", ss, srclen);
460 qs_parse_string(&doc,ss,strlen(ss));
462 chxj_buffered_write_init(r->pool, &doc.buf);
463 /*--------------------------------------------------------------------------*/
464 /* It converts it from CHTML to JHTML. */
465 /*--------------------------------------------------------------------------*/
466 chxj_node_exchange(spec,r,(void*)&jhtml, &doc, qs_get_root(&doc), 0);
467 jhtml.out = chxj_buffered_write_flush(jhtml.out, &doc.buf);
468 dst = apr_pstrdup(pool, jhtml.out);
469 chxj_buffered_write_terminate(&doc.buf);
472 qs_all_free(&doc,QX_LOGMARK);
475 return apr_pstrdup(pool,ss);
478 dst = apr_psprintf(pool, "\n");
480 *dstlen = strlen(dst);
483 chxj_dump_out("[dst] CHTML -> JHTML", dst, *dstlen);
491 * The CHTML structure is initialized.
493 * @param jhtml [i/o] The pointer to the JHTML structure that wants to be
494 * initialized is specified.
495 * @param doc [i] The Doc structure that should be set to the initialized
496 * JHTML structure is specified.
497 * @param r [i] To use POOL, the pointer to request_rec is specified.
498 * @param spec [i] The pointer to the device_table
501 s_init_jhtml(jhtml_t* jhtml, Doc* doc, request_rec* r, device_table* spec)
503 memset(doc, 0, sizeof(Doc));
504 memset(jhtml, 0, sizeof(jhtml_t));
509 jhtml->out = qs_alloc_zero_byte_string(r);
510 jhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
511 jhtml->doc->parse_mode = PARSE_MODE_CHTML;
516 * Corresponding EMOJI to a current character-code is retrieved.
517 * The substitution character string is stored in the rslt pointer if agreeing.
519 * @param jhtml [i] The pointer to the CHTML structure is specified.
520 * @param txt [i] The character string to want to examine whether it is
521 * EMOJI is specified.
522 * @param rslt [o] The pointer to the pointer that stores the result is
524 * @return When corresponding EMOJI exists, it returns it excluding 0.
527 s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt)
539 if (! spec) DBG(r,"spec is NULL");
541 for (ee = jhtml->conf->emoji;
545 unsigned char hex1byte;
546 unsigned char hex2byte;
549 DBG(r,"emoji->imode is NULL");
553 hex1byte = ee->imode->hex1byte & 0xff;
554 hex2byte = ee->imode->hex2byte & 0xff;
556 if (ee->imode->string
557 && strlen(ee->imode->string) > 0
558 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
559 if (spec == NULL || spec->emoji_type == NULL) {
560 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
561 return strlen(ee->imode->string);
568 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
569 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
570 if (spec == NULL || spec->emoji_type == NULL) {
571 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
584 * It is a handler who processes the HTML tag.
586 * @param pdoc [i/o] The pointer to the CHTML structure at the output
587 * destination is specified.
588 * @param node [i] The HTML tag node is specified.
589 * @return The conversion result is returned.
592 s_jhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
599 jhtml = GET_JHTML(pdoc);
602 DBG(r, "start s_jhtml_start_html_tag()");
604 /*--------------------------------------------------------------------------*/
606 /*--------------------------------------------------------------------------*/
609 DBG(r, "end s_jhtml_start_html_tag()");
616 * It is a handler who processes the HTML tag.
618 * @param pdoc [i/o] The pointer to the CHTML structure at the output
619 * destination is specified.
620 * @param node [i] The HTML tag node is specified.
621 * @return The conversion result is returned.
624 s_jhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
626 jhtml_t *jhtml = GET_JHTML(pdoc);
627 Doc *doc = jhtml->doc;
636 * It is a handler who processes the META tag.
638 * @param pdoc [i/o] The pointer to the CHTML structure at the output
639 * destination is specified.
640 * @param node [i] The META tag node is specified.
641 * @return The conversion result is returned.
644 s_jhtml_start_meta_tag(void *pdoc, Node *node)
650 int content_type_flag;
653 jhtml = GET_JHTML(pdoc);
657 content_type_flag = 0;
660 /*--------------------------------------------------------------------------*/
662 /*--------------------------------------------------------------------------*/
663 for (attr = qs_get_attr(doc,node);
665 attr = qs_get_next_attr(doc,attr)) {
666 char *name = qs_get_attr_name(doc,attr);
667 char *value = qs_get_attr_value(doc,attr);
671 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
672 /*----------------------------------------------------------------------*/
674 /*----------------------------------------------------------------------*/
675 W_L(" http-equiv=\"");
678 if (STRCASEEQ('c','C',"content-type",value)) {
679 content_type_flag = 1;
681 if (STRCASEEQ('r','R',"refresh",value)) {
689 if (strcasecmp(name, "content") == 0 && value && *value) {
690 /*----------------------------------------------------------------------*/
692 /*----------------------------------------------------------------------*/
693 if (content_type_flag) {
697 W_L("text/html; charset=Windows-31J");
706 buf = apr_pstrdup(r->pool, value);
708 url = strchr(buf, ';');
710 sec = apr_pstrdup(r->pool, buf);
713 url = chxj_encoding_parameter(r, url);
714 url = chxj_add_cookie_parameter(r, url, jhtml->cookie);
744 * It is a handler who processes the META tag.
746 * @param pdoc [i/o] The pointer to the CHTML structure at the output
747 * destination is specified.
748 * @param node [i] The META tag node is specified.
749 * @return The conversion result is returned.
752 s_jhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
754 jhtml_t *jhtml = GET_JHTML(pdoc);
761 * It is a handler who processes the HEAD tag.
763 * @param pdoc [i/o] The pointer to the CHTML structure at the output
764 * destination is specified.
765 * @param node [i] The HEAD tag node is specified.
766 * @return The conversion result is returned.
769 s_jhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
775 jhtml = GET_JHTML(pdoc);
785 * It is a handler who processes the HEAD tag.
787 * @param pdoc [i/o] The pointer to the CHTML structure at the output
788 * destination is specified.
789 * @param node [i] The HEAD tag node is specified.
790 * @return The conversion result is returned.
793 s_jhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
799 jhtml = GET_JHTML(pdoc);
809 * It is a handler who processes the TITLE tag.
811 * @param pdoc [i/o] The pointer to the CHTML structure at the output
812 * destination is specified.
813 * @param node [i] The TITLE tag node is specified.
814 * @return The conversion result is returned.
817 s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
823 jhtml = GET_JHTML(pdoc);
833 * It is a handler who processes the TITLE tag.
835 * @param pdoc [i/o] The pointer to the CHTML structure at the output
836 * destination is specified.
837 * @param node [i] The TITLE tag node is specified.
838 * @return The conversion result is returned.
841 s_jhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
847 jhtml = GET_JHTML(pdoc);
857 * It is a handler who processes the BASE tag.
859 * @param pdoc [i/o] The pointer to the CHTML structure at the output
860 * destination is specified.
861 * @param node [i] The BASE tag node is specified.
862 * @return The conversion result is returned.
865 s_jhtml_start_base_tag(void *pdoc, Node *node)
872 jhtml = GET_JHTML(pdoc);
877 /*--------------------------------------------------------------------------*/
879 /*--------------------------------------------------------------------------*/
880 for (attr = qs_get_attr(doc,node);
882 attr = qs_get_next_attr(doc,attr)) {
883 char *name = qs_get_attr_name(doc,attr);
884 char *value = qs_get_attr_value(doc,attr);
885 if (STRCASEEQ('h','H',"href",name)) {
897 * It is a handler who processes the BASE tag.
899 * @param pdoc [i/o] The pointer to the CHTML structure at the output
900 * destination is specified.
901 * @param node [i] The BASE tag node is specified.
902 * @return The conversion result is returned.
905 s_jhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
907 jhtml_t *jhtml = GET_JHTML(pdoc);
913 * It is a handler who processes the BODY tag.
915 * @param pdoc [i/o] The pointer to the CHTML structure at the output
916 * destination is specified.
917 * @param node [i] The BODY tag node is specified.
918 * @return The conversion result is returned.
921 s_jhtml_start_body_tag(void *pdoc, Node *node)
928 jhtml = GET_JHTML(pdoc);
933 /*--------------------------------------------------------------------------*/
935 /*--------------------------------------------------------------------------*/
936 for (attr = qs_get_attr(doc,node);
938 attr = qs_get_next_attr(doc,attr)) {
939 char *name = qs_get_attr_name(doc,attr);
940 char *value = qs_get_attr_value(doc,attr);
941 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
942 /*----------------------------------------------------------------------*/
944 /*----------------------------------------------------------------------*/
949 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
950 /*----------------------------------------------------------------------*/
952 /*----------------------------------------------------------------------*/
957 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
958 /*----------------------------------------------------------------------*/
960 /*----------------------------------------------------------------------*/
965 else if (STRCASEEQ('a','A',"alink",name)) {
966 /*----------------------------------------------------------------------*/
968 /*----------------------------------------------------------------------*/
971 else if (STRCASEEQ('v','V',"vlink",name) && value && *value) {
972 /*----------------------------------------------------------------------*/
974 /*----------------------------------------------------------------------*/
986 * It is a handler who processes the BODY tag.
988 * @param pdoc [i/o] The pointer to the CHTML structure at the output
989 * destination is specified.
990 * @param node [i] The BODY tag node is specified.
991 * @return The conversion result is returned.
994 s_jhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1000 jhtml = GET_JHTML(pdoc);
1010 * It is a handler who processes the A tag.
1012 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1013 * destination is specified.
1014 * @param node [i] The A tag node is specified.
1015 * @return The conversion result is returned.
1018 s_jhtml_start_a_tag(void *pdoc, Node *node)
1025 jhtml = GET_JHTML(pdoc);
1030 /*--------------------------------------------------------------------------*/
1031 /* Get Attributes */
1032 /*--------------------------------------------------------------------------*/
1033 for (attr = qs_get_attr(doc,node);
1035 attr = qs_get_next_attr(doc,attr)) {
1036 char *name = qs_get_attr_name(doc,attr);
1037 char *value = qs_get_attr_value(doc,attr);
1038 if (STRCASEEQ('n','N',"name",name)) {
1039 /*----------------------------------------------------------------------*/
1041 /*----------------------------------------------------------------------*/
1046 else if (STRCASEEQ('h','H',"href",name)) {
1047 /*----------------------------------------------------------------------*/
1049 /*----------------------------------------------------------------------*/
1050 value = chxj_encoding_parameter(r, value);
1051 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1056 else if (STRCASEEQ('a','A',"accesskey",name)) {
1057 /*----------------------------------------------------------------------*/
1059 /*----------------------------------------------------------------------*/
1060 W_L(" accesskey=\"");
1064 else if (STRCASEEQ('c','C',"cti",name)) {
1065 /*----------------------------------------------------------------------*/
1067 /*----------------------------------------------------------------------*/
1072 else if (STRCASEEQ('i','I',"ijam",name)) {
1073 /*----------------------------------------------------------------------*/
1075 /*----------------------------------------------------------------------*/
1078 else if (STRCASEEQ('u','U',"utn",name)) {
1079 /*----------------------------------------------------------------------*/
1081 /* It is special only for CHTML. */
1082 /*----------------------------------------------------------------------*/
1085 else if (STRCASEEQ('t','T',"telbook",name)) {
1086 /*----------------------------------------------------------------------*/
1088 /*----------------------------------------------------------------------*/
1091 else if (STRCASEEQ('k','K',"kana",name)) {
1092 /*----------------------------------------------------------------------*/
1094 /*----------------------------------------------------------------------*/
1097 else if (STRCASEEQ('e','E',"email",name)) {
1098 /*----------------------------------------------------------------------*/
1100 /*----------------------------------------------------------------------*/
1103 else if (STRCASEEQ('i','I',"ista",name)) {
1104 /*----------------------------------------------------------------------*/
1106 /*----------------------------------------------------------------------*/
1109 else if (STRCASEEQ('i','I',"ilet",name)) {
1110 /*----------------------------------------------------------------------*/
1112 /*----------------------------------------------------------------------*/
1115 else if (STRCASEEQ('i','I',"iswf",name)) {
1116 /*----------------------------------------------------------------------*/
1118 /*----------------------------------------------------------------------*/
1121 else if (STRCASEEQ('i','I',"irst",name)) {
1122 /*----------------------------------------------------------------------*/
1124 /*----------------------------------------------------------------------*/
1134 * It is a handler who processes the A tag.
1136 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1137 * destination is specified.
1138 * @param node [i] The A tag node is specified.
1139 * @return The conversion result is returned.
1142 s_jhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1148 jhtml = GET_JHTML(pdoc);
1158 * It is a handler who processes the BR tag.
1160 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1161 * destination is specified.
1162 * @param node [i] The BR tag node is specified.
1163 * @return The conversion result is returned.
1166 s_jhtml_start_br_tag(void *pdoc, Node *node)
1173 jhtml = GET_JHTML(pdoc);
1178 /*--------------------------------------------------------------------------*/
1179 /* Get Attributes */
1180 /*--------------------------------------------------------------------------*/
1181 for (attr = qs_get_attr(doc,node);
1183 attr = qs_get_next_attr(doc,attr)) {
1184 char *name = qs_get_attr_name(doc,attr);
1185 char *value = qs_get_attr_value(doc,attr);
1186 if (STRCASEEQ('c','C',"clear",name)) {
1187 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1200 * It is a handler who processes the BR tag.
1202 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1203 * destination is specified.
1204 * @param node [i] The BR tag node is specified.
1205 * @return The conversion result is returned.
1208 s_jhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1210 jhtml_t *jhtml = GET_JHTML(pdoc);
1216 * It is a handler who processes the TR tag.
1218 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1219 * destination is specified.
1220 * @param node [i] The TR tag node is specified.
1221 * @return The conversion result is returned.
1224 s_jhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1230 jhtml = GET_JHTML(pdoc);
1240 * It is a handler who processes the TR tag.
1242 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1243 * destination is specified.
1244 * @param node [i] The TR tag node is specified.
1245 * @return The conversion result is returned.
1248 s_jhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1250 jhtml_t *jhtml = GET_JHTML(pdoc);
1256 * It is a handler who processes the FONT tag.
1258 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1259 * destination is specified.
1260 * @param node [i] The FONT tag node is specified.
1261 * @return The conversion result is returned.
1264 s_jhtml_start_font_tag(void *pdoc, Node *node)
1271 jhtml = GET_JHTML(pdoc);
1276 /*--------------------------------------------------------------------------*/
1277 /* Get Attributes */
1278 /*--------------------------------------------------------------------------*/
1279 for (attr = qs_get_attr(doc,node);
1281 attr = qs_get_next_attr(doc,attr)) {
1282 char *name = qs_get_attr_name(doc,attr);
1283 char *value = qs_get_attr_value(doc,attr);
1284 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1289 else if (STRCASEEQ('s','S',"size",name)) {
1290 /*----------------------------------------------------------------------*/
1292 /*----------------------------------------------------------------------*/
1302 * It is a handler who processes the FONT tag.
1304 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1305 * destination is specified.
1306 * @param node [i] The FONT tag node is specified.
1307 * @return The conversion result is returned.
1310 s_jhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1316 jhtml = GET_JHTML(pdoc);
1326 * It is a handler who processes the FORM tag.
1328 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1329 * destination is specified.
1330 * @param node [i] The FORM tag node is specified.
1331 * @return The conversion result is returned.
1334 s_jhtml_start_form_tag(void *pdoc, Node *node)
1343 jhtml = GET_JHTML(pdoc);
1348 /*--------------------------------------------------------------------------*/
1349 /* Get Attributes */
1350 /*--------------------------------------------------------------------------*/
1351 for (attr = qs_get_attr(doc,node);
1353 attr = qs_get_next_attr(doc,attr)) {
1354 char *name = qs_get_attr_name(doc,attr);
1355 char *value = qs_get_attr_value(doc,attr);
1356 if (STRCASEEQ('a','A',"action",name)) {
1357 /*----------------------------------------------------------------------*/
1359 /*----------------------------------------------------------------------*/
1363 dc = chxj_add_cookie_parameter(r, value, jhtml->cookie);
1364 if (strcmp(dc, value)) {
1368 else if (STRCASEEQ('m','M',"method",name)) {
1369 /*----------------------------------------------------------------------*/
1371 /*----------------------------------------------------------------------*/
1376 else if (STRCASEEQ('u','U',"utn",name)) {
1377 /*----------------------------------------------------------------------*/
1379 /* It is special only for CHTML. */
1380 /*----------------------------------------------------------------------*/
1385 /*-------------------------------------------------------------------------*/
1387 /*-------------------------------------------------------------------------*/
1391 /*-------------------------------------------------------------------------*/
1392 /* Add cookie parameter */
1393 /*-------------------------------------------------------------------------*/
1394 if (jhtml->cookie && jhtml->cookie->cookie_id && dcflag == 1) {
1395 char *vv = apr_psprintf(doc->buf.pool, "<input type='hidden' name='%s' value='%s'>",
1397 chxj_url_decode(r, jhtml->cookie->cookie_id));
1405 * It is a handler who processes the FORM tag.
1407 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1408 * destination is specified.
1409 * @param node [i] The FORM tag node is specified.
1410 * @return The conversion result is returned.
1413 s_jhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1415 jhtml_t *jhtml = GET_JHTML(pdoc);
1416 Doc *doc = jhtml->doc;
1423 * It is a handler who processes the INPUT tag.
1425 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1426 * destination is specified.
1427 * @param node [i] The INPUT tag node is specified.
1428 * @return The conversion result is returned.
1431 s_jhtml_start_input_tag(void *pdoc, Node *node)
1445 jhtml = GET_JHTML(pdoc);
1458 /*--------------------------------------------------------------------------*/
1459 /* Get Attributes */
1460 /*--------------------------------------------------------------------------*/
1461 type = qs_get_type_attr(doc, node, r);
1462 name = qs_get_name_attr(doc, node, r);
1463 value = qs_get_value_attr(doc,node,r);
1464 istyle = qs_get_istyle_attr(doc,node,r);
1465 max_length = qs_get_maxlength_attr(doc,node,r);
1466 checked = qs_get_checked_attr(doc,node,r);
1467 accesskey = qs_get_accesskey_attr(doc, node, r);
1468 size = qs_get_size_attr(doc, node, r);
1471 if (type && (STRCASEEQ('t','T',"text", type) ||
1472 STRCASEEQ('p','P',"password",type) ||
1473 STRCASEEQ('c','C',"checkbox",type) ||
1474 STRCASEEQ('r','R',"radio", type) ||
1475 STRCASEEQ('h','H',"hidden", type) ||
1476 STRCASEEQ('s','S',"submit", type) ||
1477 STRCASEEQ('r','R',"reset", type))) {
1483 if (size && *size) {
1488 if (name && *name) {
1493 if (value && *value) {
1495 W_V(chxj_add_slash_to_doublequote(doc->pool,value));
1498 if (accesskey && *accesskey) {
1499 W_L(" accesskey=\"");
1503 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1504 /*------------------------------------------------------------------------*/
1506 /*------------------------------------------------------------------------*/
1507 if (type && STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
1513 char *vv = chxj_istyle_to_mode(doc->buf.pool,istyle);
1519 else if (type && STRCASEEQ('p','P',"password",type)) {
1524 /*--------------------------------------------------------------------------*/
1525 /* The figure is default for the password. */
1526 /*--------------------------------------------------------------------------*/
1527 if (max_length && *max_length) {
1528 if (chxj_chk_numeric(max_length) == 0) {
1529 W_L(" maxlength=\"");
1544 * It is a handler who processes the INPUT tag.
1546 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1547 * destination is specified.
1548 * @param node [i] The INPUT tag node is specified.
1549 * @return The conversion result is returned.
1552 s_jhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1554 jhtml_t *jhtml = GET_JHTML(pdoc);
1560 * It is a handler who processes the CENTER tag.
1562 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1563 * destination is specified.
1564 * @param node [i] The CENTER tag node is specified.
1565 * @return The conversion result is returned.
1568 s_jhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1570 jhtml_t *jhtml = GET_JHTML(pdoc);
1571 Doc *doc = jhtml->doc;
1578 * It is a handler who processes the CENTER tag.
1580 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1581 * destination is specified.
1582 * @param node [i] The CENTER tag node is specified.
1583 * @return The conversion result is returned.
1586 s_jhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1592 jhtml = GET_JHTML(pdoc);
1602 * It is a handler who processes the li tag.
1604 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1605 * destination is specified.
1606 * @param node [i] The li tag node is specified.
1607 * @return The conversion result is returned.
1610 s_jhtml_start_li_tag(void *pdoc, Node *node)
1617 jhtml = GET_JHTML(pdoc);
1622 /*--------------------------------------------------------------------------*/
1623 /* Get Attributes */
1624 /*--------------------------------------------------------------------------*/
1625 for (attr = qs_get_attr(doc,node);
1627 attr = qs_get_next_attr(doc,attr)) {
1628 char *name = qs_get_attr_name(doc,attr);
1629 char *value = qs_get_attr_value(doc,attr);
1630 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1635 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1647 * It is a handler who processes the li tag.
1649 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1650 * destination is specified.
1651 * @param node [i] The li tag node is specified.
1652 * @return The conversion result is returned.
1655 s_jhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1661 jhtml = GET_JHTML(pdoc);
1671 * It is a handler who processes the OL tag.
1673 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1674 * destination is specified.
1675 * @param node [i] The OL tag node is specified.
1676 * @return The conversion result is returned.
1679 s_jhtml_start_ol_tag(void *pdoc, Node *node)
1686 jhtml = GET_JHTML(pdoc);
1691 /*--------------------------------------------------------------------------*/
1692 /* Get Attributes */
1693 /*--------------------------------------------------------------------------*/
1694 for (attr = qs_get_attr(doc,node);
1696 attr = qs_get_next_attr(doc,attr)) {
1697 char *name = qs_get_attr_name(doc,attr);
1698 char *value = qs_get_attr_value(doc,attr);
1699 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1704 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1716 * It is a handler who processes the OL tag.
1718 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1719 * destination is specified.
1720 * @param node [i] The OL tag node is specified.
1721 * @return The conversion result is returned.
1724 s_jhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1730 jhtml = GET_JHTML(pdoc);
1740 * It is a handler who processes the P tag.
1742 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1743 * destination is specified.
1744 * @param node [i] The P tag node is specified.
1745 * @return The conversion result is returned.
1748 s_jhtml_start_p_tag(void *pdoc, Node *node)
1756 jhtml = GET_JHTML(pdoc);
1761 for (attr = qs_get_attr(doc,node);
1763 attr = qs_get_next_attr(doc,attr)) {
1764 char *nm = qs_get_attr_name(doc,attr);
1765 char *val = qs_get_attr_value(doc,attr);
1766 if (STRCASEEQ('a','A',"align", nm)) {
1767 /*----------------------------------------------------------------------*/
1768 /* CHTML 1.0 (W3C version 3.2) */
1769 /*----------------------------------------------------------------------*/
1770 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1771 align = apr_pstrdup(doc->buf.pool, val);
1787 * It is a handler who processes the P tag.
1789 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1790 * destination is specified.
1791 * @param node [i] The P tag node is specified.
1792 * @return The conversion result is returned.
1795 s_jhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1797 jhtml_t *jhtml = GET_JHTML(pdoc);
1798 Doc *doc = jhtml->doc;
1806 * It is a handler who processes the PRE tag.
1808 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1809 * destination is specified.
1810 * @param node [i] The PRE tag node is specified.
1811 * @return The conversion result is returned.
1814 s_jhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1816 jhtml_t *jhtml = GET_JHTML(pdoc);
1817 Doc *doc = jhtml->doc;
1826 * It is a handler who processes the PRE tag.
1828 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1829 * destination is specified.
1830 * @param node [i] The PRE tag node is specified.
1831 * @return The conversion result is returned.
1834 s_jhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1836 jhtml_t *jhtml = GET_JHTML(pdoc);
1837 Doc *doc = jhtml->doc;
1847 * It is a handler who processes the UL tag.
1849 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1850 * destination is specified.
1851 * @param node [i] The UL tag node is specified.
1852 * @return The conversion result is returned.
1855 s_jhtml_start_ul_tag(void *pdoc, Node *UNUSED(node))
1857 jhtml_t *jhtml = GET_JHTML(pdoc);
1858 Doc *doc = jhtml->doc;
1866 * It is a handler who processes the UL tag.
1868 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1869 * destination is specified.
1870 * @param node [i] The UL tag node is specified.
1871 * @return The conversion result is returned.
1874 s_jhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1876 jhtml_t *jhtml = GET_JHTML(pdoc);
1877 Doc *doc = jhtml->doc;
1885 * It is a handler who processes the HR tag.
1887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1888 * destination is specified.
1889 * @param node [i] The HR tag node is specified.
1890 * @return The conversion result is returned.
1893 s_jhtml_start_hr_tag(void *pdoc, Node *node)
1895 jhtml_t *jhtml = GET_JHTML(pdoc);
1896 Doc *doc = jhtml->doc;
1900 for (attr = qs_get_attr(doc,node);
1902 attr = qs_get_next_attr(doc,attr)) {
1903 char *name = qs_get_attr_name(doc,attr);
1904 char *value = qs_get_attr_value(doc,attr);
1905 if (STRCASEEQ('a','A',"align",name)) {
1906 /*----------------------------------------------------------------------*/
1908 /*----------------------------------------------------------------------*/
1909 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1915 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1916 /*----------------------------------------------------------------------*/
1918 /*----------------------------------------------------------------------*/
1923 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
1924 /*----------------------------------------------------------------------*/
1926 /*----------------------------------------------------------------------*/
1931 else if (STRCASEEQ('n','N',"noshade",name)) {
1932 /*----------------------------------------------------------------------*/
1934 /*----------------------------------------------------------------------*/
1937 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
1938 /*----------------------------------------------------------------------*/
1940 /*----------------------------------------------------------------------*/
1952 * It is a handler who processes the HR tag.
1954 * @param jhtml [i/o] The pointer to the CHTML structure at the output
1955 * destination is specified.
1956 * @param node [i] The HR tag node is specified.
1957 * @return The conversion result is returned.
1960 s_jhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
1962 jhtml_t *jhtml = GET_JHTML(pdoc);
1968 * It is a handler who processes the IMG tag.
1970 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1971 * destination is specified.
1972 * @param node [i] The IMG tag node is specified.
1973 * @return The conversion result is returned.
1976 s_jhtml_start_img_tag(void *pdoc, Node *node)
1978 jhtml_t *jhtml = GET_JHTML(pdoc);
1979 Doc *doc = jhtml->doc;
1980 request_rec *r = doc->r;
1982 #ifndef IMG_NOT_CONVERT_FILENAME
1983 device_table *spec = jhtml->spec;
1987 /*--------------------------------------------------------------------------*/
1988 /* Get Attributes */
1989 /*--------------------------------------------------------------------------*/
1990 for (attr = qs_get_attr(doc,node);
1992 attr = qs_get_next_attr(doc,attr)) {
1993 char *name = qs_get_attr_name(doc,attr);
1994 char *value = qs_get_attr_value(doc,attr);
1995 if (STRCASEEQ('s','S',"src",name)) {
1996 /*----------------------------------------------------------------------*/
1998 /*----------------------------------------------------------------------*/
1999 #ifdef IMG_NOT_CONVERT_FILENAME
2000 value = chxj_encoding_parameter(r, value);
2001 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2003 value = apr_psprintf(r->pool,
2006 (strchr(value, '?')) ? '&' : '?',
2007 CHXJ_COOKIE_NOUPDATE_PARAM);
2013 value = chxj_img_conv(r, spec, value);
2014 value = chxj_encoding_parameter(r, value);
2015 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2017 value = apr_psprintf(r->pool,
2020 (strchr(value, '?')) ? '&' : '?',
2021 CHXJ_COOKIE_NOUPDATE_PARAM);
2028 else if (STRCASEEQ('a','A',"align",name)) {
2029 /*----------------------------------------------------------------------*/
2031 /*----------------------------------------------------------------------*/
2032 if (value && (STRCASEEQ('t','T',"top", value) ||
2033 STRCASEEQ('m','M',"middle",value) ||
2034 STRCASEEQ('b','B',"bottom",value) ||
2035 STRCASEEQ('l','L',"left", value) ||
2036 STRCASEEQ('r','R',"right", value))) {
2042 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2043 /*----------------------------------------------------------------------*/
2045 /*----------------------------------------------------------------------*/
2050 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2051 /*----------------------------------------------------------------------*/
2053 /*----------------------------------------------------------------------*/
2058 else if (STRCASEEQ('h','H',"hspace",name)) {
2059 /*----------------------------------------------------------------------*/
2061 /*----------------------------------------------------------------------*/
2064 else if (STRCASEEQ('v','V',"vspace",name)) {
2065 /*----------------------------------------------------------------------*/
2067 /*----------------------------------------------------------------------*/
2070 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2071 /*----------------------------------------------------------------------*/
2073 /*----------------------------------------------------------------------*/
2085 * It is a handler who processes the IMG tag.
2087 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2088 * destination is specified.
2089 * @param node [i] The IMG tag node is specified.
2090 * @return The conversion result is returned.
2093 s_jhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2095 jhtml_t *jhtml = GET_JHTML(pdoc);
2101 * It is a handler who processes the SELECT tag.
2103 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2104 * destination is specified.
2105 * @param node [i] The SELECT tag node is specified.
2106 * @return The conversion result is returned.
2109 s_jhtml_start_select_tag(void *pdoc, Node *child)
2111 jhtml_t *jhtml = GET_JHTML(pdoc);
2112 Doc *doc = jhtml->doc;
2116 char *multiple = NULL;
2119 for (attr = qs_get_attr(doc,child);
2121 attr = qs_get_next_attr(doc,attr)) {
2122 char *nm = qs_get_attr_name(doc,attr);
2123 char *val = qs_get_attr_value(doc,attr);
2124 if (STRCASEEQ('s','S',"size",nm)) {
2125 /*----------------------------------------------------------------------*/
2126 /* CHTML 1.0 version 2.0 */
2127 /*----------------------------------------------------------------------*/
2128 size = apr_pstrdup(doc->buf.pool, val);
2130 else if (STRCASEEQ('n','N',"name",nm)) {
2131 /*----------------------------------------------------------------------*/
2132 /* CHTML 1.0 version 2.0 */
2133 /*----------------------------------------------------------------------*/
2134 name = apr_pstrdup(doc->buf.pool, val);
2136 else if (STRCASEEQ('m','M',"multiple", nm)) {
2137 /*----------------------------------------------------------------------*/
2138 /* CHTML 1.0 version 2.0 */
2139 /*----------------------------------------------------------------------*/
2140 multiple = apr_pstrdup(doc->buf.pool, val);
2143 if (size && *size) {
2148 if (name && *name) {
2162 * It is a handler who processes the SELECT tag.
2164 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2165 * destination is specified.
2166 * @param node [i] The SELECT tag node is specified.
2167 * @return The conversion result is returned.
2170 s_jhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2172 jhtml_t *jhtml = GET_JHTML(pdoc);
2173 Doc *doc = jhtml->doc;
2180 * It is a handler who processes the OPTION tag.
2182 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2183 * destination is specified.
2184 * @param node [i] The OPTION tag node is specified.
2185 * @return The conversion result is returned.
2188 s_jhtml_start_option_tag(void *pdoc, Node *child)
2190 jhtml_t *jhtml = GET_JHTML(pdoc);
2191 Doc *doc = jhtml->doc;
2194 char *selected = NULL;
2198 for (attr = qs_get_attr(doc,child);
2200 attr = qs_get_next_attr(doc,attr)) {
2201 char *nm = qs_get_attr_name(doc,attr);
2202 char *val = qs_get_attr_value(doc,attr);
2203 if (STRCASEEQ('s','S',"selected",nm)) {
2204 /*----------------------------------------------------------------------*/
2205 /* CHTML 1.0 version 2.0 */
2206 /*----------------------------------------------------------------------*/
2207 selected = apr_pstrdup(doc->buf.pool, val);
2209 else if (STRCASEEQ('v','V',"value",nm)) {
2210 /*----------------------------------------------------------------------*/
2211 /* CHTML 1.0 version 2.0 */
2212 /*----------------------------------------------------------------------*/
2213 value = apr_pstrdup(doc->buf.pool, val);
2216 if (value && *value) {
2230 * It is a handler who processes the OPTION tag.
2232 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2233 * destination is specified.
2234 * @param node [i] The OPTION tag node is specified.
2235 * @return The conversion result is returned.
2238 s_jhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2240 jhtml_t *jhtml = GET_JHTML(pdoc);
2247 * It is a handler who processes the DIV tag.
2249 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2250 * destination is specified.
2251 * @param node [i] The DIV tag node is specified.
2252 * @return The conversion result is returned.
2255 s_jhtml_start_div_tag(void *pdoc, Node *child)
2263 jhtml = GET_JHTML(pdoc);
2268 for (attr = qs_get_attr(doc,child);
2270 attr = qs_get_next_attr(doc,attr)) {
2271 char *nm = qs_get_attr_name(doc,attr);
2272 char *val = qs_get_attr_value(doc,attr);
2273 if (STRCASEEQ('a','A',"align",nm)) {
2274 /*----------------------------------------------------------------------*/
2275 /* CHTML 1.0 (W3C version 3.2) */
2276 /*----------------------------------------------------------------------*/
2277 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2278 align = apr_pstrdup(doc->buf.pool, val);
2293 * It is a handler who processes the DIV tag.
2295 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2296 * destination is specified.
2297 * @param node [i] The DIV tag node is specified.
2298 * @return The conversion result is returned.
2301 s_jhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2307 jhtml = GET_JHTML(pdoc);
2317 chxj_istyle_to_mode(apr_pool_t *p, const char *s)
2323 case '1': return apr_psprintf(p, "hiragana");
2324 case '2': return apr_psprintf(p, "hankakukana");
2325 case '3': return apr_psprintf(p, "alphabet");
2326 case '4': return apr_psprintf(p, "numeric");
2328 tmp = apr_palloc(p, 1);
2330 return apr_pstrdup(p, tmp);
2334 tmp = apr_palloc(p, 1);
2336 return apr_pstrdup(p,tmp);
2341 s_jhtml_chxjif_tag(void *pdoc, Node *node)
2348 jhtml = GET_JHTML(pdoc);
2352 for (child = qs_get_child_node(doc, node);
2354 child = qs_get_next_node(doc, child)) {
2356 s_jhtml_chxjif_tag(jhtml, child);
2363 * It is a handler who processes the TEXTARE tag.
2365 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2366 * destination is specified.
2367 * @param node [i] The TEXTAREA tag node is specified.
2368 * @return The conversion result is returned.
2371 s_jhtml_start_textarea_tag(void *pdoc, Node *node)
2378 jhtml = GET_JHTML(pdoc);
2382 jhtml->textarea_flag++;
2384 for (attr = qs_get_attr(doc,node);
2386 attr = qs_get_next_attr(doc,attr)) {
2387 char *name = qs_get_attr_name(doc,attr);
2388 char *value = qs_get_attr_value(doc,attr);
2389 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2390 W_L(" accesskey=\"");
2394 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2395 char *vv = chxj_istyle_to_mode(doc->buf.pool,value);
2400 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2405 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2410 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2422 * It is a handler who processes the TEXTAREA tag.
2424 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2425 * destination is specified.
2426 * @param node [i] The TEXTAREA tag node is specified.
2427 * @return The conversion result is returned.
2430 s_jhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2436 jhtml = GET_JHTML(pdoc);
2441 jhtml->textarea_flag--;
2448 * It is a handler who processes the B tag.
2450 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2451 * destination is specified.
2452 * @param node [i] The B tag node is specified.
2453 * @return The conversion result is returned.
2456 s_jhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2462 jhtml = GET_JHTML(pdoc);
2472 * It is a handler who processes the B tag.
2474 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2475 * destination is specified.
2476 * @param node [i] The B tag node is specified.
2477 * @return The conversion result is returned.
2480 s_jhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2482 jhtml_t* jhtml = GET_JHTML(pdoc);
2483 Doc* doc = jhtml->doc;
2490 s_jhtml_text_tag(void* pdoc, Node* child)
2502 jhtml = GET_JHTML(pdoc);
2505 DBG(r, "start s_jhtml_text_tag()");
2507 textval = qs_get_node_value(doc,child);
2508 if (strlen(textval) == 0) {
2512 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2513 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2515 tdst = qs_alloc_zero_byte_string(r);
2516 memset(one_byte, 0, sizeof(one_byte));
2519 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2521 int rtn = s_jhtml_search_emoji(jhtml, &textval[ii], &out);
2523 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2528 if (is_sjis_kanji(textval[ii])) {
2529 one_byte[0] = textval[ii+0];
2530 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2531 one_byte[0] = textval[ii+1];
2532 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2536 if (jhtml->pre_flag) {
2537 one_byte[0] = textval[ii+0];
2538 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2541 if (jhtml->textarea_flag) {
2542 one_byte[0] = textval[ii+0];
2543 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2546 if (textval[ii] != '\r' && textval[ii] != '\n') {
2547 one_byte[0] = textval[ii+0];
2548 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2553 DBG(r, "end s_jhtml_text_tag()");
2559 * It is a handler who processes the BLOCKQUOTE tag.
2561 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2562 * destination is specified.
2563 * @param node [i] The BLOCKQUOTE tag node is specified.
2564 * @return The conversion result is returned.
2567 s_jhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2569 jhtml_t *jhtml = GET_JHTML(pdoc);
2570 Doc *doc = jhtml->doc;
2571 W_L("<blockquote>");
2577 * It is a handler who processes the BLOCKQUOTE tag.
2579 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2580 * destination is specified.
2581 * @param node [i] The BLOCKQUOTE tag node is specified.
2582 * @return The conversion result is returned.
2585 s_jhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2587 jhtml_t *jhtml = GET_JHTML(pdoc);
2588 Doc *doc = jhtml->doc;
2589 W_L("</blockquote>");
2595 * It is a handler who processes the DIR tag.
2597 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2598 * destination is specified.
2599 * @param node [i] The DIR tag node is specified.
2600 * @return The conversion result is returned.
2603 s_jhtml_start_dir_tag(void *pdoc, Node *UNUSED(child))
2605 jhtml_t *jhtml = GET_JHTML(pdoc);
2606 Doc *doc = jhtml->doc;
2613 * It is a handler who processes the DIR tag.
2615 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2616 * destination is specified.
2617 * @param node [i] The DIR tag node is specified.
2618 * @return The conversion result is returned.
2621 s_jhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2623 jhtml_t *jhtml = GET_JHTML(pdoc);
2624 Doc *doc = jhtml->doc;
2631 * It is a handler who processes the DL tag.
2633 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2634 * destination is specified.
2635 * @param node [i] The DL tag node is specified.
2636 * @return The conversion result is returned.
2639 s_jhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2641 jhtml_t *jhtml = GET_JHTML(pdoc);
2642 Doc *doc = jhtml->doc;
2649 * It is a handler who processes the DL tag.
2651 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2652 * destination is specified.
2653 * @param node [i] The DL tag node is specified.
2654 * @return The conversion result is returned.
2657 s_jhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2659 jhtml_t *jhtml = GET_JHTML(pdoc);
2660 Doc *doc = jhtml->doc;
2667 * It is a handler who processes the DT tag.
2669 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2670 * destination is specified.
2671 * @param node [i] The DT tag node is specified.
2672 * @return The conversion result is returned.
2675 s_jhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2677 jhtml_t *jhtml = GET_JHTML(pdoc);
2678 Doc *doc = jhtml->doc;
2685 * It is a handler who processes the DT tag.
2687 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2688 * destination is specified.
2689 * @param node [i] The DT tag node is specified.
2690 * @return The conversion result is returned.
2693 s_jhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2695 jhtml_t *jhtml = GET_JHTML(pdoc);
2701 * It is a handler who processes the DD tag.
2703 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2704 * destination is specified.
2705 * @param node [i] The DD tag node is specified.
2706 * @return The conversion result is returned.
2709 s_jhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2711 jhtml_t *jhtml = GET_JHTML(pdoc);
2712 Doc *doc = jhtml->doc;
2719 * It is a handler who processes the DD tag.
2721 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2722 * destination is specified.
2723 * @param node [i] The DD tag node is specified.
2724 * @return The conversion result is returned.
2727 s_jhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2729 jhtml_t *jhtml = GET_JHTML(pdoc);
2735 * It is a handler who processes the H1 tag.
2737 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2738 * destination is specified.
2739 * @param node [i] The H1 tag node is specified.
2740 * @return The conversion result is returned.
2743 s_jhtml_start_h1_tag(void *pdoc, Node *node)
2751 jhtml = GET_JHTML(pdoc);
2755 for (attr = qs_get_attr(doc,node);
2757 attr = qs_get_next_attr(doc,attr)) {
2760 name = qs_get_attr_name(doc,attr);
2761 value = qs_get_attr_value(doc,attr);
2762 if (STRCASEEQ('a','A',"align", name)) {
2763 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2764 jhtml->h1_align_flag++;
2765 align = apr_pstrdup(doc->buf.pool, value);
2771 W_L("<div align=\"");
2780 * It is a handler who processes the H1 tag.
2782 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2783 * destination is specified.
2784 * @param node [i] The H1 tag node is specified.
2785 * @return The conversion result is returned.
2788 s_jhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2794 jhtml = GET_JHTML(pdoc);
2798 if (jhtml->h1_align_flag) {
2799 jhtml->h1_align_flag--;
2807 * It is a handler who processes the H2 tag.
2809 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2810 * destination is specified.
2811 * @param node [i] The H1 tag node is specified.
2812 * @return The conversion result is returned.
2815 s_jhtml_start_h2_tag(void *pdoc, Node *node)
2823 jhtml = GET_JHTML(pdoc);
2827 for (attr = qs_get_attr(doc,node);
2829 attr = qs_get_next_attr(doc,attr)) {
2832 name = qs_get_attr_name(doc,attr);
2833 value = qs_get_attr_value(doc,attr);
2834 if (STRCASEEQ('a','A',"align", name)) {
2835 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2836 jhtml->h2_align_flag++;
2837 align = apr_pstrdup(doc->buf.pool, value);
2843 W_L("<div align=\"");
2852 * It is a handler who processes the H2 tag.
2854 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2855 * destination is specified.
2856 * @param node [i] The H1 tag node is specified.
2857 * @return The conversion result is returned.
2860 s_jhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
2866 jhtml = GET_JHTML(pdoc);
2870 if (jhtml->h2_align_flag) {
2871 jhtml->h2_align_flag--;
2879 * It is a handler who processes the H3 tag.
2881 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2882 * destination is specified.
2883 * @param node [i] The H1 tag node is specified.
2884 * @return The conversion result is returned.
2887 s_jhtml_start_h3_tag(void *pdoc, Node *node)
2895 jhtml = GET_JHTML(pdoc);
2899 for (attr = qs_get_attr(doc,node);
2901 attr = qs_get_next_attr(doc,attr)) {
2904 name = qs_get_attr_name(doc,attr);
2905 value = qs_get_attr_value(doc,attr);
2906 if (STRCASEEQ('a','A',"align", name)) {
2907 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2908 jhtml->h3_align_flag++;
2909 align = apr_pstrdup(doc->buf.pool, value);
2915 W_L("<div align=\"");
2924 * It is a handler who processes the H3 tag.
2926 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2927 * destination is specified.
2928 * @param node [i] The H1 tag node is specified.
2929 * @return The conversion result is returned.
2932 s_jhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
2938 jhtml = GET_JHTML(pdoc);
2942 if (jhtml->h3_align_flag) {
2943 jhtml->h3_align_flag--;
2951 * It is a handler who processes the H4 tag.
2953 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2954 * destination is specified.
2955 * @param node [i] The H1 tag node is specified.
2956 * @return The conversion result is returned.
2959 s_jhtml_start_h4_tag(void *pdoc, Node *node)
2967 jhtml = GET_JHTML(pdoc);
2971 for (attr = qs_get_attr(doc,node);
2973 attr = qs_get_next_attr(doc,attr)) {
2976 name = qs_get_attr_name(doc,attr);
2977 value = qs_get_attr_value(doc,attr);
2978 if (STRCASEEQ('a','A',"align", name)) {
2979 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2980 jhtml->h4_align_flag++;
2981 align = apr_pstrdup(doc->buf.pool, value);
2987 W_L("<div align=\"");
2996 * It is a handler who processes the H4 tag.
2998 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2999 * destination is specified.
3000 * @param node [i] The H1 tag node is specified.
3001 * @return The conversion result is returned.
3004 s_jhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3010 jhtml = GET_JHTML(pdoc);
3014 if (jhtml->h4_align_flag) {
3015 jhtml->h4_align_flag--;
3023 * It is a handler who processes the H5 tag.
3025 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3026 * destination is specified.
3027 * @param node [i] The H1 tag node is specified.
3028 * @return The conversion result is returned.
3031 s_jhtml_start_h5_tag(void *pdoc, Node *node)
3039 jhtml = GET_JHTML(pdoc);
3043 for (attr = qs_get_attr(doc,node);
3045 attr = qs_get_next_attr(doc,attr)) {
3048 name = qs_get_attr_name(doc,attr);
3049 value = qs_get_attr_value(doc,attr);
3050 if (STRCASEEQ('a','A',"align", name)) {
3051 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3052 jhtml->h5_align_flag++;
3053 align = apr_pstrdup(doc->buf.pool, value);
3059 W_L("<div align=\"");
3068 * It is a handler who processes the H5 tag.
3070 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3071 * destination is specified.
3072 * @param node [i] The H1 tag node is specified.
3073 * @return The conversion result is returned.
3076 s_jhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3082 jhtml = GET_JHTML(pdoc);
3086 if (jhtml->h5_align_flag) {
3087 jhtml->h5_align_flag--;
3095 * It is a handler who processes the H6 tag.
3097 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3098 * destination is specified.
3099 * @param node [i] The H1 tag node is specified.
3100 * @return The conversion result is returned.
3103 s_jhtml_start_h6_tag(void *pdoc, Node *node)
3111 jhtml = GET_JHTML(pdoc);
3115 for (attr = qs_get_attr(doc,node);
3117 attr = qs_get_next_attr(doc,attr)) {
3120 name = qs_get_attr_name(doc,attr);
3121 value = qs_get_attr_value(doc,attr);
3122 if (STRCASEEQ('a','A',"align", name)) {
3123 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3124 jhtml->h6_align_flag++;
3125 align = apr_pstrdup(doc->buf.pool, value);
3131 W_L("<div align=\"");
3140 * It is a handler who processes the H6 tag.
3142 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3143 * destination is specified.
3144 * @param node [i] The H1 tag node is specified.
3145 * @return The conversion result is returned.
3148 s_jhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3154 jhtml = GET_JHTML(pdoc);
3158 if (jhtml->h6_align_flag) {
3159 jhtml->h6_align_flag--;
3167 * It is a handler who processes the MENU tag.
3169 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3170 * destination is specified.
3171 * @param node [i] The MENU tag node is specified.
3172 * @return The conversion result is returned.
3175 s_jhtml_start_menu_tag(void *pdoc, Node *UNUSED(child))
3177 jhtml_t *jhtml = GET_JHTML(pdoc);
3178 Doc *doc = jhtml->doc;
3185 * It is a handler who processes the MENU tag.
3187 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3188 * destination is specified.
3189 * @param node [i] The MENU tag node is specified.
3190 * @return The conversion result is returned.
3193 s_jhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3195 jhtml_t *jhtml = GET_JHTML(pdoc);
3196 Doc *doc = jhtml->doc;
3203 * It is a handler who processes the PLAINTEXT tag.
3205 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3206 * destination is specified.
3207 * @param node [i] The PLAINTEXT tag node is specified.
3208 * @return The conversion result is returned.
3211 s_jhtml_start_plaintext_tag(void *pdoc, Node *node)
3216 jhtml = GET_JHTML(pdoc);
3219 s_jhtml_start_plaintext_tag_inner(pdoc,node);
3224 s_jhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3229 jhtml = GET_JHTML(pdoc);
3231 for (child = qs_get_child_node(doc, node);
3233 child = qs_get_next_node(doc, child)) {
3235 s_jhtml_start_plaintext_tag_inner(pdoc, child);
3242 * It is a handler who processes the PLAINTEXT tag.
3244 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3245 * destination is specified.
3246 * @param node [i] The PLAINTEXT tag node is specified.
3247 * @return The conversion result is returned.
3250 s_jhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3252 jhtml_t *jhtml = GET_JHTML(pdoc);
3258 * It is a handler who processes the BLINK tag.
3260 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3261 * destination is specified.
3262 * @param node [i] The BLINK tag node is specified.
3263 * @return The conversion result is returned.
3266 s_jhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3268 jhtml_t *jhtml = GET_JHTML(pdoc);
3269 Doc *doc = jhtml->doc;
3276 * It is a handler who processes the BLINK tag.
3278 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3279 * destination is specified.
3280 * @param node [i] The BLINK tag node is specified.
3281 * @return The conversion result is returned.
3284 s_jhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3286 jhtml_t *jhtml = GET_JHTML(pdoc);
3287 Doc *doc = jhtml->doc;
3294 * It is a handler who processes the MARQUEE tag.
3296 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3297 * destination is specified.
3298 * @param node [i] The MARQUEE tag node is specified.
3299 * @return The conversion result is returned.
3302 s_jhtml_start_marquee_tag(void *pdoc, Node *node)
3304 jhtml_t *jhtml = GET_JHTML(pdoc);
3305 Doc *doc = jhtml->doc;
3308 /*--------------------------------------------------------------------------*/
3309 /* Get Attributes */
3310 /*--------------------------------------------------------------------------*/
3311 for (attr = qs_get_attr(doc,node);
3313 attr = qs_get_next_attr(doc,attr)) {
3314 char *name = qs_get_attr_name(doc,attr);
3315 char *value = qs_get_attr_value(doc,attr);
3316 if (STRCASEEQ('d','D',"direction", name)) {
3317 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3318 W_L(" direction=\"");
3323 else if (STRCASEEQ('b','B',"behavior",name)) {
3326 else if (STRCASEEQ('l','L',"loop",name)) {
3336 * It is a handler who processes the MARQUEE tag.
3338 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3339 * destination is specified.
3340 * @param node [i] The MARQUEE tag node is specified.
3341 * @return The conversion result is returned.
3344 s_jhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3346 jhtml_t *jhtml = GET_JHTML(pdoc);
3347 Doc *doc = jhtml->doc;