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 /*----------------------------------------------------------------------*/
1383 else if (STRCASEEQ('n','N',"name",name)) {
1390 /*-------------------------------------------------------------------------*/
1392 /*-------------------------------------------------------------------------*/
1396 /*-------------------------------------------------------------------------*/
1397 /* Add cookie parameter */
1398 /*-------------------------------------------------------------------------*/
1399 if (jhtml->cookie && jhtml->cookie->cookie_id && dcflag == 1) {
1400 char *vv = apr_psprintf(doc->buf.pool, "<input type='hidden' name='%s' value='%s'>",
1402 chxj_url_decode(r, jhtml->cookie->cookie_id));
1410 * It is a handler who processes the FORM tag.
1412 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1413 * destination is specified.
1414 * @param node [i] The FORM tag node is specified.
1415 * @return The conversion result is returned.
1418 s_jhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1420 jhtml_t *jhtml = GET_JHTML(pdoc);
1421 Doc *doc = jhtml->doc;
1428 * It is a handler who processes the INPUT tag.
1430 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1431 * destination is specified.
1432 * @param node [i] The INPUT tag node is specified.
1433 * @return The conversion result is returned.
1436 s_jhtml_start_input_tag(void *pdoc, Node *node)
1450 jhtml = GET_JHTML(pdoc);
1463 /*--------------------------------------------------------------------------*/
1464 /* Get Attributes */
1465 /*--------------------------------------------------------------------------*/
1466 type = qs_get_type_attr(doc, node, r);
1467 name = qs_get_name_attr(doc, node, r);
1468 value = qs_get_value_attr(doc,node,r);
1469 istyle = qs_get_istyle_attr(doc,node,r);
1470 max_length = qs_get_maxlength_attr(doc,node,r);
1471 checked = qs_get_checked_attr(doc,node,r);
1472 accesskey = qs_get_accesskey_attr(doc, node, r);
1473 size = qs_get_size_attr(doc, node, r);
1476 if (type && (STRCASEEQ('t','T',"text", type) ||
1477 STRCASEEQ('p','P',"password",type) ||
1478 STRCASEEQ('c','C',"checkbox",type) ||
1479 STRCASEEQ('r','R',"radio", type) ||
1480 STRCASEEQ('h','H',"hidden", type) ||
1481 STRCASEEQ('s','S',"submit", type) ||
1482 STRCASEEQ('r','R',"reset", type))) {
1488 if (size && *size) {
1493 if (name && *name) {
1498 if (value && *value) {
1500 W_V(chxj_add_slash_to_doublequote(doc->pool,value));
1503 if (accesskey && *accesskey) {
1504 W_L(" accesskey=\"");
1508 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1509 /*------------------------------------------------------------------------*/
1511 /*------------------------------------------------------------------------*/
1512 if (type && STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
1518 char *vv = chxj_istyle_to_mode(doc->buf.pool,istyle);
1524 else if (type && STRCASEEQ('p','P',"password",type)) {
1529 /*--------------------------------------------------------------------------*/
1530 /* The figure is default for the password. */
1531 /*--------------------------------------------------------------------------*/
1532 if (max_length && *max_length) {
1533 if (chxj_chk_numeric(max_length) == 0) {
1534 W_L(" maxlength=\"");
1549 * It is a handler who processes the INPUT tag.
1551 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1552 * destination is specified.
1553 * @param node [i] The INPUT tag node is specified.
1554 * @return The conversion result is returned.
1557 s_jhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1559 jhtml_t *jhtml = GET_JHTML(pdoc);
1565 * It is a handler who processes the CENTER tag.
1567 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1568 * destination is specified.
1569 * @param node [i] The CENTER tag node is specified.
1570 * @return The conversion result is returned.
1573 s_jhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1575 jhtml_t *jhtml = GET_JHTML(pdoc);
1576 Doc *doc = jhtml->doc;
1583 * It is a handler who processes the CENTER tag.
1585 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1586 * destination is specified.
1587 * @param node [i] The CENTER tag node is specified.
1588 * @return The conversion result is returned.
1591 s_jhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1597 jhtml = GET_JHTML(pdoc);
1607 * It is a handler who processes the li tag.
1609 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1610 * destination is specified.
1611 * @param node [i] The li tag node is specified.
1612 * @return The conversion result is returned.
1615 s_jhtml_start_li_tag(void *pdoc, Node *node)
1622 jhtml = GET_JHTML(pdoc);
1627 /*--------------------------------------------------------------------------*/
1628 /* Get Attributes */
1629 /*--------------------------------------------------------------------------*/
1630 for (attr = qs_get_attr(doc,node);
1632 attr = qs_get_next_attr(doc,attr)) {
1633 char *name = qs_get_attr_name(doc,attr);
1634 char *value = qs_get_attr_value(doc,attr);
1635 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1640 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1652 * It is a handler who processes the li tag.
1654 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1655 * destination is specified.
1656 * @param node [i] The li tag node is specified.
1657 * @return The conversion result is returned.
1660 s_jhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1666 jhtml = GET_JHTML(pdoc);
1676 * It is a handler who processes the OL tag.
1678 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1679 * destination is specified.
1680 * @param node [i] The OL tag node is specified.
1681 * @return The conversion result is returned.
1684 s_jhtml_start_ol_tag(void *pdoc, Node *node)
1691 jhtml = GET_JHTML(pdoc);
1696 /*--------------------------------------------------------------------------*/
1697 /* Get Attributes */
1698 /*--------------------------------------------------------------------------*/
1699 for (attr = qs_get_attr(doc,node);
1701 attr = qs_get_next_attr(doc,attr)) {
1702 char *name = qs_get_attr_name(doc,attr);
1703 char *value = qs_get_attr_value(doc,attr);
1704 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1709 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1721 * It is a handler who processes the OL tag.
1723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1724 * destination is specified.
1725 * @param node [i] The OL tag node is specified.
1726 * @return The conversion result is returned.
1729 s_jhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1735 jhtml = GET_JHTML(pdoc);
1745 * It is a handler who processes the P tag.
1747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1748 * destination is specified.
1749 * @param node [i] The P tag node is specified.
1750 * @return The conversion result is returned.
1753 s_jhtml_start_p_tag(void *pdoc, Node *node)
1761 jhtml = GET_JHTML(pdoc);
1766 for (attr = qs_get_attr(doc,node);
1768 attr = qs_get_next_attr(doc,attr)) {
1769 char *nm = qs_get_attr_name(doc,attr);
1770 char *val = qs_get_attr_value(doc,attr);
1771 if (STRCASEEQ('a','A',"align", nm)) {
1772 /*----------------------------------------------------------------------*/
1773 /* CHTML 1.0 (W3C version 3.2) */
1774 /*----------------------------------------------------------------------*/
1775 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1776 align = apr_pstrdup(doc->buf.pool, val);
1792 * It is a handler who processes the P tag.
1794 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1795 * destination is specified.
1796 * @param node [i] The P tag node is specified.
1797 * @return The conversion result is returned.
1800 s_jhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1802 jhtml_t *jhtml = GET_JHTML(pdoc);
1803 Doc *doc = jhtml->doc;
1811 * It is a handler who processes the PRE tag.
1813 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1814 * destination is specified.
1815 * @param node [i] The PRE tag node is specified.
1816 * @return The conversion result is returned.
1819 s_jhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1821 jhtml_t *jhtml = GET_JHTML(pdoc);
1822 Doc *doc = jhtml->doc;
1831 * It is a handler who processes the PRE tag.
1833 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1834 * destination is specified.
1835 * @param node [i] The PRE tag node is specified.
1836 * @return The conversion result is returned.
1839 s_jhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1841 jhtml_t *jhtml = GET_JHTML(pdoc);
1842 Doc *doc = jhtml->doc;
1852 * It is a handler who processes the UL tag.
1854 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1855 * destination is specified.
1856 * @param node [i] The UL tag node is specified.
1857 * @return The conversion result is returned.
1860 s_jhtml_start_ul_tag(void *pdoc, Node *UNUSED(node))
1862 jhtml_t *jhtml = GET_JHTML(pdoc);
1863 Doc *doc = jhtml->doc;
1871 * It is a handler who processes the UL tag.
1873 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1874 * destination is specified.
1875 * @param node [i] The UL tag node is specified.
1876 * @return The conversion result is returned.
1879 s_jhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1881 jhtml_t *jhtml = GET_JHTML(pdoc);
1882 Doc *doc = jhtml->doc;
1890 * It is a handler who processes the HR tag.
1892 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1893 * destination is specified.
1894 * @param node [i] The HR tag node is specified.
1895 * @return The conversion result is returned.
1898 s_jhtml_start_hr_tag(void *pdoc, Node *node)
1900 jhtml_t *jhtml = GET_JHTML(pdoc);
1901 Doc *doc = jhtml->doc;
1905 for (attr = qs_get_attr(doc,node);
1907 attr = qs_get_next_attr(doc,attr)) {
1908 char *name = qs_get_attr_name(doc,attr);
1909 char *value = qs_get_attr_value(doc,attr);
1910 if (STRCASEEQ('a','A',"align",name)) {
1911 /*----------------------------------------------------------------------*/
1913 /*----------------------------------------------------------------------*/
1914 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1920 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1921 /*----------------------------------------------------------------------*/
1923 /*----------------------------------------------------------------------*/
1928 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
1929 /*----------------------------------------------------------------------*/
1931 /*----------------------------------------------------------------------*/
1936 else if (STRCASEEQ('n','N',"noshade",name)) {
1937 /*----------------------------------------------------------------------*/
1939 /*----------------------------------------------------------------------*/
1942 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
1943 /*----------------------------------------------------------------------*/
1945 /*----------------------------------------------------------------------*/
1957 * It is a handler who processes the HR tag.
1959 * @param jhtml [i/o] The pointer to the CHTML structure at the output
1960 * destination is specified.
1961 * @param node [i] The HR tag node is specified.
1962 * @return The conversion result is returned.
1965 s_jhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
1967 jhtml_t *jhtml = GET_JHTML(pdoc);
1973 * It is a handler who processes the IMG tag.
1975 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1976 * destination is specified.
1977 * @param node [i] The IMG tag node is specified.
1978 * @return The conversion result is returned.
1981 s_jhtml_start_img_tag(void *pdoc, Node *node)
1983 jhtml_t *jhtml = GET_JHTML(pdoc);
1984 Doc *doc = jhtml->doc;
1985 request_rec *r = doc->r;
1987 #ifndef IMG_NOT_CONVERT_FILENAME
1988 device_table *spec = jhtml->spec;
1992 /*--------------------------------------------------------------------------*/
1993 /* Get Attributes */
1994 /*--------------------------------------------------------------------------*/
1995 for (attr = qs_get_attr(doc,node);
1997 attr = qs_get_next_attr(doc,attr)) {
1998 char *name = qs_get_attr_name(doc,attr);
1999 char *value = qs_get_attr_value(doc,attr);
2000 if (STRCASEEQ('s','S',"src",name)) {
2001 /*----------------------------------------------------------------------*/
2003 /*----------------------------------------------------------------------*/
2004 #ifdef IMG_NOT_CONVERT_FILENAME
2005 value = chxj_encoding_parameter(r, value);
2006 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2008 value = apr_psprintf(r->pool,
2011 (strchr(value, '?')) ? '&' : '?',
2012 CHXJ_COOKIE_NOUPDATE_PARAM);
2018 value = chxj_img_conv(r, spec, value);
2019 value = chxj_encoding_parameter(r, value);
2020 value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
2022 value = apr_psprintf(r->pool,
2025 (strchr(value, '?')) ? '&' : '?',
2026 CHXJ_COOKIE_NOUPDATE_PARAM);
2033 else if (STRCASEEQ('a','A',"align",name)) {
2034 /*----------------------------------------------------------------------*/
2036 /*----------------------------------------------------------------------*/
2037 if (value && (STRCASEEQ('t','T',"top", value) ||
2038 STRCASEEQ('m','M',"middle",value) ||
2039 STRCASEEQ('b','B',"bottom",value) ||
2040 STRCASEEQ('l','L',"left", value) ||
2041 STRCASEEQ('r','R',"right", value))) {
2047 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2048 /*----------------------------------------------------------------------*/
2050 /*----------------------------------------------------------------------*/
2055 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2056 /*----------------------------------------------------------------------*/
2058 /*----------------------------------------------------------------------*/
2063 else if (STRCASEEQ('h','H',"hspace",name)) {
2064 /*----------------------------------------------------------------------*/
2066 /*----------------------------------------------------------------------*/
2069 else if (STRCASEEQ('v','V',"vspace",name)) {
2070 /*----------------------------------------------------------------------*/
2072 /*----------------------------------------------------------------------*/
2075 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2076 /*----------------------------------------------------------------------*/
2078 /*----------------------------------------------------------------------*/
2090 * It is a handler who processes the IMG tag.
2092 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2093 * destination is specified.
2094 * @param node [i] The IMG tag node is specified.
2095 * @return The conversion result is returned.
2098 s_jhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2100 jhtml_t *jhtml = GET_JHTML(pdoc);
2106 * It is a handler who processes the SELECT tag.
2108 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2109 * destination is specified.
2110 * @param node [i] The SELECT tag node is specified.
2111 * @return The conversion result is returned.
2114 s_jhtml_start_select_tag(void *pdoc, Node *child)
2116 jhtml_t *jhtml = GET_JHTML(pdoc);
2117 Doc *doc = jhtml->doc;
2121 char *multiple = NULL;
2124 for (attr = qs_get_attr(doc,child);
2126 attr = qs_get_next_attr(doc,attr)) {
2127 char *nm = qs_get_attr_name(doc,attr);
2128 char *val = qs_get_attr_value(doc,attr);
2129 if (STRCASEEQ('s','S',"size",nm)) {
2130 /*----------------------------------------------------------------------*/
2131 /* CHTML 1.0 version 2.0 */
2132 /*----------------------------------------------------------------------*/
2133 size = apr_pstrdup(doc->buf.pool, val);
2135 else if (STRCASEEQ('n','N',"name",nm)) {
2136 /*----------------------------------------------------------------------*/
2137 /* CHTML 1.0 version 2.0 */
2138 /*----------------------------------------------------------------------*/
2139 name = apr_pstrdup(doc->buf.pool, val);
2141 else if (STRCASEEQ('m','M',"multiple", nm)) {
2142 /*----------------------------------------------------------------------*/
2143 /* CHTML 1.0 version 2.0 */
2144 /*----------------------------------------------------------------------*/
2145 multiple = apr_pstrdup(doc->buf.pool, val);
2148 if (size && *size) {
2153 if (name && *name) {
2167 * It is a handler who processes the SELECT tag.
2169 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2170 * destination is specified.
2171 * @param node [i] The SELECT tag node is specified.
2172 * @return The conversion result is returned.
2175 s_jhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2177 jhtml_t *jhtml = GET_JHTML(pdoc);
2178 Doc *doc = jhtml->doc;
2185 * It is a handler who processes the OPTION tag.
2187 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2188 * destination is specified.
2189 * @param node [i] The OPTION tag node is specified.
2190 * @return The conversion result is returned.
2193 s_jhtml_start_option_tag(void *pdoc, Node *child)
2195 jhtml_t *jhtml = GET_JHTML(pdoc);
2196 Doc *doc = jhtml->doc;
2199 char *selected = NULL;
2203 for (attr = qs_get_attr(doc,child);
2205 attr = qs_get_next_attr(doc,attr)) {
2206 char *nm = qs_get_attr_name(doc,attr);
2207 char *val = qs_get_attr_value(doc,attr);
2208 if (STRCASEEQ('s','S',"selected",nm)) {
2209 /*----------------------------------------------------------------------*/
2210 /* CHTML 1.0 version 2.0 */
2211 /*----------------------------------------------------------------------*/
2212 selected = apr_pstrdup(doc->buf.pool, val);
2214 else if (STRCASEEQ('v','V',"value",nm)) {
2215 /*----------------------------------------------------------------------*/
2216 /* CHTML 1.0 version 2.0 */
2217 /*----------------------------------------------------------------------*/
2218 value = apr_pstrdup(doc->buf.pool, val);
2221 if (value && *value) {
2235 * It is a handler who processes the OPTION tag.
2237 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2238 * destination is specified.
2239 * @param node [i] The OPTION tag node is specified.
2240 * @return The conversion result is returned.
2243 s_jhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2245 jhtml_t *jhtml = GET_JHTML(pdoc);
2252 * It is a handler who processes the DIV tag.
2254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2255 * destination is specified.
2256 * @param node [i] The DIV tag node is specified.
2257 * @return The conversion result is returned.
2260 s_jhtml_start_div_tag(void *pdoc, Node *child)
2268 jhtml = GET_JHTML(pdoc);
2273 for (attr = qs_get_attr(doc,child);
2275 attr = qs_get_next_attr(doc,attr)) {
2276 char *nm = qs_get_attr_name(doc,attr);
2277 char *val = qs_get_attr_value(doc,attr);
2278 if (STRCASEEQ('a','A',"align",nm)) {
2279 /*----------------------------------------------------------------------*/
2280 /* CHTML 1.0 (W3C version 3.2) */
2281 /*----------------------------------------------------------------------*/
2282 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2283 align = apr_pstrdup(doc->buf.pool, val);
2298 * It is a handler who processes the DIV tag.
2300 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2301 * destination is specified.
2302 * @param node [i] The DIV tag node is specified.
2303 * @return The conversion result is returned.
2306 s_jhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2312 jhtml = GET_JHTML(pdoc);
2322 chxj_istyle_to_mode(apr_pool_t *p, const char *s)
2328 case '1': return apr_psprintf(p, "hiragana");
2329 case '2': return apr_psprintf(p, "hankakukana");
2330 case '3': return apr_psprintf(p, "alphabet");
2331 case '4': return apr_psprintf(p, "numeric");
2333 tmp = apr_palloc(p, 1);
2335 return apr_pstrdup(p, tmp);
2339 tmp = apr_palloc(p, 1);
2341 return apr_pstrdup(p,tmp);
2346 s_jhtml_chxjif_tag(void *pdoc, Node *node)
2353 jhtml = GET_JHTML(pdoc);
2357 for (child = qs_get_child_node(doc, node);
2359 child = qs_get_next_node(doc, child)) {
2361 s_jhtml_chxjif_tag(jhtml, child);
2368 * It is a handler who processes the TEXTARE tag.
2370 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2371 * destination is specified.
2372 * @param node [i] The TEXTAREA tag node is specified.
2373 * @return The conversion result is returned.
2376 s_jhtml_start_textarea_tag(void *pdoc, Node *node)
2383 jhtml = GET_JHTML(pdoc);
2387 jhtml->textarea_flag++;
2389 for (attr = qs_get_attr(doc,node);
2391 attr = qs_get_next_attr(doc,attr)) {
2392 char *name = qs_get_attr_name(doc,attr);
2393 char *value = qs_get_attr_value(doc,attr);
2394 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2395 W_L(" accesskey=\"");
2399 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2400 char *vv = chxj_istyle_to_mode(doc->buf.pool,value);
2405 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2410 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2415 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2427 * It is a handler who processes the TEXTAREA tag.
2429 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2430 * destination is specified.
2431 * @param node [i] The TEXTAREA tag node is specified.
2432 * @return The conversion result is returned.
2435 s_jhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2441 jhtml = GET_JHTML(pdoc);
2446 jhtml->textarea_flag--;
2453 * It is a handler who processes the B tag.
2455 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2456 * destination is specified.
2457 * @param node [i] The B tag node is specified.
2458 * @return The conversion result is returned.
2461 s_jhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2467 jhtml = GET_JHTML(pdoc);
2477 * It is a handler who processes the B tag.
2479 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2480 * destination is specified.
2481 * @param node [i] The B tag node is specified.
2482 * @return The conversion result is returned.
2485 s_jhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2487 jhtml_t* jhtml = GET_JHTML(pdoc);
2488 Doc* doc = jhtml->doc;
2495 s_jhtml_text_tag(void* pdoc, Node* child)
2507 jhtml = GET_JHTML(pdoc);
2510 DBG(r, "start s_jhtml_text_tag()");
2512 textval = qs_get_node_value(doc,child);
2513 if (strlen(textval) == 0) {
2517 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2518 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2520 tdst = qs_alloc_zero_byte_string(r);
2521 memset(one_byte, 0, sizeof(one_byte));
2524 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2526 int rtn = s_jhtml_search_emoji(jhtml, &textval[ii], &out);
2528 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2533 if (is_sjis_kanji(textval[ii])) {
2534 one_byte[0] = textval[ii+0];
2535 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2536 one_byte[0] = textval[ii+1];
2537 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2541 if (jhtml->pre_flag) {
2542 one_byte[0] = textval[ii+0];
2543 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2546 if (jhtml->textarea_flag) {
2547 one_byte[0] = textval[ii+0];
2548 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2551 if (textval[ii] != '\r' && textval[ii] != '\n') {
2552 one_byte[0] = textval[ii+0];
2553 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2558 DBG(r, "end s_jhtml_text_tag()");
2564 * It is a handler who processes the BLOCKQUOTE tag.
2566 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2567 * destination is specified.
2568 * @param node [i] The BLOCKQUOTE tag node is specified.
2569 * @return The conversion result is returned.
2572 s_jhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2574 jhtml_t *jhtml = GET_JHTML(pdoc);
2575 Doc *doc = jhtml->doc;
2576 W_L("<blockquote>");
2582 * It is a handler who processes the BLOCKQUOTE tag.
2584 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2585 * destination is specified.
2586 * @param node [i] The BLOCKQUOTE tag node is specified.
2587 * @return The conversion result is returned.
2590 s_jhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2592 jhtml_t *jhtml = GET_JHTML(pdoc);
2593 Doc *doc = jhtml->doc;
2594 W_L("</blockquote>");
2600 * It is a handler who processes the DIR tag.
2602 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2603 * destination is specified.
2604 * @param node [i] The DIR tag node is specified.
2605 * @return The conversion result is returned.
2608 s_jhtml_start_dir_tag(void *pdoc, Node *UNUSED(child))
2610 jhtml_t *jhtml = GET_JHTML(pdoc);
2611 Doc *doc = jhtml->doc;
2618 * It is a handler who processes the DIR tag.
2620 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2621 * destination is specified.
2622 * @param node [i] The DIR tag node is specified.
2623 * @return The conversion result is returned.
2626 s_jhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2628 jhtml_t *jhtml = GET_JHTML(pdoc);
2629 Doc *doc = jhtml->doc;
2636 * It is a handler who processes the DL tag.
2638 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2639 * destination is specified.
2640 * @param node [i] The DL tag node is specified.
2641 * @return The conversion result is returned.
2644 s_jhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2646 jhtml_t *jhtml = GET_JHTML(pdoc);
2647 Doc *doc = jhtml->doc;
2654 * It is a handler who processes the DL tag.
2656 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2657 * destination is specified.
2658 * @param node [i] The DL tag node is specified.
2659 * @return The conversion result is returned.
2662 s_jhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2664 jhtml_t *jhtml = GET_JHTML(pdoc);
2665 Doc *doc = jhtml->doc;
2672 * It is a handler who processes the DT tag.
2674 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2675 * destination is specified.
2676 * @param node [i] The DT tag node is specified.
2677 * @return The conversion result is returned.
2680 s_jhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2682 jhtml_t *jhtml = GET_JHTML(pdoc);
2683 Doc *doc = jhtml->doc;
2690 * It is a handler who processes the DT tag.
2692 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2693 * destination is specified.
2694 * @param node [i] The DT tag node is specified.
2695 * @return The conversion result is returned.
2698 s_jhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2700 jhtml_t *jhtml = GET_JHTML(pdoc);
2706 * It is a handler who processes the DD tag.
2708 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2709 * destination is specified.
2710 * @param node [i] The DD tag node is specified.
2711 * @return The conversion result is returned.
2714 s_jhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2716 jhtml_t *jhtml = GET_JHTML(pdoc);
2717 Doc *doc = jhtml->doc;
2724 * It is a handler who processes the DD tag.
2726 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2727 * destination is specified.
2728 * @param node [i] The DD tag node is specified.
2729 * @return The conversion result is returned.
2732 s_jhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2734 jhtml_t *jhtml = GET_JHTML(pdoc);
2740 * It is a handler who processes the H1 tag.
2742 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2743 * destination is specified.
2744 * @param node [i] The H1 tag node is specified.
2745 * @return The conversion result is returned.
2748 s_jhtml_start_h1_tag(void *pdoc, Node *node)
2756 jhtml = GET_JHTML(pdoc);
2760 for (attr = qs_get_attr(doc,node);
2762 attr = qs_get_next_attr(doc,attr)) {
2765 name = qs_get_attr_name(doc,attr);
2766 value = qs_get_attr_value(doc,attr);
2767 if (STRCASEEQ('a','A',"align", name)) {
2768 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2769 jhtml->h1_align_flag++;
2770 align = apr_pstrdup(doc->buf.pool, value);
2776 W_L("<div align=\"");
2785 * It is a handler who processes the H1 tag.
2787 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2788 * destination is specified.
2789 * @param node [i] The H1 tag node is specified.
2790 * @return The conversion result is returned.
2793 s_jhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2799 jhtml = GET_JHTML(pdoc);
2803 if (jhtml->h1_align_flag) {
2804 jhtml->h1_align_flag--;
2812 * It is a handler who processes the H2 tag.
2814 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2815 * destination is specified.
2816 * @param node [i] The H1 tag node is specified.
2817 * @return The conversion result is returned.
2820 s_jhtml_start_h2_tag(void *pdoc, Node *node)
2828 jhtml = GET_JHTML(pdoc);
2832 for (attr = qs_get_attr(doc,node);
2834 attr = qs_get_next_attr(doc,attr)) {
2837 name = qs_get_attr_name(doc,attr);
2838 value = qs_get_attr_value(doc,attr);
2839 if (STRCASEEQ('a','A',"align", name)) {
2840 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2841 jhtml->h2_align_flag++;
2842 align = apr_pstrdup(doc->buf.pool, value);
2848 W_L("<div align=\"");
2857 * It is a handler who processes the H2 tag.
2859 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2860 * destination is specified.
2861 * @param node [i] The H1 tag node is specified.
2862 * @return The conversion result is returned.
2865 s_jhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
2871 jhtml = GET_JHTML(pdoc);
2875 if (jhtml->h2_align_flag) {
2876 jhtml->h2_align_flag--;
2884 * It is a handler who processes the H3 tag.
2886 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2887 * destination is specified.
2888 * @param node [i] The H1 tag node is specified.
2889 * @return The conversion result is returned.
2892 s_jhtml_start_h3_tag(void *pdoc, Node *node)
2900 jhtml = GET_JHTML(pdoc);
2904 for (attr = qs_get_attr(doc,node);
2906 attr = qs_get_next_attr(doc,attr)) {
2909 name = qs_get_attr_name(doc,attr);
2910 value = qs_get_attr_value(doc,attr);
2911 if (STRCASEEQ('a','A',"align", name)) {
2912 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2913 jhtml->h3_align_flag++;
2914 align = apr_pstrdup(doc->buf.pool, value);
2920 W_L("<div align=\"");
2929 * It is a handler who processes the H3 tag.
2931 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2932 * destination is specified.
2933 * @param node [i] The H1 tag node is specified.
2934 * @return The conversion result is returned.
2937 s_jhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
2943 jhtml = GET_JHTML(pdoc);
2947 if (jhtml->h3_align_flag) {
2948 jhtml->h3_align_flag--;
2956 * It is a handler who processes the H4 tag.
2958 * @param pdoc [i/o] The pointer to the JHTML structure at the output
2959 * destination is specified.
2960 * @param node [i] The H1 tag node is specified.
2961 * @return The conversion result is returned.
2964 s_jhtml_start_h4_tag(void *pdoc, Node *node)
2972 jhtml = GET_JHTML(pdoc);
2976 for (attr = qs_get_attr(doc,node);
2978 attr = qs_get_next_attr(doc,attr)) {
2981 name = qs_get_attr_name(doc,attr);
2982 value = qs_get_attr_value(doc,attr);
2983 if (STRCASEEQ('a','A',"align", name)) {
2984 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2985 jhtml->h4_align_flag++;
2986 align = apr_pstrdup(doc->buf.pool, value);
2992 W_L("<div align=\"");
3001 * It is a handler who processes the H4 tag.
3003 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3004 * destination is specified.
3005 * @param node [i] The H1 tag node is specified.
3006 * @return The conversion result is returned.
3009 s_jhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3015 jhtml = GET_JHTML(pdoc);
3019 if (jhtml->h4_align_flag) {
3020 jhtml->h4_align_flag--;
3028 * It is a handler who processes the H5 tag.
3030 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3031 * destination is specified.
3032 * @param node [i] The H1 tag node is specified.
3033 * @return The conversion result is returned.
3036 s_jhtml_start_h5_tag(void *pdoc, Node *node)
3044 jhtml = GET_JHTML(pdoc);
3048 for (attr = qs_get_attr(doc,node);
3050 attr = qs_get_next_attr(doc,attr)) {
3053 name = qs_get_attr_name(doc,attr);
3054 value = qs_get_attr_value(doc,attr);
3055 if (STRCASEEQ('a','A',"align", name)) {
3056 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3057 jhtml->h5_align_flag++;
3058 align = apr_pstrdup(doc->buf.pool, value);
3064 W_L("<div align=\"");
3073 * It is a handler who processes the H5 tag.
3075 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3076 * destination is specified.
3077 * @param node [i] The H1 tag node is specified.
3078 * @return The conversion result is returned.
3081 s_jhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3087 jhtml = GET_JHTML(pdoc);
3091 if (jhtml->h5_align_flag) {
3092 jhtml->h5_align_flag--;
3100 * It is a handler who processes the H6 tag.
3102 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3103 * destination is specified.
3104 * @param node [i] The H1 tag node is specified.
3105 * @return The conversion result is returned.
3108 s_jhtml_start_h6_tag(void *pdoc, Node *node)
3116 jhtml = GET_JHTML(pdoc);
3120 for (attr = qs_get_attr(doc,node);
3122 attr = qs_get_next_attr(doc,attr)) {
3125 name = qs_get_attr_name(doc,attr);
3126 value = qs_get_attr_value(doc,attr);
3127 if (STRCASEEQ('a','A',"align", name)) {
3128 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3129 jhtml->h6_align_flag++;
3130 align = apr_pstrdup(doc->buf.pool, value);
3136 W_L("<div align=\"");
3145 * It is a handler who processes the H6 tag.
3147 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3148 * destination is specified.
3149 * @param node [i] The H1 tag node is specified.
3150 * @return The conversion result is returned.
3153 s_jhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3159 jhtml = GET_JHTML(pdoc);
3163 if (jhtml->h6_align_flag) {
3164 jhtml->h6_align_flag--;
3172 * It is a handler who processes the MENU tag.
3174 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3175 * destination is specified.
3176 * @param node [i] The MENU tag node is specified.
3177 * @return The conversion result is returned.
3180 s_jhtml_start_menu_tag(void *pdoc, Node *UNUSED(child))
3182 jhtml_t *jhtml = GET_JHTML(pdoc);
3183 Doc *doc = jhtml->doc;
3190 * It is a handler who processes the MENU tag.
3192 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3193 * destination is specified.
3194 * @param node [i] The MENU tag node is specified.
3195 * @return The conversion result is returned.
3198 s_jhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3200 jhtml_t *jhtml = GET_JHTML(pdoc);
3201 Doc *doc = jhtml->doc;
3208 * It is a handler who processes the PLAINTEXT tag.
3210 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3211 * destination is specified.
3212 * @param node [i] The PLAINTEXT tag node is specified.
3213 * @return The conversion result is returned.
3216 s_jhtml_start_plaintext_tag(void *pdoc, Node *node)
3221 jhtml = GET_JHTML(pdoc);
3224 s_jhtml_start_plaintext_tag_inner(pdoc,node);
3229 s_jhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3234 jhtml = GET_JHTML(pdoc);
3236 for (child = qs_get_child_node(doc, node);
3238 child = qs_get_next_node(doc, child)) {
3240 s_jhtml_start_plaintext_tag_inner(pdoc, child);
3247 * It is a handler who processes the PLAINTEXT tag.
3249 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3250 * destination is specified.
3251 * @param node [i] The PLAINTEXT tag node is specified.
3252 * @return The conversion result is returned.
3255 s_jhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3257 jhtml_t *jhtml = GET_JHTML(pdoc);
3263 * It is a handler who processes the BLINK tag.
3265 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3266 * destination is specified.
3267 * @param node [i] The BLINK tag node is specified.
3268 * @return The conversion result is returned.
3271 s_jhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3273 jhtml_t *jhtml = GET_JHTML(pdoc);
3274 Doc *doc = jhtml->doc;
3281 * It is a handler who processes the BLINK tag.
3283 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3284 * destination is specified.
3285 * @param node [i] The BLINK tag node is specified.
3286 * @return The conversion result is returned.
3289 s_jhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3291 jhtml_t *jhtml = GET_JHTML(pdoc);
3292 Doc *doc = jhtml->doc;
3299 * It is a handler who processes the MARQUEE tag.
3301 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3302 * destination is specified.
3303 * @param node [i] The MARQUEE tag node is specified.
3304 * @return The conversion result is returned.
3307 s_jhtml_start_marquee_tag(void *pdoc, Node *node)
3309 jhtml_t *jhtml = GET_JHTML(pdoc);
3310 Doc *doc = jhtml->doc;
3313 /*--------------------------------------------------------------------------*/
3314 /* Get Attributes */
3315 /*--------------------------------------------------------------------------*/
3316 for (attr = qs_get_attr(doc,node);
3318 attr = qs_get_next_attr(doc,attr)) {
3319 char *name = qs_get_attr_name(doc,attr);
3320 char *value = qs_get_attr_value(doc,attr);
3321 if (STRCASEEQ('d','D',"direction", name)) {
3322 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3323 W_L(" direction=\"");
3328 else if (STRCASEEQ('b','B',"behavior",name)) {
3331 else if (STRCASEEQ('l','L',"loop",name)) {
3341 * It is a handler who processes the MARQUEE tag.
3343 * @param pdoc [i/o] The pointer to the JHTML structure at the output
3344 * destination is specified.
3345 * @param node [i] The MARQUEE tag node is specified.
3346 * @return The conversion result is returned.
3349 s_jhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3351 jhtml_t *jhtml = GET_JHTML(pdoc);
3352 Doc *doc = jhtml->doc;