2 * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_jxhtml.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_header_inf.h"
26 #include "chxj_jreserved_tag.h"
29 #define GET_JXHTML(X) ((jxhtml_t *)(X))
32 #define W_L(X) do { jxhtml->out = BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, (X)); } while(0)
33 #define W_V(X) do { jxhtml->out = (X) ? BUFFERED_WRITE_VALUE(jxhtml->out, &doc->buf, (X)) \
34 : BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, ""); } while(0)
36 #define W_NLCODE() do { char *nlcode = TO_NLCODE(jxhtml->conf); W_V(nlcode); } while (0)
38 static char *s_jxhtml_start_html_tag (void *pdoc, Node *node);
39 static char *s_jxhtml_end_html_tag (void *pdoc, Node *node);
40 static char *s_jxhtml_start_meta_tag (void *pdoc, Node *node);
41 static char *s_jxhtml_end_meta_tag (void *pdoc, Node *node);
42 static char *s_jxhtml_start_head_tag (void *pdoc, Node *node);
43 static char *s_jxhtml_end_head_tag (void *pdoc, Node *node);
44 static char *s_jxhtml_start_title_tag (void *pdoc, Node *node);
45 static char *s_jxhtml_end_title_tag (void *pdoc, Node *node);
46 static char *s_jxhtml_start_base_tag (void *pdoc, Node *node);
47 static char *s_jxhtml_end_base_tag (void *pdoc, Node *node);
48 static char *s_jxhtml_start_body_tag (void *pdoc, Node *node);
49 static char *s_jxhtml_end_body_tag (void *pdoc, Node *node);
50 static char *s_jxhtml_start_a_tag (void *pdoc, Node *node);
51 static char *s_jxhtml_end_a_tag (void *pdoc, Node *node);
52 static char *s_jxhtml_start_pre_tag (void *pdoc, Node *node);
53 static char *s_jxhtml_end_pre_tag (void *pdoc, Node *node);
54 static char *s_jxhtml_start_p_tag (void *pdoc, Node *node);
55 static char *s_jxhtml_end_p_tag (void *pdoc, Node *node);
56 static char *s_jxhtml_start_ul_tag (void *pdoc, Node *node);
57 static char *s_jxhtml_end_ul_tag (void *pdoc, Node *node);
58 static char *s_jxhtml_start_ol_tag (void *pdoc, Node *node);
59 static char *s_jxhtml_end_ol_tag (void *pdoc, Node *node);
60 static char *s_jxhtml_start_li_tag (void *pdoc, Node *node);
61 static char *s_jxhtml_end_li_tag (void *pdoc, Node *node);
62 static char *s_jxhtml_start_br_tag (void *pdoc, Node *node);
63 static char *s_jxhtml_end_br_tag (void *pdoc, Node *node);
64 static char *s_jxhtml_start_tr_tag (void *pdoc, Node *node);
65 static char *s_jxhtml_end_tr_tag (void *pdoc, Node *node);
66 static char *s_jxhtml_start_font_tag (void *pdoc, Node *node);
67 static char *s_jxhtml_end_font_tag (void *pdoc, Node *node);
68 static char *s_jxhtml_start_form_tag (void *pdoc, Node *node);
69 static char *s_jxhtml_end_form_tag (void *pdoc, Node *node);
70 static char *s_jxhtml_start_input_tag (void *pdoc, Node *node);
71 static char *s_jxhtml_end_input_tag (void *pdoc, Node *node);
72 static char *s_jxhtml_start_center_tag (void *pdoc, Node *node);
73 static char *s_jxhtml_end_center_tag (void *pdoc, Node *node);
74 static char *s_jxhtml_start_hr_tag (void *pdoc, Node *node);
75 static char *s_jxhtml_end_hr_tag (void *pdoc, Node *node);
76 static char *s_jxhtml_start_img_tag (void *pdoc, Node *node);
77 static char *s_jxhtml_end_img_tag (void *pdoc, Node *node);
78 static char *s_jxhtml_start_select_tag (void *pdoc, Node *node);
79 static char *s_jxhtml_end_select_tag (void *pdoc, Node *node);
80 static char *s_jxhtml_start_option_tag (void *pdoc, Node *node);
81 static char *s_jxhtml_end_option_tag (void *pdoc, Node *node);
82 static char *s_jxhtml_start_div_tag (void *pdoc, Node *node);
83 static char *s_jxhtml_end_div_tag (void *pdoc, Node *node);
84 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_end_textarea_tag (void *pdoc, Node *node);
86 static char *s_jxhtml_start_b_tag (void *pdoc, Node *node);
87 static char *s_jxhtml_end_b_tag (void *pdoc, Node *node);
88 static char *s_jxhtml_chxjif_tag (void *pdoc, Node *node);
89 static char *s_jxhtml_text_tag (void *pdoc, Node *node);
90 static char *s_jxhtml_start_blockquote_tag(void *pdoc, Node *node);
91 static char *s_jxhtml_end_blockquote_tag (void *pdoc, Node *node);
92 static char *s_jxhtml_start_dir_tag (void *pdoc, Node *node);
93 static char *s_jxhtml_end_dir_tag (void *pdoc, Node *node);
94 static char *s_jxhtml_start_dl_tag (void *pdoc, Node *node);
95 static char *s_jxhtml_end_dl_tag (void *pdoc, Node *node);
96 static char *s_jxhtml_start_dt_tag (void *pdoc, Node *node);
97 static char *s_jxhtml_end_dt_tag (void *pdoc, Node *node);
98 static char *s_jxhtml_start_dd_tag (void *pdoc, Node *node);
99 static char *s_jxhtml_end_dd_tag (void *pdoc, Node *node);
100 static char *s_jxhtml_start_h1_tag (void *pdoc, Node *node);
101 static char *s_jxhtml_end_h1_tag (void *pdoc, Node *node);
102 static char *s_jxhtml_start_h2_tag (void *pdoc, Node *node);
103 static char *s_jxhtml_end_h2_tag (void *pdoc, Node *node);
104 static char *s_jxhtml_start_h3_tag (void *pdoc, Node *node);
105 static char *s_jxhtml_end_h3_tag (void *pdoc, Node *node);
106 static char *s_jxhtml_start_h4_tag (void *pdoc, Node *node);
107 static char *s_jxhtml_end_h4_tag (void *pdoc, Node *node);
108 static char *s_jxhtml_start_h5_tag (void *pdoc, Node *node);
109 static char *s_jxhtml_end_h5_tag (void *pdoc, Node *node);
110 static char *s_jxhtml_start_h6_tag (void *pdoc, Node *node);
111 static char *s_jxhtml_end_h6_tag (void *pdoc, Node *node);
112 static char *s_jxhtml_start_menu_tag (void *pdoc, Node *node);
113 static char *s_jxhtml_end_menu_tag (void *pdoc, Node *node);
114 static char *s_jxhtml_start_plaintext_tag (void *pdoc, Node *node);
115 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_jxhtml_end_plaintext_tag (void *pdoc, Node *node);
117 static char *s_jxhtml_start_blink_tag (void *pdoc, Node *node);
118 static char *s_jxhtml_end_blink_tag (void *pdoc, Node *node);
119 static char *s_jxhtml_start_marquee_tag(void *pdoc, Node *node);
120 static char *s_jxhtml_end_marquee_tag (void *pdoc, Node *node);
121 static char *s_jxhtml_newline_mark (void *pdoc, Node *node);
123 static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
125 static int s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
127 static char *s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s);
131 tag_handler jxhtml_handler[] = {
134 s_jxhtml_start_html_tag,
135 s_jxhtml_end_html_tag,
139 s_jxhtml_start_meta_tag,
140 s_jxhtml_end_meta_tag,
144 s_jxhtml_start_textarea_tag,
145 s_jxhtml_end_textarea_tag,
149 s_jxhtml_start_p_tag,
154 s_jxhtml_start_pre_tag,
155 s_jxhtml_end_pre_tag,
159 s_jxhtml_start_ul_tag,
164 s_jxhtml_start_li_tag,
169 s_jxhtml_start_ol_tag,
174 s_jxhtml_start_h1_tag,
179 s_jxhtml_start_h2_tag,
184 s_jxhtml_start_h3_tag,
189 s_jxhtml_start_h4_tag,
194 s_jxhtml_start_h5_tag,
199 s_jxhtml_start_h6_tag,
204 s_jxhtml_start_head_tag,
205 s_jxhtml_end_head_tag,
209 s_jxhtml_start_title_tag,
210 s_jxhtml_end_title_tag,
214 s_jxhtml_start_base_tag,
215 s_jxhtml_end_base_tag,
219 s_jxhtml_start_body_tag,
220 s_jxhtml_end_body_tag,
224 s_jxhtml_start_a_tag,
229 s_jxhtml_start_br_tag,
239 s_jxhtml_start_tr_tag,
254 s_jxhtml_start_font_tag,
255 s_jxhtml_end_font_tag,
259 s_jxhtml_start_form_tag,
260 s_jxhtml_end_form_tag,
264 s_jxhtml_start_input_tag,
265 s_jxhtml_end_input_tag,
269 s_jxhtml_start_center_tag,
270 s_jxhtml_end_center_tag,
274 s_jxhtml_start_hr_tag,
279 s_jxhtml_start_img_tag,
280 s_jxhtml_end_img_tag,
284 s_jxhtml_start_select_tag,
285 s_jxhtml_end_select_tag,
289 s_jxhtml_start_option_tag,
290 s_jxhtml_end_option_tag,
294 s_jxhtml_start_div_tag,
295 s_jxhtml_end_div_tag,
334 s_jxhtml_start_b_tag,
344 s_jxhtml_start_dt_tag,
359 s_jxhtml_start_blockquote_tag,
360 s_jxhtml_end_blockquote_tag,
364 s_jxhtml_start_dir_tag,
365 s_jxhtml_end_dir_tag,
369 s_jxhtml_start_dl_tag,
374 s_jxhtml_start_dd_tag,
379 s_jxhtml_start_menu_tag,
380 s_jxhtml_end_menu_tag,
384 s_jxhtml_start_plaintext_tag,
385 s_jxhtml_end_plaintext_tag,
389 s_jxhtml_start_blink_tag,
390 s_jxhtml_end_blink_tag,
394 s_jxhtml_start_marquee_tag,
395 s_jxhtml_end_marquee_tag,
399 s_jxhtml_newline_mark,
406 * converts from CHTML5.0 to JXHTML.
408 * @param r [i] Requet_rec is appointed.
409 * @param spec [i] The result of the device specification processing which
410 * was done in advance is appointed.
411 * @param src [i] The character string before the converting is appointed.
412 * @return The character string after the converting is returned.
421 chxjconvrule_entry *entryp,
432 /*--------------------------------------------------------------------------*/
434 /*--------------------------------------------------------------------------*/
436 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
438 DBG(r,"I found qrcode xml");
441 DBG(r,"not found qrcode xml");
443 /*--------------------------------------------------------------------------*/
444 /* The CHTML structure is initialized. */
445 /*--------------------------------------------------------------------------*/
446 s_init_jxhtml(&jxhtml, &doc, r, spec);
448 jxhtml.entryp = entryp;
449 jxhtml.cookie = cookie;
451 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
453 /*--------------------------------------------------------------------------*/
454 /* The character string of the input is analyzed. */
455 /*--------------------------------------------------------------------------*/
456 qs_init_malloc(&doc);
457 qs_init_root_node(&doc);
459 ss = apr_pcalloc(r->pool, srclen + 1);
461 memset(ss, 0, srclen + 1);
462 memcpy(ss, src, srclen);
465 chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
468 qs_parse_string(&doc,ss,strlen(ss));
470 chxj_buffered_write_init(r->pool, &doc.buf);
471 /*--------------------------------------------------------------------------*/
472 /* It converts it from CHTML to JXHTML. */
473 /*--------------------------------------------------------------------------*/
474 chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
475 jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
476 dst = apr_pstrdup(r->pool, jxhtml.out);
477 chxj_buffered_write_terminate(&doc.buf);
480 qs_all_free(&doc,QX_LOGMARK);
483 return apr_pstrdup(r->pool,ss);
486 dst = apr_psprintf(r->pool, "\n");
488 *dstlen = strlen(dst);
491 chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
499 * The CHTML structure is initialized.
501 * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
502 * initialized is specified.
503 * @param doc [i] The Doc structure that should be set to the initialized
504 * JXHTML structure is specified.
505 * @param r [i] To use POOL, the pointer to request_rec is specified.
506 * @param spec [i] The pointer to the device_table
509 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
511 memset(doc, 0, sizeof(Doc));
512 memset(jxhtml, 0, sizeof(jxhtml_t));
517 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
518 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
519 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
524 * Corresponding EMOJI to a current character-code is retrieved.
525 * The substitution character string is stored in the rslt pointer if agreeing.
527 * @param jxhtml [i] The pointer to the CHTML structure is specified.
528 * @param txt [i] The character string to want to examine whether it is
529 * EMOJI is specified.
530 * @param rslt [o] The pointer to the pointer that stores the result is
532 * @return When corresponding EMOJI exists, it returns it excluding 0.
535 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
547 if (! spec) DBG(r,"spec is NULL");
549 for (ee = jxhtml->conf->emoji;
553 unsigned char hex1byte;
554 unsigned char hex2byte;
557 DBG(r,"emoji->imode is NULL");
561 hex1byte = ee->imode->hex1byte & 0xff;
562 hex2byte = ee->imode->hex2byte & 0xff;
564 if (ee->imode->string
565 && strlen(ee->imode->string) > 0
566 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
567 if (spec == NULL || spec->emoji_type == NULL) {
568 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
569 return strlen(ee->imode->string);
576 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
577 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
578 if (spec == NULL || spec->emoji_type == NULL) {
579 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
592 * It is a handler who processes the HTML tag.
594 * @param pdoc [i/o] The pointer to the CHTML structure at the output
595 * destination is specified.
596 * @param node [i] The HTML tag node is specified.
597 * @return The conversion result is returned.
600 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
607 jxhtml = GET_JXHTML(pdoc);
610 DBG(r, "start s_jxhtml_start_html_tag()");
612 W_L("<?xml version='1.0' encoding='Shift_JIS' ?>");
614 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"html-basic10-plus.dtd\">");
617 /*--------------------------------------------------------------------------*/
619 /*--------------------------------------------------------------------------*/
622 DBG(r, "end s_jxhtml_start_html_tag()");
629 * It is a handler who processes the HTML tag.
631 * @param pdoc [i/o] The pointer to the CHTML structure at the output
632 * destination is specified.
633 * @param node [i] The HTML tag node is specified.
634 * @return The conversion result is returned.
637 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
639 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
640 Doc *doc = jxhtml->doc;
649 * It is a handler who processes the META tag.
651 * @param pdoc [i/o] The pointer to the CHTML structure at the output
652 * destination is specified.
653 * @param node [i] The META tag node is specified.
654 * @return The conversion result is returned.
657 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
663 int content_type_flag;
666 jxhtml = GET_JXHTML(pdoc);
670 content_type_flag = 0;
673 /*--------------------------------------------------------------------------*/
675 /*--------------------------------------------------------------------------*/
676 for (attr = qs_get_attr(doc,node);
678 attr = qs_get_next_attr(doc,attr)) {
679 char *name = qs_get_attr_name(doc,attr);
680 char *value = qs_get_attr_value(doc,attr);
684 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
685 /*----------------------------------------------------------------------*/
687 /*----------------------------------------------------------------------*/
688 W_L(" http-equiv=\"");
691 if (STRCASEEQ('c','C',"content-type",value)) {
692 content_type_flag = 1;
694 if (STRCASEEQ('r','R',"refresh",value)) {
702 if (strcasecmp(name, "content") == 0 && value && *value) {
703 /*----------------------------------------------------------------------*/
705 /*----------------------------------------------------------------------*/
706 if (content_type_flag) {
710 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
719 buf = apr_pstrdup(r->pool, value);
721 url = strchr(buf, ';');
723 sec = apr_pstrdup(r->pool, buf);
726 url = chxj_encoding_parameter(r, url);
756 * It is a handler who processes the META tag.
758 * @param pdoc [i/o] The pointer to the CHTML structure at the output
759 * destination is specified.
760 * @param node [i] The META tag node is specified.
761 * @return The conversion result is returned.
764 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
766 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
773 * It is a handler who processes the HEAD tag.
775 * @param pdoc [i/o] The pointer to the CHTML structure at the output
776 * destination is specified.
777 * @param node [i] The HEAD tag node is specified.
778 * @return The conversion result is returned.
781 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
787 jxhtml = GET_JXHTML(pdoc);
797 * It is a handler who processes the HEAD tag.
799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
800 * destination is specified.
801 * @param node [i] The HEAD tag node is specified.
802 * @return The conversion result is returned.
805 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
811 jxhtml = GET_JXHTML(pdoc);
821 * It is a handler who processes the TITLE tag.
823 * @param pdoc [i/o] The pointer to the CHTML structure at the output
824 * destination is specified.
825 * @param node [i] The TITLE tag node is specified.
826 * @return The conversion result is returned.
829 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
835 jxhtml = GET_JXHTML(pdoc);
845 * It is a handler who processes the TITLE tag.
847 * @param pdoc [i/o] The pointer to the CHTML structure at the output
848 * destination is specified.
849 * @param node [i] The TITLE tag node is specified.
850 * @return The conversion result is returned.
853 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
859 jxhtml = GET_JXHTML(pdoc);
869 * It is a handler who processes the BASE tag.
871 * @param pdoc [i/o] The pointer to the CHTML structure at the output
872 * destination is specified.
873 * @param node [i] The BASE tag node is specified.
874 * @return The conversion result is returned.
877 s_jxhtml_start_base_tag(void *pdoc, Node *node)
884 jxhtml = GET_JXHTML(pdoc);
889 /*--------------------------------------------------------------------------*/
891 /*--------------------------------------------------------------------------*/
892 for (attr = qs_get_attr(doc,node);
894 attr = qs_get_next_attr(doc,attr)) {
895 char *name = qs_get_attr_name(doc,attr);
896 char *value = qs_get_attr_value(doc,attr);
897 if (STRCASEEQ('h','H',"href",name)) {
909 * It is a handler who processes the BASE tag.
911 * @param pdoc [i/o] The pointer to the CHTML structure at the output
912 * destination is specified.
913 * @param node [i] The BASE tag node is specified.
914 * @return The conversion result is returned.
917 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
919 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
925 * It is a handler who processes the BODY tag.
927 * @param pdoc [i/o] The pointer to the CHTML structure at the output
928 * destination is specified.
929 * @param node [i] The BODY tag node is specified.
930 * @return The conversion result is returned.
933 s_jxhtml_start_body_tag(void *pdoc, Node *node)
940 jxhtml = GET_JXHTML(pdoc);
945 /*--------------------------------------------------------------------------*/
947 /*--------------------------------------------------------------------------*/
948 for (attr = qs_get_attr(doc,node);
950 attr = qs_get_next_attr(doc,attr)) {
951 char *name = qs_get_attr_name(doc,attr);
952 char *value = qs_get_attr_value(doc,attr);
953 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
954 /*----------------------------------------------------------------------*/
956 /*----------------------------------------------------------------------*/
961 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
962 /*----------------------------------------------------------------------*/
964 /*----------------------------------------------------------------------*/
969 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
970 /*----------------------------------------------------------------------*/
972 /*----------------------------------------------------------------------*/
977 else if (STRCASEEQ('a','A',"alink",name)) {
978 /*----------------------------------------------------------------------*/
980 /*----------------------------------------------------------------------*/
983 else if (STRCASEEQ('v','V',"vlink",name)) {
984 /*----------------------------------------------------------------------*/
986 /*----------------------------------------------------------------------*/
996 * It is a handler who processes the BODY tag.
998 * @param pdoc [i/o] The pointer to the CHTML structure at the output
999 * destination is specified.
1000 * @param node [i] The BODY tag node is specified.
1001 * @return The conversion result is returned.
1004 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1010 jxhtml = GET_JXHTML(pdoc);
1014 W_L("</div></body>");
1020 * It is a handler who processes the A tag.
1022 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1023 * destination is specified.
1024 * @param node [i] The A tag node is specified.
1025 * @return The conversion result is returned.
1028 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1035 jxhtml = GET_JXHTML(pdoc);
1040 /*--------------------------------------------------------------------------*/
1041 /* Get Attributes */
1042 /*--------------------------------------------------------------------------*/
1043 for (attr = qs_get_attr(doc,node);
1045 attr = qs_get_next_attr(doc,attr)) {
1046 char *name = qs_get_attr_name(doc,attr);
1047 char *value = qs_get_attr_value(doc,attr);
1048 if (STRCASEEQ('n','N',"name",name)) {
1049 /*----------------------------------------------------------------------*/
1051 /*----------------------------------------------------------------------*/
1053 W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1056 else if (STRCASEEQ('h','H',"href",name)) {
1057 /*----------------------------------------------------------------------*/
1059 /*----------------------------------------------------------------------*/
1060 value = chxj_encoding_parameter(r, value);
1061 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1062 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
1068 else if (STRCASEEQ('a','A',"accesskey",name)) {
1069 /*----------------------------------------------------------------------*/
1071 /*----------------------------------------------------------------------*/
1072 W_L(" accesskey=\"");
1076 else if (STRCASEEQ('c','C',"cti",name)) {
1077 /*----------------------------------------------------------------------*/
1079 /*----------------------------------------------------------------------*/
1084 else if (STRCASEEQ('i','I',"ijam",name)) {
1085 /*----------------------------------------------------------------------*/
1087 /*----------------------------------------------------------------------*/
1090 else if (STRCASEEQ('u','U',"utn",name)) {
1091 /*----------------------------------------------------------------------*/
1093 /* It is special only for CHTML. */
1094 /*----------------------------------------------------------------------*/
1097 else if (STRCASEEQ('t','T',"telbook",name)) {
1098 /*----------------------------------------------------------------------*/
1100 /*----------------------------------------------------------------------*/
1103 else if (STRCASEEQ('k','K',"kana",name)) {
1104 /*----------------------------------------------------------------------*/
1106 /*----------------------------------------------------------------------*/
1109 else if (STRCASEEQ('e','E',"email",name)) {
1110 /*----------------------------------------------------------------------*/
1112 /*----------------------------------------------------------------------*/
1115 else if (STRCASEEQ('i','I',"ista",name)) {
1116 /*----------------------------------------------------------------------*/
1118 /*----------------------------------------------------------------------*/
1121 else if (STRCASEEQ('i','I',"ilet",name)) {
1122 /*----------------------------------------------------------------------*/
1124 /*----------------------------------------------------------------------*/
1127 else if (STRCASEEQ('i','I',"iswf",name)) {
1128 /*----------------------------------------------------------------------*/
1130 /*----------------------------------------------------------------------*/
1133 else if (STRCASEEQ('i','I',"irst",name)) {
1134 /*----------------------------------------------------------------------*/
1136 /*----------------------------------------------------------------------*/
1146 * It is a handler who processes the A tag.
1148 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1149 * destination is specified.
1150 * @param node [i] The A tag node is specified.
1151 * @return The conversion result is returned.
1154 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1160 jxhtml = GET_JXHTML(pdoc);
1170 * It is a handler who processes the BR tag.
1172 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1173 * destination is specified.
1174 * @param node [i] The BR tag node is specified.
1175 * @return The conversion result is returned.
1178 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1185 jxhtml = GET_JXHTML(pdoc);
1190 /*--------------------------------------------------------------------------*/
1191 /* Get Attributes */
1192 /*--------------------------------------------------------------------------*/
1193 for (attr = qs_get_attr(doc,node);
1195 attr = qs_get_next_attr(doc,attr)) {
1196 char *name = qs_get_attr_name(doc,attr);
1197 char *value = qs_get_attr_value(doc,attr);
1198 if (STRCASEEQ('c','C',"clear",name)) {
1199 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1212 * It is a handler who processes the BR tag.
1214 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1215 * destination is specified.
1216 * @param node [i] The BR tag node is specified.
1217 * @return The conversion result is returned.
1220 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1222 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1228 * It is a handler who processes the TR tag.
1230 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1231 * destination is specified.
1232 * @param node [i] The TR tag node is specified.
1233 * @return The conversion result is returned.
1236 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1242 jxhtml = GET_JXHTML(pdoc);
1252 * It is a handler who processes the TR tag.
1254 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1255 * destination is specified.
1256 * @param node [i] The TR tag node is specified.
1257 * @return The conversion result is returned.
1260 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1262 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1268 * It is a handler who processes the FONT tag.
1270 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1271 * destination is specified.
1272 * @param node [i] The FONT tag node is specified.
1273 * @return The conversion result is returned.
1276 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1285 jxhtml = GET_JXHTML(pdoc);
1289 /*--------------------------------------------------------------------------*/
1290 /* Get Attributes */
1291 /*--------------------------------------------------------------------------*/
1292 for (attr = qs_get_attr(doc,node);
1294 attr = qs_get_next_attr(doc,attr)) {
1295 char *name = qs_get_attr_name(doc,attr);
1296 char *value = qs_get_attr_value(doc,attr);
1297 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1298 color = apr_pstrdup(doc->buf.pool, value);
1300 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1301 /*----------------------------------------------------------------------*/
1303 /*----------------------------------------------------------------------*/
1304 size = apr_pstrdup(doc->buf.pool, value);
1308 W_L("<font color=\"");
1311 jxhtml->font_flag++;
1314 jxhtml->font_size_flag++;
1316 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1317 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1318 case '3': W_L("<span style=\"font-size: small\">"); break;
1319 case '4': W_L("<span style=\"font-size: medium\">"); break;
1320 case '5': W_L("<span style=\"font-size: large\">"); break;
1321 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1322 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1324 if (*(size + 1) == '1') {
1325 W_L("<span style=\"font-size: small\">");
1328 if (*(size + 1) == '2') {
1329 W_L("<span style=\"font-size: x-small\">");
1332 if (*(size + 1) == '3') {
1333 W_L("<span style=\"font-size: xx-small\">");
1336 jxhtml->font_size_flag--;
1340 if (*(size + 1) == '1') {
1341 W_L("<span style=\"font-size: large\">");
1344 if (*(size + 1) == '2') {
1345 W_L("<span style=\"font-size: x-large\">");
1348 if (*(size + 1) == '3') {
1349 W_L("<span style=\"font-size: xx-large\">");
1352 jxhtml->font_size_flag--;
1356 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1357 jxhtml->font_size_flag--;
1365 * It is a handler who processes the FONT tag.
1367 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1368 * destination is specified.
1369 * @param node [i] The FONT tag node is specified.
1370 * @return The conversion result is returned.
1373 s_jxhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1379 jxhtml = GET_JXHTML(pdoc);
1383 if (jxhtml->font_size_flag) {
1385 jxhtml->font_size_flag--;
1387 if (jxhtml->font_flag) {
1389 jxhtml->font_flag--;
1396 * It is a handler who processes the FORM tag.
1398 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1399 * destination is specified.
1400 * @param node [i] The FORM tag node is specified.
1401 * @return The conversion result is returned.
1404 s_jxhtml_start_form_tag(void *pdoc, Node *node)
1410 char *new_hidden_tag = NULL;
1411 char *attr_method = NULL;
1412 char *attr_action = NULL;
1413 char *attr_utn = NULL;
1415 jxhtml = GET_JXHTML(pdoc);
1419 /*--------------------------------------------------------------------------*/
1420 /* Get Attributes */
1421 /*--------------------------------------------------------------------------*/
1422 for (attr = qs_get_attr(doc,node);
1424 attr = qs_get_next_attr(doc,attr)) {
1425 char *name = qs_get_attr_name(doc,attr);
1426 char *value = qs_get_attr_value(doc,attr);
1427 if (STRCASEEQ('a','A',"action", name)) {
1428 /*----------------------------------------------------------------------*/
1430 /*----------------------------------------------------------------------*/
1431 attr_action = chxj_encoding_parameter(r, value);
1432 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1434 else if (STRCASEEQ('m','M',"method", name)) {
1435 /*----------------------------------------------------------------------*/
1437 /*----------------------------------------------------------------------*/
1438 attr_method = apr_pstrdup(doc->pool, value);
1440 else if (STRCASEEQ('u','U',"utn", name)) {
1441 /*----------------------------------------------------------------------*/
1443 /* It is special only for CHTML. */
1444 /*----------------------------------------------------------------------*/
1449 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1454 char *old_qs = NULL;
1455 q = strchr(attr_action, '?');
1457 new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &old_qs, CHXJ_FALSE, CHXJ_TRUE, jxhtml->entryp);
1458 if (new_hidden_tag || old_qs) {
1479 if (new_hidden_tag) {
1480 W_V(new_hidden_tag);
1487 * It is a handler who processes the FORM tag.
1489 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1490 * destination is specified.
1491 * @param node [i] The FORM tag node is specified.
1492 * @return The conversion result is returned.
1495 s_jxhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1497 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1498 Doc *doc = jxhtml->doc;
1505 * It is a handler who processes the INPUT tag.
1507 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1508 * destination is specified.
1509 * @param node [i] The INPUT tag node is specified.
1510 * @return The conversion result is returned.
1513 s_jxhtml_start_input_tag(void *pdoc, Node *node)
1527 jxhtml = GET_JXHTML(pdoc);
1540 /*--------------------------------------------------------------------------*/
1541 /* Get Attributes */
1542 /*--------------------------------------------------------------------------*/
1543 type = qs_get_type_attr(doc, node, doc->buf.pool);
1544 name = qs_get_name_attr(doc, node, doc->buf.pool);
1545 value = qs_get_value_attr(doc,node, doc->buf.pool);
1546 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1547 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1548 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1549 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1550 size = qs_get_size_attr(doc, node, doc->buf.pool);
1553 if (type && (STRCASEEQ('t','T',"text", type) ||
1554 STRCASEEQ('p','P',"password",type) ||
1555 STRCASEEQ('c','C',"checkbox",type) ||
1556 STRCASEEQ('r','R',"radio", type) ||
1557 STRCASEEQ('h','H',"hidden", type) ||
1558 STRCASEEQ('s','S',"submit", type) ||
1559 STRCASEEQ('r','R',"reset", type))) {
1565 if (size && *size) {
1570 if (name && *name) {
1572 W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
1575 if (value && *value) {
1577 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1580 if (accesskey && *accesskey) {
1581 W_L(" accesskey=\"");
1585 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1586 /*------------------------------------------------------------------------*/
1588 /*------------------------------------------------------------------------*/
1589 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
1595 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,istyle);
1601 else if (type && STRCASEEQ('p','P',"password",type)) {
1606 /*--------------------------------------------------------------------------*/
1607 /* The figure is default for the password. */
1608 /*--------------------------------------------------------------------------*/
1609 if (max_length && *max_length) {
1610 if (chxj_chk_numeric(max_length) == 0) {
1611 W_L(" maxlength=\"");
1618 W_L(" checked=\"checked\"");
1626 * It is a handler who processes the INPUT tag.
1628 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1629 * destination is specified.
1630 * @param node [i] The INPUT tag node is specified.
1631 * @return The conversion result is returned.
1634 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1636 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1642 * It is a handler who processes the CENTER tag.
1644 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1645 * destination is specified.
1646 * @param node [i] The CENTER tag node is specified.
1647 * @return The conversion result is returned.
1650 s_jxhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1652 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1653 Doc *doc = jxhtml->doc;
1660 * It is a handler who processes the CENTER tag.
1662 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1663 * destination is specified.
1664 * @param node [i] The CENTER tag node is specified.
1665 * @return The conversion result is returned.
1668 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1674 jxhtml = GET_JXHTML(pdoc);
1684 * It is a handler who processes the li tag.
1686 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1687 * destination is specified.
1688 * @param node [i] The li tag node is specified.
1689 * @return The conversion result is returned.
1692 s_jxhtml_start_li_tag(void *pdoc, Node *node)
1699 jxhtml = GET_JXHTML(pdoc);
1704 /*--------------------------------------------------------------------------*/
1705 /* Get Attributes */
1706 /*--------------------------------------------------------------------------*/
1707 for (attr = qs_get_attr(doc,node);
1709 attr = qs_get_next_attr(doc,attr)) {
1710 char *name = qs_get_attr_name(doc,attr);
1711 char *value = qs_get_attr_value(doc,attr);
1712 if (STRCASEEQ('t','T',"type",name)) {
1713 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1719 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1731 * It is a handler who processes the li tag.
1733 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1734 * destination is specified.
1735 * @param node [i] The li tag node is specified.
1736 * @return The conversion result is returned.
1739 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1745 jxhtml = GET_JXHTML(pdoc);
1755 * It is a handler who processes the OL tag.
1757 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1758 * destination is specified.
1759 * @param node [i] The OL tag node is specified.
1760 * @return The conversion result is returned.
1763 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
1770 jxhtml = GET_JXHTML(pdoc);
1775 /*--------------------------------------------------------------------------*/
1776 /* Get Attributes */
1777 /*--------------------------------------------------------------------------*/
1778 for (attr = qs_get_attr(doc,node);
1780 attr = qs_get_next_attr(doc,attr)) {
1781 char *name = qs_get_attr_name(doc,attr);
1782 char *value = qs_get_attr_value(doc,attr);
1783 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1788 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1800 * It is a handler who processes the OL tag.
1802 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1803 * destination is specified.
1804 * @param node [i] The OL tag node is specified.
1805 * @return The conversion result is returned.
1808 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1814 jxhtml = GET_JXHTML(pdoc);
1824 * It is a handler who processes the P tag.
1826 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1827 * destination is specified.
1828 * @param node [i] The P tag node is specified.
1829 * @return The conversion result is returned.
1832 s_jxhtml_start_p_tag(void *pdoc, Node *node)
1840 jxhtml = GET_JXHTML(pdoc);
1845 for (attr = qs_get_attr(doc,node);
1847 attr = qs_get_next_attr(doc,attr)) {
1848 char *nm = qs_get_attr_name(doc,attr);
1849 char *val = qs_get_attr_value(doc,attr);
1850 if (STRCASEEQ('a','A',"align", nm)) {
1851 /*----------------------------------------------------------------------*/
1852 /* CHTML 1.0 (W3C version 3.2) */
1853 /*----------------------------------------------------------------------*/
1854 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1855 align = apr_pstrdup(doc->buf.pool, val);
1871 * It is a handler who processes the P tag.
1873 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1874 * destination is specified.
1875 * @param node [i] The P tag node is specified.
1876 * @return The conversion result is returned.
1879 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1881 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1882 Doc *doc = jxhtml->doc;
1890 * It is a handler who processes the PRE tag.
1892 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1893 * destination is specified.
1894 * @param node [i] The PRE tag node is specified.
1895 * @return The conversion result is returned.
1898 s_jxhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1900 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1901 Doc *doc = jxhtml->doc;
1910 * It is a handler who processes the PRE tag.
1912 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1913 * destination is specified.
1914 * @param node [i] The PRE tag node is specified.
1915 * @return The conversion result is returned.
1918 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1920 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1921 Doc *doc = jxhtml->doc;
1931 * It is a handler who processes the UL tag.
1933 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1934 * destination is specified.
1935 * @param node [i] The UL tag node is specified.
1936 * @return The conversion result is returned.
1939 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
1941 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1942 Doc *doc = jxhtml->doc;
1945 /*--------------------------------------------------------------------------*/
1946 /* Get Attributes */
1947 /*--------------------------------------------------------------------------*/
1948 for (attr = qs_get_attr(doc,node);
1950 attr = qs_get_next_attr(doc,attr)) {
1951 char *name = qs_get_attr_name(doc,attr);
1952 char *value = qs_get_attr_value(doc,attr);
1953 if (STRCASEEQ('t','T',"type",name)) {
1954 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1967 * It is a handler who processes the UL tag.
1969 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1970 * destination is specified.
1971 * @param node [i] The UL tag node is specified.
1972 * @return The conversion result is returned.
1975 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
1977 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1978 Doc *doc = jxhtml->doc;
1986 * It is a handler who processes the HR tag.
1988 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1989 * destination is specified.
1990 * @param node [i] The HR tag node is specified.
1991 * @return The conversion result is returned.
1994 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
1996 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1997 Doc *doc = jxhtml->doc;
2001 for (attr = qs_get_attr(doc,node);
2003 attr = qs_get_next_attr(doc,attr)) {
2004 char *name = qs_get_attr_name(doc,attr);
2005 char *value = qs_get_attr_value(doc,attr);
2006 if (STRCASEEQ('a','A',"align",name)) {
2007 /*----------------------------------------------------------------------*/
2009 /*----------------------------------------------------------------------*/
2010 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2016 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2017 /*----------------------------------------------------------------------*/
2019 /*----------------------------------------------------------------------*/
2024 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2025 /*----------------------------------------------------------------------*/
2027 /*----------------------------------------------------------------------*/
2032 else if (STRCASEEQ('n','N',"noshade",name)) {
2033 /*----------------------------------------------------------------------*/
2035 /*----------------------------------------------------------------------*/
2038 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2039 /*----------------------------------------------------------------------*/
2041 /*----------------------------------------------------------------------*/
2053 * It is a handler who processes the HR tag.
2055 * @param jxhtml [i/o] The pointer to the CHTML structure at the output
2056 * destination is specified.
2057 * @param node [i] The HR tag node is specified.
2058 * @return The conversion result is returned.
2061 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2063 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2069 * It is a handler who processes the IMG tag.
2071 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2072 * destination is specified.
2073 * @param node [i] The IMG tag node is specified.
2074 * @return The conversion result is returned.
2077 s_jxhtml_start_img_tag(void *pdoc, Node *node)
2079 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2080 Doc *doc = jxhtml->doc;
2081 request_rec *r = doc->r;
2083 #ifndef IMG_NOT_CONVERT_FILENAME
2084 device_table *spec = jxhtml->spec;
2089 /*--------------------------------------------------------------------------*/
2090 /* Get Attributes */
2091 /*--------------------------------------------------------------------------*/
2092 for (attr = qs_get_attr(doc,node);
2094 attr = qs_get_next_attr(doc,attr)) {
2095 char *name = qs_get_attr_name(doc,attr);
2096 char *value = qs_get_attr_value(doc,attr);
2097 if (STRCASEEQ('s','S',"src",name)) {
2098 /*----------------------------------------------------------------------*/
2100 /*----------------------------------------------------------------------*/
2101 #ifdef IMG_NOT_CONVERT_FILENAME
2102 value = chxj_encoding_parameter(r, value);
2103 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2104 value = chxj_add_cookie_no_update_parameter(r, value);
2109 value = chxj_img_conv(r, spec, value);
2110 value = chxj_encoding_parameter(r, value);
2111 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2112 value = chxj_add_cookie_no_update_parameter(r, value);
2118 else if (STRCASEEQ('a','A',"align",name)) {
2119 /*----------------------------------------------------------------------*/
2121 /*----------------------------------------------------------------------*/
2123 if (STRCASEEQ('t','T',"top", value) ||
2124 STRCASEEQ('m','M',"middle",value) ||
2125 STRCASEEQ('b','B',"bottom",value) ||
2126 STRCASEEQ('l','L',"left", value) ||
2127 STRCASEEQ('r','R',"right", value)) {
2132 else if (STRCASEEQ('c','C',"center",value)) {
2139 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2140 /*----------------------------------------------------------------------*/
2142 /*----------------------------------------------------------------------*/
2147 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2148 /*----------------------------------------------------------------------*/
2150 /*----------------------------------------------------------------------*/
2155 else if (STRCASEEQ('h','H',"hspace",name)) {
2156 /*----------------------------------------------------------------------*/
2158 /*----------------------------------------------------------------------*/
2161 else if (STRCASEEQ('v','V',"vspace",name)) {
2162 /*----------------------------------------------------------------------*/
2164 /*----------------------------------------------------------------------*/
2167 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2168 /*----------------------------------------------------------------------*/
2170 /*----------------------------------------------------------------------*/
2186 * It is a handler who processes the IMG tag.
2188 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2189 * destination is specified.
2190 * @param node [i] The IMG tag node is specified.
2191 * @return The conversion result is returned.
2194 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2196 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2202 * It is a handler who processes the SELECT tag.
2204 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2205 * destination is specified.
2206 * @param node [i] The SELECT tag node is specified.
2207 * @return The conversion result is returned.
2210 s_jxhtml_start_select_tag(void *pdoc, Node *child)
2212 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2213 Doc *doc = jxhtml->doc;
2217 char *multiple = NULL;
2220 for (attr = qs_get_attr(doc,child);
2222 attr = qs_get_next_attr(doc,attr)) {
2223 char *nm = qs_get_attr_name(doc,attr);
2224 char *val = qs_get_attr_value(doc,attr);
2225 if (STRCASEEQ('s','S',"size",nm)) {
2226 /*----------------------------------------------------------------------*/
2227 /* CHTML 1.0 version 2.0 */
2228 /*----------------------------------------------------------------------*/
2229 size = apr_pstrdup(doc->buf.pool, val);
2231 else if (STRCASEEQ('n','N',"name",nm)) {
2232 /*----------------------------------------------------------------------*/
2233 /* CHTML 1.0 version 2.0 */
2234 /*----------------------------------------------------------------------*/
2235 name = apr_pstrdup(doc->buf.pool, val);
2237 else if (STRCASEEQ('m','M',"multiple", nm)) {
2238 /*----------------------------------------------------------------------*/
2239 /* CHTML 1.0 version 2.0 */
2240 /*----------------------------------------------------------------------*/
2241 multiple = apr_pstrdup(doc->buf.pool, val);
2244 if (size && *size) {
2249 if (name && *name) {
2263 * It is a handler who processes the SELECT tag.
2265 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2266 * destination is specified.
2267 * @param node [i] The SELECT tag node is specified.
2268 * @return The conversion result is returned.
2271 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2273 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2274 Doc *doc = jxhtml->doc;
2281 * It is a handler who processes the OPTION tag.
2283 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2284 * destination is specified.
2285 * @param node [i] The OPTION tag node is specified.
2286 * @return The conversion result is returned.
2289 s_jxhtml_start_option_tag(void *pdoc, Node *child)
2291 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2292 Doc *doc = jxhtml->doc;
2295 char *selected = NULL;
2299 for (attr = qs_get_attr(doc,child);
2301 attr = qs_get_next_attr(doc,attr)) {
2302 char *nm = qs_get_attr_name(doc,attr);
2303 char *val = qs_get_attr_value(doc,attr);
2304 if (STRCASEEQ('s','S',"selected",nm)) {
2305 /*----------------------------------------------------------------------*/
2306 /* CHTML 1.0 version 2.0 */
2307 /*----------------------------------------------------------------------*/
2308 selected = apr_pstrdup(doc->buf.pool, val);
2310 else if (STRCASEEQ('v','V',"value",nm)) {
2311 /*----------------------------------------------------------------------*/
2312 /* CHTML 1.0 version 2.0 */
2313 /*----------------------------------------------------------------------*/
2314 value = apr_pstrdup(doc->buf.pool, val);
2331 * It is a handler who processes the OPTION tag.
2333 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2334 * destination is specified.
2335 * @param node [i] The OPTION tag node is specified.
2336 * @return The conversion result is returned.
2339 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2341 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2342 Doc *doc = jxhtml->doc;
2349 * It is a handler who processes the DIV tag.
2351 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2352 * destination is specified.
2353 * @param node [i] The DIV tag node is specified.
2354 * @return The conversion result is returned.
2357 s_jxhtml_start_div_tag(void *pdoc, Node *child)
2365 jxhtml = GET_JXHTML(pdoc);
2370 for (attr = qs_get_attr(doc,child);
2372 attr = qs_get_next_attr(doc,attr)) {
2373 char *nm = qs_get_attr_name(doc,attr);
2374 char *val = qs_get_attr_value(doc,attr);
2375 if (STRCASEEQ('a','A',"align",nm)) {
2376 /*----------------------------------------------------------------------*/
2377 /* CHTML 1.0 (W3C version 3.2) */
2378 /*----------------------------------------------------------------------*/
2379 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2380 align = apr_pstrdup(doc->buf.pool, val);
2395 * It is a handler who processes the DIV tag.
2397 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2398 * destination is specified.
2399 * @param node [i] The DIV tag node is specified.
2400 * @return The conversion result is returned.
2403 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2409 jxhtml = GET_JXHTML(pdoc);
2419 s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s)
2425 case '1': return apr_psprintf(p, "hiragana");
2426 case '2': return apr_psprintf(p, "hankakukana");
2427 case '3': return apr_psprintf(p, "alphabet");
2428 case '4': return apr_psprintf(p, "numeric");
2430 tmp = apr_palloc(p, 1);
2432 return apr_pstrdup(p, tmp);
2436 tmp = apr_palloc(p, 1);
2438 return apr_pstrdup(p,tmp);
2443 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
2450 jxhtml = GET_JXHTML(pdoc);
2454 for (child = qs_get_child_node(doc, node);
2456 child = qs_get_next_node(doc, child)) {
2458 s_jxhtml_chxjif_tag(jxhtml, child);
2465 * It is a handler who processes the TEXTARE tag.
2467 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2468 * destination is specified.
2469 * @param node [i] The TEXTAREA tag node is specified.
2470 * @return The conversion result is returned.
2473 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
2480 jxhtml = GET_JXHTML(pdoc);
2484 jxhtml->textarea_flag++;
2486 for (attr = qs_get_attr(doc,node);
2488 attr = qs_get_next_attr(doc,attr)) {
2489 char *name = qs_get_attr_name(doc,attr);
2490 char *value = qs_get_attr_value(doc,attr);
2491 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2492 W_L(" accesskey=\"");
2496 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2497 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,value);
2502 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2507 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2512 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2524 * It is a handler who processes the TEXTAREA tag.
2526 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2527 * destination is specified.
2528 * @param node [i] The TEXTAREA tag node is specified.
2529 * @return The conversion result is returned.
2532 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2538 jxhtml = GET_JXHTML(pdoc);
2543 jxhtml->textarea_flag--;
2550 * It is a handler who processes the B tag.
2552 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2553 * destination is specified.
2554 * @param node [i] The B tag node is specified.
2555 * @return The conversion result is returned.
2558 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2564 jxhtml = GET_JXHTML(pdoc);
2574 * It is a handler who processes the B tag.
2576 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2577 * destination is specified.
2578 * @param node [i] The B tag node is specified.
2579 * @return The conversion result is returned.
2582 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2584 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
2585 Doc* doc = jxhtml->doc;
2592 s_jxhtml_text_tag(void* pdoc, Node* child)
2604 jxhtml = GET_JXHTML(pdoc);
2608 textval = qs_get_node_value(doc,child);
2609 if (strlen(textval) == 0) {
2613 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2614 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2616 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2617 memset(one_byte, 0, sizeof(one_byte));
2620 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2622 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
2624 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2629 if (is_sjis_kanji(textval[ii])) {
2630 one_byte[0] = textval[ii+0];
2631 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2632 one_byte[0] = textval[ii+1];
2633 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2637 if (jxhtml->pre_flag) {
2638 one_byte[0] = textval[ii+0];
2639 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2642 if (jxhtml->textarea_flag) {
2643 one_byte[0] = textval[ii+0];
2644 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2647 if (textval[ii] != '\r' && textval[ii] != '\n') {
2648 one_byte[0] = textval[ii+0];
2649 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2659 * It is a handler who processes the BLOCKQUOTE tag.
2661 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2662 * destination is specified.
2663 * @param node [i] The BLOCKQUOTE tag node is specified.
2664 * @return The conversion result is returned.
2667 s_jxhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2669 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2670 Doc *doc = jxhtml->doc;
2671 W_L("<blockquote>");
2677 * It is a handler who processes the BLOCKQUOTE tag.
2679 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2680 * destination is specified.
2681 * @param node [i] The BLOCKQUOTE tag node is specified.
2682 * @return The conversion result is returned.
2685 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2687 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2688 Doc *doc = jxhtml->doc;
2689 W_L("</blockquote>");
2695 * It is a handler who processes the DIR tag.
2697 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2698 * destination is specified.
2699 * @param node [i] The DIR tag node is specified.
2700 * @return The conversion result is returned.
2703 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
2705 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2706 Doc *doc = jxhtml->doc;
2709 for (attr = qs_get_attr(doc,node);
2711 attr = qs_get_next_attr(doc,attr)) {
2712 char *name = qs_get_attr_name(doc,attr);
2713 char *value = qs_get_attr_value(doc,attr);
2714 if (STRCASEEQ('t','T',"type",name)) {
2715 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2728 * It is a handler who processes the DIR tag.
2730 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2731 * destination is specified.
2732 * @param node [i] The DIR tag node is specified.
2733 * @return The conversion result is returned.
2736 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2738 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2739 Doc *doc = jxhtml->doc;
2746 * It is a handler who processes the DL tag.
2748 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2749 * destination is specified.
2750 * @param node [i] The DL tag node is specified.
2751 * @return The conversion result is returned.
2754 s_jxhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2756 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2757 Doc *doc = jxhtml->doc;
2764 * It is a handler who processes the DL tag.
2766 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2767 * destination is specified.
2768 * @param node [i] The DL tag node is specified.
2769 * @return The conversion result is returned.
2772 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2774 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2775 Doc *doc = jxhtml->doc;
2782 * It is a handler who processes the DT tag.
2784 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2785 * destination is specified.
2786 * @param node [i] The DT tag node is specified.
2787 * @return The conversion result is returned.
2790 s_jxhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2792 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2793 Doc *doc = jxhtml->doc;
2800 * It is a handler who processes the DT tag.
2802 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2803 * destination is specified.
2804 * @param node [i] The DT tag node is specified.
2805 * @return The conversion result is returned.
2808 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2810 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2816 * It is a handler who processes the DD tag.
2818 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2819 * destination is specified.
2820 * @param node [i] The DD tag node is specified.
2821 * @return The conversion result is returned.
2824 s_jxhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2826 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2827 Doc *doc = jxhtml->doc;
2834 * It is a handler who processes the DD tag.
2836 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2837 * destination is specified.
2838 * @param node [i] The DD tag node is specified.
2839 * @return The conversion result is returned.
2842 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2844 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2850 * It is a handler who processes the H1 tag.
2852 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2853 * destination is specified.
2854 * @param node [i] The H1 tag node is specified.
2855 * @return The conversion result is returned.
2858 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
2866 jxhtml = GET_JXHTML(pdoc);
2870 for (attr = qs_get_attr(doc,node);
2872 attr = qs_get_next_attr(doc,attr)) {
2873 char *name = qs_get_attr_name(doc,attr);
2874 char *value = qs_get_attr_value(doc,attr);
2875 if (STRCASEEQ('a','A',"align", name)) {
2876 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2877 jxhtml->h1_align_flag++;
2878 align = apr_pstrdup(doc->buf.pool, value);
2884 W_L("<div align=\"");
2893 * It is a handler who processes the H1 tag.
2895 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2896 * destination is specified.
2897 * @param node [i] The H1 tag node is specified.
2898 * @return The conversion result is returned.
2901 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2907 jxhtml = GET_JXHTML(pdoc);
2911 if (jxhtml->h1_align_flag) {
2912 jxhtml->h1_align_flag--;
2920 * It is a handler who processes the H2 tag.
2922 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2923 * destination is specified.
2924 * @param node [i] The H1 tag node is specified.
2925 * @return The conversion result is returned.
2928 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
2936 jxhtml = GET_JXHTML(pdoc);
2940 for (attr = qs_get_attr(doc,node);
2942 attr = qs_get_next_attr(doc,attr)) {
2943 char *name = qs_get_attr_name(doc,attr);
2944 char *value = qs_get_attr_value(doc,attr);
2945 if (STRCASEEQ('a','A',"align", name)) {
2946 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2947 jxhtml->h2_align_flag++;
2948 align = apr_pstrdup(doc->buf.pool, value);
2954 W_L("<div align=\"");
2963 * It is a handler who processes the H2 tag.
2965 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2966 * destination is specified.
2967 * @param node [i] The H1 tag node is specified.
2968 * @return The conversion result is returned.
2971 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
2977 jxhtml = GET_JXHTML(pdoc);
2981 if (jxhtml->h2_align_flag) {
2982 jxhtml->h2_align_flag--;
2990 * It is a handler who processes the H3 tag.
2992 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2993 * destination is specified.
2994 * @param node [i] The H1 tag node is specified.
2995 * @return The conversion result is returned.
2998 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
3006 jxhtml = GET_JXHTML(pdoc);
3010 for (attr = qs_get_attr(doc,node);
3012 attr = qs_get_next_attr(doc,attr)) {
3015 name = qs_get_attr_name(doc,attr);
3016 value = qs_get_attr_value(doc,attr);
3017 if (STRCASEEQ('a','A',"align", name)) {
3018 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3019 jxhtml->h3_align_flag++;
3020 align = apr_pstrdup(doc->buf.pool, value);
3026 W_L("<div align=\"");
3035 * It is a handler who processes the H3 tag.
3037 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3038 * destination is specified.
3039 * @param node [i] The H1 tag node is specified.
3040 * @return The conversion result is returned.
3043 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
3049 jxhtml = GET_JXHTML(pdoc);
3053 if (jxhtml->h3_align_flag) {
3054 jxhtml->h3_align_flag--;
3062 * It is a handler who processes the H4 tag.
3064 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3065 * destination is specified.
3066 * @param node [i] The H1 tag node is specified.
3067 * @return The conversion result is returned.
3070 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
3078 jxhtml = GET_JXHTML(pdoc);
3082 for (attr = qs_get_attr(doc,node);
3084 attr = qs_get_next_attr(doc,attr)) {
3085 char *name = qs_get_attr_name(doc,attr);
3086 char *value = qs_get_attr_value(doc,attr);
3087 if (STRCASEEQ('a','A',"align", name)) {
3088 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3089 jxhtml->h4_align_flag++;
3090 align = apr_pstrdup(doc->buf.pool, value);
3096 W_L("<div align=\"");
3105 * It is a handler who processes the H4 tag.
3107 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3108 * destination is specified.
3109 * @param node [i] The H1 tag node is specified.
3110 * @return The conversion result is returned.
3113 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3119 jxhtml = GET_JXHTML(pdoc);
3123 if (jxhtml->h4_align_flag) {
3124 jxhtml->h4_align_flag--;
3132 * It is a handler who processes the H5 tag.
3134 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3135 * destination is specified.
3136 * @param node [i] The H1 tag node is specified.
3137 * @return The conversion result is returned.
3140 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
3148 jxhtml = GET_JXHTML(pdoc);
3152 for (attr = qs_get_attr(doc,node);
3154 attr = qs_get_next_attr(doc,attr)) {
3155 char *name = qs_get_attr_name(doc,attr);
3156 char *value = qs_get_attr_value(doc,attr);
3157 if (STRCASEEQ('a','A',"align", name)) {
3158 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3159 jxhtml->h5_align_flag++;
3160 align = apr_pstrdup(doc->buf.pool, value);
3166 W_L("<div align=\"");
3175 * It is a handler who processes the H5 tag.
3177 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3178 * destination is specified.
3179 * @param node [i] The H1 tag node is specified.
3180 * @return The conversion result is returned.
3183 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3189 jxhtml = GET_JXHTML(pdoc);
3193 if (jxhtml->h5_align_flag) {
3194 jxhtml->h5_align_flag--;
3202 * It is a handler who processes the H6 tag.
3204 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3205 * destination is specified.
3206 * @param node [i] The H1 tag node is specified.
3207 * @return The conversion result is returned.
3210 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
3218 jxhtml = GET_JXHTML(pdoc);
3222 for (attr = qs_get_attr(doc,node);
3224 attr = qs_get_next_attr(doc,attr)) {
3225 char *name = qs_get_attr_name(doc,attr);
3226 char *value = qs_get_attr_value(doc,attr);
3227 if (STRCASEEQ('a','A',"align", name)) {
3228 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3229 jxhtml->h6_align_flag++;
3230 align = apr_pstrdup(doc->buf.pool, value);
3236 W_L("<div align=\"");
3245 * It is a handler who processes the H6 tag.
3247 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3248 * destination is specified.
3249 * @param node [i] The H1 tag node is specified.
3250 * @return The conversion result is returned.
3253 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3259 jxhtml = GET_JXHTML(pdoc);
3263 if (jxhtml->h6_align_flag) {
3264 jxhtml->h6_align_flag--;
3272 * It is a handler who processes the MENU tag.
3274 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3275 * destination is specified.
3276 * @param node [i] The MENU tag node is specified.
3277 * @return The conversion result is returned.
3280 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
3282 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3283 Doc *doc = jxhtml->doc;
3286 /*--------------------------------------------------------------------------*/
3287 /* Get Attributes */
3288 /*--------------------------------------------------------------------------*/
3289 for (attr = qs_get_attr(doc,node);
3291 attr = qs_get_next_attr(doc,attr)) {
3292 char *name = qs_get_attr_name(doc,attr);
3293 char *value = qs_get_attr_value(doc,attr);
3294 if (STRCASEEQ('t','T',"type",name)) {
3295 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3308 * It is a handler who processes the MENU tag.
3310 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3311 * destination is specified.
3312 * @param node [i] The MENU tag node is specified.
3313 * @return The conversion result is returned.
3316 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3318 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3319 Doc *doc = jxhtml->doc;
3326 * It is a handler who processes the PLAINTEXT tag.
3328 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3329 * destination is specified.
3330 * @param node [i] The PLAINTEXT tag node is specified.
3331 * @return The conversion result is returned.
3334 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
3339 jxhtml = GET_JXHTML(pdoc);
3342 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
3347 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3352 jxhtml = GET_JXHTML(pdoc);
3354 for (child = qs_get_child_node(doc, node);
3356 child = qs_get_next_node(doc, child)) {
3358 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
3365 * It is a handler who processes the PLAINTEXT tag.
3367 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3368 * destination is specified.
3369 * @param node [i] The PLAINTEXT tag node is specified.
3370 * @return The conversion result is returned.
3373 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3375 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3381 * It is a handler who processes the BLINK tag.
3383 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3384 * destination is specified.
3385 * @param node [i] The BLINK tag node is specified.
3386 * @return The conversion result is returned.
3389 s_jxhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3391 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3392 Doc *doc = jxhtml->doc;
3399 * It is a handler who processes the BLINK tag.
3401 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3402 * destination is specified.
3403 * @param node [i] The BLINK tag node is specified.
3404 * @return The conversion result is returned.
3407 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3409 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3410 Doc *doc = jxhtml->doc;
3417 * It is a handler who processes the MARQUEE tag.
3419 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3420 * destination is specified.
3421 * @param node [i] The MARQUEE tag node is specified.
3422 * @return The conversion result is returned.
3425 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
3427 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3428 Doc *doc = jxhtml->doc;
3431 /*--------------------------------------------------------------------------*/
3432 /* Get Attributes */
3433 /*--------------------------------------------------------------------------*/
3434 for (attr = qs_get_attr(doc,node);
3436 attr = qs_get_next_attr(doc,attr)) {
3437 char *name = qs_get_attr_name(doc,attr);
3438 char *value = qs_get_attr_value(doc,attr);
3439 if (STRCASEEQ('d','D',"direction", name)) {
3440 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3441 W_L(" direction=\"");
3446 else if (STRCASEEQ('b','B',"behavior",name)) {
3449 else if (STRCASEEQ('l','L',"loop",name)) {
3452 else if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
3464 * It is a handler who processes the MARQUEE tag.
3466 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3467 * destination is specified.
3468 * @param node [i] The MARQUEE tag node is specified.
3469 * @return The conversion result is returned.
3472 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3474 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3475 Doc *doc = jxhtml->doc;
3482 * It is handler who processes the New Line Code.
3485 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3487 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3488 Doc *doc = jxhtml->doc;