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 chxj_jxhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
606 DBG(r, "REQ[%X] start chxj_jxhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
607 memset(doc, 0, sizeof(Doc));
608 memset(jxhtml, 0, sizeof(jxhtml_t));
613 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
614 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
615 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
617 apr_pool_create(&pool, r->pool);
619 chxj_buffered_write_init(pool, &doc->buf);
621 for (ii=0; ii<len; ii++) {
625 rtn = s_jxhtml_search_emoji(jxhtml, (char *)&src[ii], &out);
632 if (is_sjis_kanji(src[ii])) {
633 two_byte[0] = src[ii+0];
634 two_byte[1] = src[ii+1];
640 one_byte[0] = src[ii+0];
645 jxhtml->out = chxj_buffered_write_flush(jxhtml->out, &doc->buf);
647 DBG(r, "REQ[%X] end chxj_jxhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
653 * It is a handler who processes the HTML tag.
655 * @param pdoc [i/o] The pointer to the CHTML structure at the output
656 * destination is specified.
657 * @param node [i] The HTML tag node is specified.
658 * @return The conversion result is returned.
661 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
668 jxhtml = GET_JXHTML(pdoc);
671 DBG(r, "start s_jxhtml_start_html_tag()");
673 W_L("<?xml version='1.0' encoding='Shift_JIS' ?>");
675 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"html-basic10-plus.dtd\">");
678 /*--------------------------------------------------------------------------*/
680 /*--------------------------------------------------------------------------*/
683 DBG(r, "end s_jxhtml_start_html_tag()");
690 * It is a handler who processes the HTML tag.
692 * @param pdoc [i/o] The pointer to the CHTML structure at the output
693 * destination is specified.
694 * @param node [i] The HTML tag node is specified.
695 * @return The conversion result is returned.
698 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
700 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
701 Doc *doc = jxhtml->doc;
710 * It is a handler who processes the META tag.
712 * @param pdoc [i/o] The pointer to the CHTML structure at the output
713 * destination is specified.
714 * @param node [i] The META tag node is specified.
715 * @return The conversion result is returned.
718 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
724 int content_type_flag;
727 jxhtml = GET_JXHTML(pdoc);
731 content_type_flag = 0;
734 /*--------------------------------------------------------------------------*/
736 /*--------------------------------------------------------------------------*/
737 for (attr = qs_get_attr(doc,node);
739 attr = qs_get_next_attr(doc,attr)) {
740 char *name = qs_get_attr_name(doc,attr);
741 char *value = qs_get_attr_value(doc,attr);
745 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
746 /*----------------------------------------------------------------------*/
748 /*----------------------------------------------------------------------*/
749 W_L(" http-equiv=\"");
752 if (STRCASEEQ('c','C',"content-type",value)) {
753 content_type_flag = 1;
755 if (STRCASEEQ('r','R',"refresh",value)) {
763 if (strcasecmp(name, "content") == 0 && value && *value) {
764 /*----------------------------------------------------------------------*/
766 /*----------------------------------------------------------------------*/
767 if (content_type_flag) {
771 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
780 buf = apr_pstrdup(r->pool, value);
782 url = strchr(buf, ';');
784 sec = apr_pstrdup(r->pool, buf);
787 url = chxj_encoding_parameter(r, url);
817 * It is a handler who processes the META tag.
819 * @param pdoc [i/o] The pointer to the CHTML structure at the output
820 * destination is specified.
821 * @param node [i] The META tag node is specified.
822 * @return The conversion result is returned.
825 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
827 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
834 * It is a handler who processes the HEAD tag.
836 * @param pdoc [i/o] The pointer to the CHTML structure at the output
837 * destination is specified.
838 * @param node [i] The HEAD tag node is specified.
839 * @return The conversion result is returned.
842 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
848 jxhtml = GET_JXHTML(pdoc);
858 * It is a handler who processes the HEAD tag.
860 * @param pdoc [i/o] The pointer to the CHTML structure at the output
861 * destination is specified.
862 * @param node [i] The HEAD tag node is specified.
863 * @return The conversion result is returned.
866 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
872 jxhtml = GET_JXHTML(pdoc);
882 * It is a handler who processes the TITLE tag.
884 * @param pdoc [i/o] The pointer to the CHTML structure at the output
885 * destination is specified.
886 * @param node [i] The TITLE tag node is specified.
887 * @return The conversion result is returned.
890 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
896 jxhtml = GET_JXHTML(pdoc);
906 * It is a handler who processes the TITLE tag.
908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
909 * destination is specified.
910 * @param node [i] The TITLE tag node is specified.
911 * @return The conversion result is returned.
914 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
920 jxhtml = GET_JXHTML(pdoc);
930 * It is a handler who processes the BASE tag.
932 * @param pdoc [i/o] The pointer to the CHTML structure at the output
933 * destination is specified.
934 * @param node [i] The BASE tag node is specified.
935 * @return The conversion result is returned.
938 s_jxhtml_start_base_tag(void *pdoc, Node *node)
945 jxhtml = GET_JXHTML(pdoc);
950 /*--------------------------------------------------------------------------*/
952 /*--------------------------------------------------------------------------*/
953 for (attr = qs_get_attr(doc,node);
955 attr = qs_get_next_attr(doc,attr)) {
956 char *name = qs_get_attr_name(doc,attr);
957 char *value = qs_get_attr_value(doc,attr);
958 if (STRCASEEQ('h','H',"href",name)) {
970 * It is a handler who processes the BASE tag.
972 * @param pdoc [i/o] The pointer to the CHTML structure at the output
973 * destination is specified.
974 * @param node [i] The BASE tag node is specified.
975 * @return The conversion result is returned.
978 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
980 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
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_jxhtml_start_body_tag(void *pdoc, Node *node)
1001 jxhtml = GET_JXHTML(pdoc);
1006 /*--------------------------------------------------------------------------*/
1007 /* Get Attributes */
1008 /*--------------------------------------------------------------------------*/
1009 for (attr = qs_get_attr(doc,node);
1011 attr = qs_get_next_attr(doc,attr)) {
1012 char *name = qs_get_attr_name(doc,attr);
1013 char *value = qs_get_attr_value(doc,attr);
1014 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1015 /*----------------------------------------------------------------------*/
1017 /*----------------------------------------------------------------------*/
1022 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1023 /*----------------------------------------------------------------------*/
1025 /*----------------------------------------------------------------------*/
1030 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1031 /*----------------------------------------------------------------------*/
1033 /*----------------------------------------------------------------------*/
1038 else if (STRCASEEQ('a','A',"alink",name)) {
1039 /*----------------------------------------------------------------------*/
1041 /*----------------------------------------------------------------------*/
1044 else if (STRCASEEQ('v','V',"vlink",name)) {
1045 /*----------------------------------------------------------------------*/
1047 /*----------------------------------------------------------------------*/
1057 * It is a handler who processes the BODY tag.
1059 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1060 * destination is specified.
1061 * @param node [i] The BODY tag node is specified.
1062 * @return The conversion result is returned.
1065 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1071 jxhtml = GET_JXHTML(pdoc);
1075 W_L("</div></body>");
1081 * It is a handler who processes the A tag.
1083 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1084 * destination is specified.
1085 * @param node [i] The A tag node is specified.
1086 * @return The conversion result is returned.
1089 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1096 jxhtml = GET_JXHTML(pdoc);
1101 /*--------------------------------------------------------------------------*/
1102 /* Get Attributes */
1103 /*--------------------------------------------------------------------------*/
1104 for (attr = qs_get_attr(doc,node);
1106 attr = qs_get_next_attr(doc,attr)) {
1107 char *name = qs_get_attr_name(doc,attr);
1108 char *value = qs_get_attr_value(doc,attr);
1109 if (STRCASEEQ('n','N',"name",name)) {
1110 /*----------------------------------------------------------------------*/
1112 /*----------------------------------------------------------------------*/
1114 W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1117 else if (STRCASEEQ('h','H',"href",name)) {
1118 /*----------------------------------------------------------------------*/
1120 /*----------------------------------------------------------------------*/
1121 value = chxj_encoding_parameter(r, value);
1122 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1123 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
1129 else if (STRCASEEQ('a','A',"accesskey",name)) {
1130 /*----------------------------------------------------------------------*/
1132 /*----------------------------------------------------------------------*/
1133 W_L(" accesskey=\"");
1137 else if (STRCASEEQ('c','C',"cti",name)) {
1138 /*----------------------------------------------------------------------*/
1140 /*----------------------------------------------------------------------*/
1145 else if (STRCASEEQ('i','I',"ijam",name)) {
1146 /*----------------------------------------------------------------------*/
1148 /*----------------------------------------------------------------------*/
1151 else if (STRCASEEQ('u','U',"utn",name)) {
1152 /*----------------------------------------------------------------------*/
1154 /* It is special only for CHTML. */
1155 /*----------------------------------------------------------------------*/
1158 else if (STRCASEEQ('t','T',"telbook",name)) {
1159 /*----------------------------------------------------------------------*/
1161 /*----------------------------------------------------------------------*/
1164 else if (STRCASEEQ('k','K',"kana",name)) {
1165 /*----------------------------------------------------------------------*/
1167 /*----------------------------------------------------------------------*/
1170 else if (STRCASEEQ('e','E',"email",name)) {
1171 /*----------------------------------------------------------------------*/
1173 /*----------------------------------------------------------------------*/
1176 else if (STRCASEEQ('i','I',"ista",name)) {
1177 /*----------------------------------------------------------------------*/
1179 /*----------------------------------------------------------------------*/
1182 else if (STRCASEEQ('i','I',"ilet",name)) {
1183 /*----------------------------------------------------------------------*/
1185 /*----------------------------------------------------------------------*/
1188 else if (STRCASEEQ('i','I',"iswf",name)) {
1189 /*----------------------------------------------------------------------*/
1191 /*----------------------------------------------------------------------*/
1194 else if (STRCASEEQ('i','I',"irst",name)) {
1195 /*----------------------------------------------------------------------*/
1197 /*----------------------------------------------------------------------*/
1207 * It is a handler who processes the A tag.
1209 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1210 * destination is specified.
1211 * @param node [i] The A tag node is specified.
1212 * @return The conversion result is returned.
1215 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1221 jxhtml = GET_JXHTML(pdoc);
1231 * It is a handler who processes the BR tag.
1233 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1234 * destination is specified.
1235 * @param node [i] The BR tag node is specified.
1236 * @return The conversion result is returned.
1239 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1246 jxhtml = GET_JXHTML(pdoc);
1251 /*--------------------------------------------------------------------------*/
1252 /* Get Attributes */
1253 /*--------------------------------------------------------------------------*/
1254 for (attr = qs_get_attr(doc,node);
1256 attr = qs_get_next_attr(doc,attr)) {
1257 char *name = qs_get_attr_name(doc,attr);
1258 char *value = qs_get_attr_value(doc,attr);
1259 if (STRCASEEQ('c','C',"clear",name)) {
1260 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1273 * It is a handler who processes the BR tag.
1275 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1276 * destination is specified.
1277 * @param node [i] The BR tag node is specified.
1278 * @return The conversion result is returned.
1281 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1283 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1289 * It is a handler who processes the TR tag.
1291 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1292 * destination is specified.
1293 * @param node [i] The TR tag node is specified.
1294 * @return The conversion result is returned.
1297 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1303 jxhtml = GET_JXHTML(pdoc);
1313 * It is a handler who processes the TR tag.
1315 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1316 * destination is specified.
1317 * @param node [i] The TR tag node is specified.
1318 * @return The conversion result is returned.
1321 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1323 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1329 * It is a handler who processes the FONT tag.
1331 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1332 * destination is specified.
1333 * @param node [i] The FONT tag node is specified.
1334 * @return The conversion result is returned.
1337 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1346 jxhtml = GET_JXHTML(pdoc);
1350 /*--------------------------------------------------------------------------*/
1351 /* Get Attributes */
1352 /*--------------------------------------------------------------------------*/
1353 for (attr = qs_get_attr(doc,node);
1355 attr = qs_get_next_attr(doc,attr)) {
1356 char *name = qs_get_attr_name(doc,attr);
1357 char *value = qs_get_attr_value(doc,attr);
1358 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1359 color = apr_pstrdup(doc->buf.pool, value);
1361 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1362 /*----------------------------------------------------------------------*/
1364 /*----------------------------------------------------------------------*/
1365 size = apr_pstrdup(doc->buf.pool, value);
1369 W_L("<font color=\"");
1372 jxhtml->font_flag++;
1375 jxhtml->font_size_flag++;
1377 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1378 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1379 case '3': W_L("<span style=\"font-size: small\">"); break;
1380 case '4': W_L("<span style=\"font-size: medium\">"); break;
1381 case '5': W_L("<span style=\"font-size: large\">"); break;
1382 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1383 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1385 if (*(size + 1) == '1') {
1386 W_L("<span style=\"font-size: small\">");
1389 if (*(size + 1) == '2') {
1390 W_L("<span style=\"font-size: x-small\">");
1393 if (*(size + 1) == '3') {
1394 W_L("<span style=\"font-size: xx-small\">");
1397 jxhtml->font_size_flag--;
1401 if (*(size + 1) == '1') {
1402 W_L("<span style=\"font-size: large\">");
1405 if (*(size + 1) == '2') {
1406 W_L("<span style=\"font-size: x-large\">");
1409 if (*(size + 1) == '3') {
1410 W_L("<span style=\"font-size: xx-large\">");
1413 jxhtml->font_size_flag--;
1417 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1418 jxhtml->font_size_flag--;
1426 * It is a handler who processes the FONT tag.
1428 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1429 * destination is specified.
1430 * @param node [i] The FONT tag node is specified.
1431 * @return The conversion result is returned.
1434 s_jxhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1440 jxhtml = GET_JXHTML(pdoc);
1444 if (jxhtml->font_size_flag) {
1446 jxhtml->font_size_flag--;
1448 if (jxhtml->font_flag) {
1450 jxhtml->font_flag--;
1457 * It is a handler who processes the FORM tag.
1459 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1460 * destination is specified.
1461 * @param node [i] The FORM tag node is specified.
1462 * @return The conversion result is returned.
1465 s_jxhtml_start_form_tag(void *pdoc, Node *node)
1471 char *new_hidden_tag = NULL;
1472 char *attr_method = NULL;
1473 char *attr_action = NULL;
1474 char *attr_utn = NULL;
1476 jxhtml = GET_JXHTML(pdoc);
1480 /*--------------------------------------------------------------------------*/
1481 /* Get Attributes */
1482 /*--------------------------------------------------------------------------*/
1483 for (attr = qs_get_attr(doc,node);
1485 attr = qs_get_next_attr(doc,attr)) {
1486 char *name = qs_get_attr_name(doc,attr);
1487 char *value = qs_get_attr_value(doc,attr);
1488 if (STRCASEEQ('a','A',"action", name)) {
1489 /*----------------------------------------------------------------------*/
1491 /*----------------------------------------------------------------------*/
1492 attr_action = chxj_encoding_parameter(r, value);
1493 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1495 else if (STRCASEEQ('m','M',"method", name)) {
1496 /*----------------------------------------------------------------------*/
1498 /*----------------------------------------------------------------------*/
1499 attr_method = apr_pstrdup(doc->pool, value);
1501 else if (STRCASEEQ('u','U',"utn", name)) {
1502 /*----------------------------------------------------------------------*/
1504 /* It is special only for CHTML. */
1505 /*----------------------------------------------------------------------*/
1510 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1515 char *old_qs = NULL;
1516 q = strchr(attr_action, '?');
1518 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);
1519 if (new_hidden_tag || old_qs) {
1540 if (new_hidden_tag) {
1541 W_V(new_hidden_tag);
1548 * It is a handler who processes the FORM tag.
1550 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1551 * destination is specified.
1552 * @param node [i] The FORM tag node is specified.
1553 * @return The conversion result is returned.
1556 s_jxhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1558 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1559 Doc *doc = jxhtml->doc;
1566 * It is a handler who processes the INPUT tag.
1568 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1569 * destination is specified.
1570 * @param node [i] The INPUT tag node is specified.
1571 * @return The conversion result is returned.
1574 s_jxhtml_start_input_tag(void *pdoc, Node *node)
1588 jxhtml = GET_JXHTML(pdoc);
1601 /*--------------------------------------------------------------------------*/
1602 /* Get Attributes */
1603 /*--------------------------------------------------------------------------*/
1604 type = qs_get_type_attr(doc, node, doc->buf.pool);
1605 name = qs_get_name_attr(doc, node, doc->buf.pool);
1606 value = qs_get_value_attr(doc,node, doc->buf.pool);
1607 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1608 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1609 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1610 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1611 size = qs_get_size_attr(doc, node, doc->buf.pool);
1614 if (type && (STRCASEEQ('t','T',"text", type) ||
1615 STRCASEEQ('p','P',"password",type) ||
1616 STRCASEEQ('c','C',"checkbox",type) ||
1617 STRCASEEQ('r','R',"radio", type) ||
1618 STRCASEEQ('h','H',"hidden", type) ||
1619 STRCASEEQ('s','S',"submit", type) ||
1620 STRCASEEQ('r','R',"reset", type))) {
1626 if (size && *size) {
1631 if (name && *name) {
1633 W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
1636 if (value && *value) {
1638 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1641 if (accesskey && *accesskey) {
1642 W_L(" accesskey=\"");
1646 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1647 /*------------------------------------------------------------------------*/
1649 /*------------------------------------------------------------------------*/
1650 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
1656 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,istyle);
1662 else if (type && STRCASEEQ('p','P',"password",type)) {
1667 /*--------------------------------------------------------------------------*/
1668 /* The figure is default for the password. */
1669 /*--------------------------------------------------------------------------*/
1670 if (max_length && *max_length) {
1671 if (chxj_chk_numeric(max_length) == 0) {
1672 W_L(" maxlength=\"");
1679 W_L(" checked=\"checked\"");
1687 * It is a handler who processes the INPUT tag.
1689 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1690 * destination is specified.
1691 * @param node [i] The INPUT tag node is specified.
1692 * @return The conversion result is returned.
1695 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1697 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1703 * It is a handler who processes the CENTER tag.
1705 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1706 * destination is specified.
1707 * @param node [i] The CENTER tag node is specified.
1708 * @return The conversion result is returned.
1711 s_jxhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1713 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1714 Doc *doc = jxhtml->doc;
1721 * It is a handler who processes the CENTER tag.
1723 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1724 * destination is specified.
1725 * @param node [i] The CENTER tag node is specified.
1726 * @return The conversion result is returned.
1729 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1735 jxhtml = GET_JXHTML(pdoc);
1745 * It is a handler who processes the li tag.
1747 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1748 * destination is specified.
1749 * @param node [i] The li tag node is specified.
1750 * @return The conversion result is returned.
1753 s_jxhtml_start_li_tag(void *pdoc, Node *node)
1760 jxhtml = GET_JXHTML(pdoc);
1765 /*--------------------------------------------------------------------------*/
1766 /* Get Attributes */
1767 /*--------------------------------------------------------------------------*/
1768 for (attr = qs_get_attr(doc,node);
1770 attr = qs_get_next_attr(doc,attr)) {
1771 char *name = qs_get_attr_name(doc,attr);
1772 char *value = qs_get_attr_value(doc,attr);
1773 if (STRCASEEQ('t','T',"type",name)) {
1774 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1780 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1792 * It is a handler who processes the li tag.
1794 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1795 * destination is specified.
1796 * @param node [i] The li tag node is specified.
1797 * @return The conversion result is returned.
1800 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1806 jxhtml = GET_JXHTML(pdoc);
1816 * It is a handler who processes the OL tag.
1818 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1819 * destination is specified.
1820 * @param node [i] The OL tag node is specified.
1821 * @return The conversion result is returned.
1824 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
1831 jxhtml = GET_JXHTML(pdoc);
1836 /*--------------------------------------------------------------------------*/
1837 /* Get Attributes */
1838 /*--------------------------------------------------------------------------*/
1839 for (attr = qs_get_attr(doc,node);
1841 attr = qs_get_next_attr(doc,attr)) {
1842 char *name = qs_get_attr_name(doc,attr);
1843 char *value = qs_get_attr_value(doc,attr);
1844 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1849 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1861 * It is a handler who processes the OL tag.
1863 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1864 * destination is specified.
1865 * @param node [i] The OL tag node is specified.
1866 * @return The conversion result is returned.
1869 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1875 jxhtml = GET_JXHTML(pdoc);
1885 * It is a handler who processes the P tag.
1887 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1888 * destination is specified.
1889 * @param node [i] The P tag node is specified.
1890 * @return The conversion result is returned.
1893 s_jxhtml_start_p_tag(void *pdoc, Node *node)
1901 jxhtml = GET_JXHTML(pdoc);
1906 for (attr = qs_get_attr(doc,node);
1908 attr = qs_get_next_attr(doc,attr)) {
1909 char *nm = qs_get_attr_name(doc,attr);
1910 char *val = qs_get_attr_value(doc,attr);
1911 if (STRCASEEQ('a','A',"align", nm)) {
1912 /*----------------------------------------------------------------------*/
1913 /* CHTML 1.0 (W3C version 3.2) */
1914 /*----------------------------------------------------------------------*/
1915 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1916 align = apr_pstrdup(doc->buf.pool, val);
1932 * It is a handler who processes the P tag.
1934 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1935 * destination is specified.
1936 * @param node [i] The P tag node is specified.
1937 * @return The conversion result is returned.
1940 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1942 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1943 Doc *doc = jxhtml->doc;
1951 * It is a handler who processes the PRE tag.
1953 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1954 * destination is specified.
1955 * @param node [i] The PRE tag node is specified.
1956 * @return The conversion result is returned.
1959 s_jxhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1961 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1962 Doc *doc = jxhtml->doc;
1971 * It is a handler who processes the PRE tag.
1973 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1974 * destination is specified.
1975 * @param node [i] The PRE tag node is specified.
1976 * @return The conversion result is returned.
1979 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1981 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1982 Doc *doc = jxhtml->doc;
1992 * It is a handler who processes the UL tag.
1994 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1995 * destination is specified.
1996 * @param node [i] The UL tag node is specified.
1997 * @return The conversion result is returned.
2000 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
2002 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2003 Doc *doc = jxhtml->doc;
2006 /*--------------------------------------------------------------------------*/
2007 /* Get Attributes */
2008 /*--------------------------------------------------------------------------*/
2009 for (attr = qs_get_attr(doc,node);
2011 attr = qs_get_next_attr(doc,attr)) {
2012 char *name = qs_get_attr_name(doc,attr);
2013 char *value = qs_get_attr_value(doc,attr);
2014 if (STRCASEEQ('t','T',"type",name)) {
2015 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2028 * It is a handler who processes the UL tag.
2030 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2031 * destination is specified.
2032 * @param node [i] The UL tag node is specified.
2033 * @return The conversion result is returned.
2036 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
2038 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2039 Doc *doc = jxhtml->doc;
2047 * It is a handler who processes the HR tag.
2049 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2050 * destination is specified.
2051 * @param node [i] The HR tag node is specified.
2052 * @return The conversion result is returned.
2055 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
2057 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2058 Doc *doc = jxhtml->doc;
2062 for (attr = qs_get_attr(doc,node);
2064 attr = qs_get_next_attr(doc,attr)) {
2065 char *name = qs_get_attr_name(doc,attr);
2066 char *value = qs_get_attr_value(doc,attr);
2067 if (STRCASEEQ('a','A',"align",name)) {
2068 /*----------------------------------------------------------------------*/
2070 /*----------------------------------------------------------------------*/
2071 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2077 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2078 /*----------------------------------------------------------------------*/
2080 /*----------------------------------------------------------------------*/
2085 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2086 /*----------------------------------------------------------------------*/
2088 /*----------------------------------------------------------------------*/
2093 else if (STRCASEEQ('n','N',"noshade",name)) {
2094 /*----------------------------------------------------------------------*/
2096 /*----------------------------------------------------------------------*/
2099 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2100 /*----------------------------------------------------------------------*/
2102 /*----------------------------------------------------------------------*/
2114 * It is a handler who processes the HR tag.
2116 * @param jxhtml [i/o] The pointer to the CHTML structure at the output
2117 * destination is specified.
2118 * @param node [i] The HR tag node is specified.
2119 * @return The conversion result is returned.
2122 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2124 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2130 * It is a handler who processes the IMG tag.
2132 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2133 * destination is specified.
2134 * @param node [i] The IMG tag node is specified.
2135 * @return The conversion result is returned.
2138 s_jxhtml_start_img_tag(void *pdoc, Node *node)
2140 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2141 Doc *doc = jxhtml->doc;
2142 request_rec *r = doc->r;
2144 #ifndef IMG_NOT_CONVERT_FILENAME
2145 device_table *spec = jxhtml->spec;
2150 /*--------------------------------------------------------------------------*/
2151 /* Get Attributes */
2152 /*--------------------------------------------------------------------------*/
2153 for (attr = qs_get_attr(doc,node);
2155 attr = qs_get_next_attr(doc,attr)) {
2156 char *name = qs_get_attr_name(doc,attr);
2157 char *value = qs_get_attr_value(doc,attr);
2158 if (STRCASEEQ('s','S',"src",name)) {
2159 /*----------------------------------------------------------------------*/
2161 /*----------------------------------------------------------------------*/
2162 #ifdef IMG_NOT_CONVERT_FILENAME
2163 value = chxj_encoding_parameter(r, value);
2164 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2165 value = chxj_add_cookie_no_update_parameter(r, value);
2170 value = chxj_img_conv(r, spec, value);
2171 value = chxj_encoding_parameter(r, value);
2172 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2173 value = chxj_add_cookie_no_update_parameter(r, value);
2179 else if (STRCASEEQ('a','A',"align",name)) {
2180 /*----------------------------------------------------------------------*/
2182 /*----------------------------------------------------------------------*/
2184 if (STRCASEEQ('t','T',"top", value) ||
2185 STRCASEEQ('m','M',"middle",value) ||
2186 STRCASEEQ('b','B',"bottom",value) ||
2187 STRCASEEQ('l','L',"left", value) ||
2188 STRCASEEQ('r','R',"right", value)) {
2193 else if (STRCASEEQ('c','C',"center",value)) {
2200 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2201 /*----------------------------------------------------------------------*/
2203 /*----------------------------------------------------------------------*/
2208 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2209 /*----------------------------------------------------------------------*/
2211 /*----------------------------------------------------------------------*/
2216 else if (STRCASEEQ('h','H',"hspace",name)) {
2217 /*----------------------------------------------------------------------*/
2219 /*----------------------------------------------------------------------*/
2222 else if (STRCASEEQ('v','V',"vspace",name)) {
2223 /*----------------------------------------------------------------------*/
2225 /*----------------------------------------------------------------------*/
2228 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2229 /*----------------------------------------------------------------------*/
2231 /*----------------------------------------------------------------------*/
2247 * It is a handler who processes the IMG tag.
2249 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2250 * destination is specified.
2251 * @param node [i] The IMG tag node is specified.
2252 * @return The conversion result is returned.
2255 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2257 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
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_start_select_tag(void *pdoc, Node *child)
2273 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2274 Doc *doc = jxhtml->doc;
2278 char *multiple = NULL;
2281 for (attr = qs_get_attr(doc,child);
2283 attr = qs_get_next_attr(doc,attr)) {
2284 char *nm = qs_get_attr_name(doc,attr);
2285 char *val = qs_get_attr_value(doc,attr);
2286 if (STRCASEEQ('s','S',"size",nm)) {
2287 /*----------------------------------------------------------------------*/
2288 /* CHTML 1.0 version 2.0 */
2289 /*----------------------------------------------------------------------*/
2290 size = apr_pstrdup(doc->buf.pool, val);
2292 else if (STRCASEEQ('n','N',"name",nm)) {
2293 /*----------------------------------------------------------------------*/
2294 /* CHTML 1.0 version 2.0 */
2295 /*----------------------------------------------------------------------*/
2296 name = apr_pstrdup(doc->buf.pool, val);
2298 else if (STRCASEEQ('m','M',"multiple", nm)) {
2299 /*----------------------------------------------------------------------*/
2300 /* CHTML 1.0 version 2.0 */
2301 /*----------------------------------------------------------------------*/
2302 multiple = apr_pstrdup(doc->buf.pool, val);
2305 if (size && *size) {
2310 if (name && *name) {
2324 * It is a handler who processes the SELECT tag.
2326 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2327 * destination is specified.
2328 * @param node [i] The SELECT tag node is specified.
2329 * @return The conversion result is returned.
2332 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2334 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2335 Doc *doc = jxhtml->doc;
2342 * It is a handler who processes the OPTION tag.
2344 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2345 * destination is specified.
2346 * @param node [i] The OPTION tag node is specified.
2347 * @return The conversion result is returned.
2350 s_jxhtml_start_option_tag(void *pdoc, Node *child)
2352 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2353 Doc *doc = jxhtml->doc;
2356 char *selected = NULL;
2360 for (attr = qs_get_attr(doc,child);
2362 attr = qs_get_next_attr(doc,attr)) {
2363 char *nm = qs_get_attr_name(doc,attr);
2364 char *val = qs_get_attr_value(doc,attr);
2365 if (STRCASEEQ('s','S',"selected",nm)) {
2366 /*----------------------------------------------------------------------*/
2367 /* CHTML 1.0 version 2.0 */
2368 /*----------------------------------------------------------------------*/
2369 selected = apr_pstrdup(doc->buf.pool, val);
2371 else if (STRCASEEQ('v','V',"value",nm)) {
2372 /*----------------------------------------------------------------------*/
2373 /* CHTML 1.0 version 2.0 */
2374 /*----------------------------------------------------------------------*/
2375 value = apr_pstrdup(doc->buf.pool, val);
2392 * It is a handler who processes the OPTION tag.
2394 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2395 * destination is specified.
2396 * @param node [i] The OPTION tag node is specified.
2397 * @return The conversion result is returned.
2400 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2402 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2403 Doc *doc = jxhtml->doc;
2410 * It is a handler who processes the DIV tag.
2412 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2413 * destination is specified.
2414 * @param node [i] The DIV tag node is specified.
2415 * @return The conversion result is returned.
2418 s_jxhtml_start_div_tag(void *pdoc, Node *child)
2426 jxhtml = GET_JXHTML(pdoc);
2431 for (attr = qs_get_attr(doc,child);
2433 attr = qs_get_next_attr(doc,attr)) {
2434 char *nm = qs_get_attr_name(doc,attr);
2435 char *val = qs_get_attr_value(doc,attr);
2436 if (STRCASEEQ('a','A',"align",nm)) {
2437 /*----------------------------------------------------------------------*/
2438 /* CHTML 1.0 (W3C version 3.2) */
2439 /*----------------------------------------------------------------------*/
2440 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2441 align = apr_pstrdup(doc->buf.pool, val);
2456 * It is a handler who processes the DIV tag.
2458 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2459 * destination is specified.
2460 * @param node [i] The DIV tag node is specified.
2461 * @return The conversion result is returned.
2464 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2470 jxhtml = GET_JXHTML(pdoc);
2480 s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s)
2486 case '1': return apr_psprintf(p, "hiragana");
2487 case '2': return apr_psprintf(p, "hankakukana");
2488 case '3': return apr_psprintf(p, "alphabet");
2489 case '4': return apr_psprintf(p, "numeric");
2491 tmp = apr_palloc(p, 1);
2493 return apr_pstrdup(p, tmp);
2497 tmp = apr_palloc(p, 1);
2499 return apr_pstrdup(p,tmp);
2504 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
2511 jxhtml = GET_JXHTML(pdoc);
2515 for (child = qs_get_child_node(doc, node);
2517 child = qs_get_next_node(doc, child)) {
2519 s_jxhtml_chxjif_tag(jxhtml, child);
2526 * It is a handler who processes the TEXTARE tag.
2528 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2529 * destination is specified.
2530 * @param node [i] The TEXTAREA tag node is specified.
2531 * @return The conversion result is returned.
2534 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
2541 jxhtml = GET_JXHTML(pdoc);
2545 jxhtml->textarea_flag++;
2547 for (attr = qs_get_attr(doc,node);
2549 attr = qs_get_next_attr(doc,attr)) {
2550 char *name = qs_get_attr_name(doc,attr);
2551 char *value = qs_get_attr_value(doc,attr);
2552 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2553 W_L(" accesskey=\"");
2557 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2558 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,value);
2563 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2568 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2573 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2585 * It is a handler who processes the TEXTAREA tag.
2587 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2588 * destination is specified.
2589 * @param node [i] The TEXTAREA tag node is specified.
2590 * @return The conversion result is returned.
2593 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2599 jxhtml = GET_JXHTML(pdoc);
2604 jxhtml->textarea_flag--;
2611 * It is a handler who processes the B tag.
2613 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2614 * destination is specified.
2615 * @param node [i] The B tag node is specified.
2616 * @return The conversion result is returned.
2619 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2625 jxhtml = GET_JXHTML(pdoc);
2635 * It is a handler who processes the B tag.
2637 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2638 * destination is specified.
2639 * @param node [i] The B tag node is specified.
2640 * @return The conversion result is returned.
2643 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2645 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
2646 Doc* doc = jxhtml->doc;
2653 s_jxhtml_text_tag(void* pdoc, Node* child)
2665 jxhtml = GET_JXHTML(pdoc);
2669 textval = qs_get_node_value(doc,child);
2670 if (strlen(textval) == 0) {
2674 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2675 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2677 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2678 memset(one_byte, 0, sizeof(one_byte));
2681 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2683 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
2685 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2690 if (is_sjis_kanji(textval[ii])) {
2691 one_byte[0] = textval[ii+0];
2692 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2693 one_byte[0] = textval[ii+1];
2694 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2698 if (jxhtml->pre_flag) {
2699 one_byte[0] = textval[ii+0];
2700 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2703 if (jxhtml->textarea_flag) {
2704 one_byte[0] = textval[ii+0];
2705 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2708 if (textval[ii] != '\r' && textval[ii] != '\n') {
2709 one_byte[0] = textval[ii+0];
2710 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2720 * It is a handler who processes the BLOCKQUOTE tag.
2722 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2723 * destination is specified.
2724 * @param node [i] The BLOCKQUOTE tag node is specified.
2725 * @return The conversion result is returned.
2728 s_jxhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2730 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2731 Doc *doc = jxhtml->doc;
2732 W_L("<blockquote>");
2738 * It is a handler who processes the BLOCKQUOTE tag.
2740 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2741 * destination is specified.
2742 * @param node [i] The BLOCKQUOTE tag node is specified.
2743 * @return The conversion result is returned.
2746 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2748 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2749 Doc *doc = jxhtml->doc;
2750 W_L("</blockquote>");
2756 * It is a handler who processes the DIR tag.
2758 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2759 * destination is specified.
2760 * @param node [i] The DIR tag node is specified.
2761 * @return The conversion result is returned.
2764 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
2766 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2767 Doc *doc = jxhtml->doc;
2770 for (attr = qs_get_attr(doc,node);
2772 attr = qs_get_next_attr(doc,attr)) {
2773 char *name = qs_get_attr_name(doc,attr);
2774 char *value = qs_get_attr_value(doc,attr);
2775 if (STRCASEEQ('t','T',"type",name)) {
2776 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2789 * It is a handler who processes the DIR tag.
2791 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2792 * destination is specified.
2793 * @param node [i] The DIR tag node is specified.
2794 * @return The conversion result is returned.
2797 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2799 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2800 Doc *doc = jxhtml->doc;
2807 * It is a handler who processes the DL tag.
2809 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2810 * destination is specified.
2811 * @param node [i] The DL tag node is specified.
2812 * @return The conversion result is returned.
2815 s_jxhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2817 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2818 Doc *doc = jxhtml->doc;
2825 * It is a handler who processes the DL tag.
2827 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2828 * destination is specified.
2829 * @param node [i] The DL tag node is specified.
2830 * @return The conversion result is returned.
2833 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2835 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2836 Doc *doc = jxhtml->doc;
2843 * It is a handler who processes the DT tag.
2845 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2846 * destination is specified.
2847 * @param node [i] The DT tag node is specified.
2848 * @return The conversion result is returned.
2851 s_jxhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2853 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2854 Doc *doc = jxhtml->doc;
2861 * It is a handler who processes the DT tag.
2863 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2864 * destination is specified.
2865 * @param node [i] The DT tag node is specified.
2866 * @return The conversion result is returned.
2869 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2871 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2877 * It is a handler who processes the DD tag.
2879 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2880 * destination is specified.
2881 * @param node [i] The DD tag node is specified.
2882 * @return The conversion result is returned.
2885 s_jxhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2887 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2888 Doc *doc = jxhtml->doc;
2895 * It is a handler who processes the DD tag.
2897 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2898 * destination is specified.
2899 * @param node [i] The DD tag node is specified.
2900 * @return The conversion result is returned.
2903 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2905 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2911 * It is a handler who processes the H1 tag.
2913 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2914 * destination is specified.
2915 * @param node [i] The H1 tag node is specified.
2916 * @return The conversion result is returned.
2919 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
2927 jxhtml = GET_JXHTML(pdoc);
2931 for (attr = qs_get_attr(doc,node);
2933 attr = qs_get_next_attr(doc,attr)) {
2934 char *name = qs_get_attr_name(doc,attr);
2935 char *value = qs_get_attr_value(doc,attr);
2936 if (STRCASEEQ('a','A',"align", name)) {
2937 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2938 jxhtml->h1_align_flag++;
2939 align = apr_pstrdup(doc->buf.pool, value);
2945 W_L("<div align=\"");
2954 * It is a handler who processes the H1 tag.
2956 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2957 * destination is specified.
2958 * @param node [i] The H1 tag node is specified.
2959 * @return The conversion result is returned.
2962 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2968 jxhtml = GET_JXHTML(pdoc);
2972 if (jxhtml->h1_align_flag) {
2973 jxhtml->h1_align_flag--;
2981 * It is a handler who processes the H2 tag.
2983 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2984 * destination is specified.
2985 * @param node [i] The H1 tag node is specified.
2986 * @return The conversion result is returned.
2989 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
2997 jxhtml = GET_JXHTML(pdoc);
3001 for (attr = qs_get_attr(doc,node);
3003 attr = qs_get_next_attr(doc,attr)) {
3004 char *name = qs_get_attr_name(doc,attr);
3005 char *value = qs_get_attr_value(doc,attr);
3006 if (STRCASEEQ('a','A',"align", name)) {
3007 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3008 jxhtml->h2_align_flag++;
3009 align = apr_pstrdup(doc->buf.pool, value);
3015 W_L("<div align=\"");
3024 * It is a handler who processes the H2 tag.
3026 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3027 * destination is specified.
3028 * @param node [i] The H1 tag node is specified.
3029 * @return The conversion result is returned.
3032 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
3038 jxhtml = GET_JXHTML(pdoc);
3042 if (jxhtml->h2_align_flag) {
3043 jxhtml->h2_align_flag--;
3051 * It is a handler who processes the H3 tag.
3053 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3054 * destination is specified.
3055 * @param node [i] The H1 tag node is specified.
3056 * @return The conversion result is returned.
3059 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
3067 jxhtml = GET_JXHTML(pdoc);
3071 for (attr = qs_get_attr(doc,node);
3073 attr = qs_get_next_attr(doc,attr)) {
3076 name = qs_get_attr_name(doc,attr);
3077 value = qs_get_attr_value(doc,attr);
3078 if (STRCASEEQ('a','A',"align", name)) {
3079 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3080 jxhtml->h3_align_flag++;
3081 align = apr_pstrdup(doc->buf.pool, value);
3087 W_L("<div align=\"");
3096 * It is a handler who processes the H3 tag.
3098 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3099 * destination is specified.
3100 * @param node [i] The H1 tag node is specified.
3101 * @return The conversion result is returned.
3104 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
3110 jxhtml = GET_JXHTML(pdoc);
3114 if (jxhtml->h3_align_flag) {
3115 jxhtml->h3_align_flag--;
3123 * It is a handler who processes the H4 tag.
3125 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3126 * destination is specified.
3127 * @param node [i] The H1 tag node is specified.
3128 * @return The conversion result is returned.
3131 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
3139 jxhtml = GET_JXHTML(pdoc);
3143 for (attr = qs_get_attr(doc,node);
3145 attr = qs_get_next_attr(doc,attr)) {
3146 char *name = qs_get_attr_name(doc,attr);
3147 char *value = qs_get_attr_value(doc,attr);
3148 if (STRCASEEQ('a','A',"align", name)) {
3149 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3150 jxhtml->h4_align_flag++;
3151 align = apr_pstrdup(doc->buf.pool, value);
3157 W_L("<div align=\"");
3166 * It is a handler who processes the H4 tag.
3168 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3169 * destination is specified.
3170 * @param node [i] The H1 tag node is specified.
3171 * @return The conversion result is returned.
3174 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3180 jxhtml = GET_JXHTML(pdoc);
3184 if (jxhtml->h4_align_flag) {
3185 jxhtml->h4_align_flag--;
3193 * It is a handler who processes the H5 tag.
3195 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3196 * destination is specified.
3197 * @param node [i] The H1 tag node is specified.
3198 * @return The conversion result is returned.
3201 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
3209 jxhtml = GET_JXHTML(pdoc);
3213 for (attr = qs_get_attr(doc,node);
3215 attr = qs_get_next_attr(doc,attr)) {
3216 char *name = qs_get_attr_name(doc,attr);
3217 char *value = qs_get_attr_value(doc,attr);
3218 if (STRCASEEQ('a','A',"align", name)) {
3219 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3220 jxhtml->h5_align_flag++;
3221 align = apr_pstrdup(doc->buf.pool, value);
3227 W_L("<div align=\"");
3236 * It is a handler who processes the H5 tag.
3238 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3239 * destination is specified.
3240 * @param node [i] The H1 tag node is specified.
3241 * @return The conversion result is returned.
3244 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3250 jxhtml = GET_JXHTML(pdoc);
3254 if (jxhtml->h5_align_flag) {
3255 jxhtml->h5_align_flag--;
3263 * It is a handler who processes the H6 tag.
3265 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3266 * destination is specified.
3267 * @param node [i] The H1 tag node is specified.
3268 * @return The conversion result is returned.
3271 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
3279 jxhtml = GET_JXHTML(pdoc);
3283 for (attr = qs_get_attr(doc,node);
3285 attr = qs_get_next_attr(doc,attr)) {
3286 char *name = qs_get_attr_name(doc,attr);
3287 char *value = qs_get_attr_value(doc,attr);
3288 if (STRCASEEQ('a','A',"align", name)) {
3289 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3290 jxhtml->h6_align_flag++;
3291 align = apr_pstrdup(doc->buf.pool, value);
3297 W_L("<div align=\"");
3306 * It is a handler who processes the H6 tag.
3308 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3309 * destination is specified.
3310 * @param node [i] The H1 tag node is specified.
3311 * @return The conversion result is returned.
3314 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3320 jxhtml = GET_JXHTML(pdoc);
3324 if (jxhtml->h6_align_flag) {
3325 jxhtml->h6_align_flag--;
3333 * It is a handler who processes the MENU tag.
3335 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3336 * destination is specified.
3337 * @param node [i] The MENU tag node is specified.
3338 * @return The conversion result is returned.
3341 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
3343 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3344 Doc *doc = jxhtml->doc;
3347 /*--------------------------------------------------------------------------*/
3348 /* Get Attributes */
3349 /*--------------------------------------------------------------------------*/
3350 for (attr = qs_get_attr(doc,node);
3352 attr = qs_get_next_attr(doc,attr)) {
3353 char *name = qs_get_attr_name(doc,attr);
3354 char *value = qs_get_attr_value(doc,attr);
3355 if (STRCASEEQ('t','T',"type",name)) {
3356 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3369 * It is a handler who processes the MENU tag.
3371 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3372 * destination is specified.
3373 * @param node [i] The MENU tag node is specified.
3374 * @return The conversion result is returned.
3377 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3379 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3380 Doc *doc = jxhtml->doc;
3387 * It is a handler who processes the PLAINTEXT tag.
3389 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3390 * destination is specified.
3391 * @param node [i] The PLAINTEXT tag node is specified.
3392 * @return The conversion result is returned.
3395 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
3400 jxhtml = GET_JXHTML(pdoc);
3403 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
3408 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3413 jxhtml = GET_JXHTML(pdoc);
3415 for (child = qs_get_child_node(doc, node);
3417 child = qs_get_next_node(doc, child)) {
3419 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
3426 * It is a handler who processes the PLAINTEXT tag.
3428 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3429 * destination is specified.
3430 * @param node [i] The PLAINTEXT tag node is specified.
3431 * @return The conversion result is returned.
3434 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3436 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3442 * It is a handler who processes the BLINK tag.
3444 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3445 * destination is specified.
3446 * @param node [i] The BLINK tag node is specified.
3447 * @return The conversion result is returned.
3450 s_jxhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3452 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3453 Doc *doc = jxhtml->doc;
3460 * It is a handler who processes the BLINK tag.
3462 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3463 * destination is specified.
3464 * @param node [i] The BLINK tag node is specified.
3465 * @return The conversion result is returned.
3468 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3470 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3471 Doc *doc = jxhtml->doc;
3478 * It is a handler who processes the MARQUEE tag.
3480 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3481 * destination is specified.
3482 * @param node [i] The MARQUEE tag node is specified.
3483 * @return The conversion result is returned.
3486 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
3488 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3489 Doc *doc = jxhtml->doc;
3492 /*--------------------------------------------------------------------------*/
3493 /* Get Attributes */
3494 /*--------------------------------------------------------------------------*/
3495 for (attr = qs_get_attr(doc,node);
3497 attr = qs_get_next_attr(doc,attr)) {
3498 char *name = qs_get_attr_name(doc,attr);
3499 char *value = qs_get_attr_value(doc,attr);
3500 if (STRCASEEQ('d','D',"direction", name)) {
3501 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3502 W_L(" direction=\"");
3507 else if (STRCASEEQ('b','B',"behavior",name)) {
3510 else if (STRCASEEQ('l','L',"loop",name)) {
3513 else if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
3525 * It is a handler who processes the MARQUEE tag.
3527 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3528 * destination is specified.
3529 * @param node [i] The MARQUEE tag node is specified.
3530 * @return The conversion result is returned.
3533 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3535 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3536 Doc *doc = jxhtml->doc;
3543 * It is handler who processes the New Line Code.
3546 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3548 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3549 Doc *doc = jxhtml->doc;