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"
27 #include "chxj_conv_z2h.h"
30 #define GET_JXHTML(X) ((jxhtml_t *)(X))
33 #define W_L(X) do { jxhtml->out = BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, (X)); } while(0)
34 #define W_V(X) do { jxhtml->out = (X) ? BUFFERED_WRITE_VALUE(jxhtml->out, &doc->buf, (X)) \
35 : BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, ""); } while(0)
37 #define W_NLCODE() do { char *nlcode = TO_NLCODE(jxhtml->conf); W_V(nlcode); } while (0)
39 static char *s_jxhtml_start_html_tag (void *pdoc, Node *node);
40 static char *s_jxhtml_end_html_tag (void *pdoc, Node *node);
41 static char *s_jxhtml_start_meta_tag (void *pdoc, Node *node);
42 static char *s_jxhtml_end_meta_tag (void *pdoc, Node *node);
43 static char *s_jxhtml_start_head_tag (void *pdoc, Node *node);
44 static char *s_jxhtml_end_head_tag (void *pdoc, Node *node);
45 static char *s_jxhtml_start_title_tag (void *pdoc, Node *node);
46 static char *s_jxhtml_end_title_tag (void *pdoc, Node *node);
47 static char *s_jxhtml_start_base_tag (void *pdoc, Node *node);
48 static char *s_jxhtml_end_base_tag (void *pdoc, Node *node);
49 static char *s_jxhtml_start_body_tag (void *pdoc, Node *node);
50 static char *s_jxhtml_end_body_tag (void *pdoc, Node *node);
51 static char *s_jxhtml_start_a_tag (void *pdoc, Node *node);
52 static char *s_jxhtml_end_a_tag (void *pdoc, Node *node);
53 static char *s_jxhtml_start_pre_tag (void *pdoc, Node *node);
54 static char *s_jxhtml_end_pre_tag (void *pdoc, Node *node);
55 static char *s_jxhtml_start_p_tag (void *pdoc, Node *node);
56 static char *s_jxhtml_end_p_tag (void *pdoc, Node *node);
57 static char *s_jxhtml_start_ul_tag (void *pdoc, Node *node);
58 static char *s_jxhtml_end_ul_tag (void *pdoc, Node *node);
59 static char *s_jxhtml_start_ol_tag (void *pdoc, Node *node);
60 static char *s_jxhtml_end_ol_tag (void *pdoc, Node *node);
61 static char *s_jxhtml_start_li_tag (void *pdoc, Node *node);
62 static char *s_jxhtml_end_li_tag (void *pdoc, Node *node);
63 static char *s_jxhtml_start_br_tag (void *pdoc, Node *node);
64 static char *s_jxhtml_end_br_tag (void *pdoc, Node *node);
65 static char *s_jxhtml_start_tr_tag (void *pdoc, Node *node);
66 static char *s_jxhtml_end_tr_tag (void *pdoc, Node *node);
67 static char *s_jxhtml_start_font_tag (void *pdoc, Node *node);
68 static char *s_jxhtml_end_font_tag (void *pdoc, Node *node);
69 static char *s_jxhtml_start_form_tag (void *pdoc, Node *node);
70 static char *s_jxhtml_end_form_tag (void *pdoc, Node *node);
71 static char *s_jxhtml_start_input_tag (void *pdoc, Node *node);
72 static char *s_jxhtml_end_input_tag (void *pdoc, Node *node);
73 static char *s_jxhtml_start_center_tag (void *pdoc, Node *node);
74 static char *s_jxhtml_end_center_tag (void *pdoc, Node *node);
75 static char *s_jxhtml_start_hr_tag (void *pdoc, Node *node);
76 static char *s_jxhtml_end_hr_tag (void *pdoc, Node *node);
77 static char *s_jxhtml_start_img_tag (void *pdoc, Node *node);
78 static char *s_jxhtml_end_img_tag (void *pdoc, Node *node);
79 static char *s_jxhtml_start_select_tag (void *pdoc, Node *node);
80 static char *s_jxhtml_end_select_tag (void *pdoc, Node *node);
81 static char *s_jxhtml_start_option_tag (void *pdoc, Node *node);
82 static char *s_jxhtml_end_option_tag (void *pdoc, Node *node);
83 static char *s_jxhtml_start_div_tag (void *pdoc, Node *node);
84 static char *s_jxhtml_end_div_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
86 static char *s_jxhtml_end_textarea_tag (void *pdoc, Node *node);
87 static char *s_jxhtml_start_b_tag (void *pdoc, Node *node);
88 static char *s_jxhtml_end_b_tag (void *pdoc, Node *node);
89 static char *s_jxhtml_chxjif_tag (void *pdoc, Node *node);
90 static char *s_jxhtml_text_tag (void *pdoc, Node *node);
91 static char *s_jxhtml_start_blockquote_tag(void *pdoc, Node *node);
92 static char *s_jxhtml_end_blockquote_tag (void *pdoc, Node *node);
93 static char *s_jxhtml_start_dir_tag (void *pdoc, Node *node);
94 static char *s_jxhtml_end_dir_tag (void *pdoc, Node *node);
95 static char *s_jxhtml_start_dl_tag (void *pdoc, Node *node);
96 static char *s_jxhtml_end_dl_tag (void *pdoc, Node *node);
97 static char *s_jxhtml_start_dt_tag (void *pdoc, Node *node);
98 static char *s_jxhtml_end_dt_tag (void *pdoc, Node *node);
99 static char *s_jxhtml_start_dd_tag (void *pdoc, Node *node);
100 static char *s_jxhtml_end_dd_tag (void *pdoc, Node *node);
101 static char *s_jxhtml_start_h1_tag (void *pdoc, Node *node);
102 static char *s_jxhtml_end_h1_tag (void *pdoc, Node *node);
103 static char *s_jxhtml_start_h2_tag (void *pdoc, Node *node);
104 static char *s_jxhtml_end_h2_tag (void *pdoc, Node *node);
105 static char *s_jxhtml_start_h3_tag (void *pdoc, Node *node);
106 static char *s_jxhtml_end_h3_tag (void *pdoc, Node *node);
107 static char *s_jxhtml_start_h4_tag (void *pdoc, Node *node);
108 static char *s_jxhtml_end_h4_tag (void *pdoc, Node *node);
109 static char *s_jxhtml_start_h5_tag (void *pdoc, Node *node);
110 static char *s_jxhtml_end_h5_tag (void *pdoc, Node *node);
111 static char *s_jxhtml_start_h6_tag (void *pdoc, Node *node);
112 static char *s_jxhtml_end_h6_tag (void *pdoc, Node *node);
113 static char *s_jxhtml_start_menu_tag (void *pdoc, Node *node);
114 static char *s_jxhtml_end_menu_tag (void *pdoc, Node *node);
115 static char *s_jxhtml_start_plaintext_tag (void *pdoc, Node *node);
116 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
117 static char *s_jxhtml_end_plaintext_tag (void *pdoc, Node *node);
118 static char *s_jxhtml_start_blink_tag (void *pdoc, Node *node);
119 static char *s_jxhtml_end_blink_tag (void *pdoc, Node *node);
120 static char *s_jxhtml_start_marquee_tag(void *pdoc, Node *node);
121 static char *s_jxhtml_end_marquee_tag (void *pdoc, Node *node);
122 static char *s_jxhtml_newline_mark (void *pdoc, Node *node);
124 static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
126 static int s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
128 static char *s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s);
132 tag_handler jxhtml_handler[] = {
135 s_jxhtml_start_html_tag,
136 s_jxhtml_end_html_tag,
140 s_jxhtml_start_meta_tag,
141 s_jxhtml_end_meta_tag,
145 s_jxhtml_start_textarea_tag,
146 s_jxhtml_end_textarea_tag,
150 s_jxhtml_start_p_tag,
155 s_jxhtml_start_pre_tag,
156 s_jxhtml_end_pre_tag,
160 s_jxhtml_start_ul_tag,
165 s_jxhtml_start_li_tag,
170 s_jxhtml_start_ol_tag,
175 s_jxhtml_start_h1_tag,
180 s_jxhtml_start_h2_tag,
185 s_jxhtml_start_h3_tag,
190 s_jxhtml_start_h4_tag,
195 s_jxhtml_start_h5_tag,
200 s_jxhtml_start_h6_tag,
205 s_jxhtml_start_head_tag,
206 s_jxhtml_end_head_tag,
210 s_jxhtml_start_title_tag,
211 s_jxhtml_end_title_tag,
215 s_jxhtml_start_base_tag,
216 s_jxhtml_end_base_tag,
220 s_jxhtml_start_body_tag,
221 s_jxhtml_end_body_tag,
225 s_jxhtml_start_a_tag,
230 s_jxhtml_start_br_tag,
240 s_jxhtml_start_tr_tag,
255 s_jxhtml_start_font_tag,
256 s_jxhtml_end_font_tag,
260 s_jxhtml_start_form_tag,
261 s_jxhtml_end_form_tag,
265 s_jxhtml_start_input_tag,
266 s_jxhtml_end_input_tag,
270 s_jxhtml_start_center_tag,
271 s_jxhtml_end_center_tag,
275 s_jxhtml_start_hr_tag,
280 s_jxhtml_start_img_tag,
281 s_jxhtml_end_img_tag,
285 s_jxhtml_start_select_tag,
286 s_jxhtml_end_select_tag,
290 s_jxhtml_start_option_tag,
291 s_jxhtml_end_option_tag,
295 s_jxhtml_start_div_tag,
296 s_jxhtml_end_div_tag,
340 s_jxhtml_start_b_tag,
350 s_jxhtml_start_dt_tag,
365 s_jxhtml_start_blockquote_tag,
366 s_jxhtml_end_blockquote_tag,
370 s_jxhtml_start_dir_tag,
371 s_jxhtml_end_dir_tag,
375 s_jxhtml_start_dl_tag,
380 s_jxhtml_start_dd_tag,
385 s_jxhtml_start_menu_tag,
386 s_jxhtml_end_menu_tag,
390 s_jxhtml_start_plaintext_tag,
391 s_jxhtml_end_plaintext_tag,
395 s_jxhtml_start_blink_tag,
396 s_jxhtml_end_blink_tag,
400 s_jxhtml_start_marquee_tag,
401 s_jxhtml_end_marquee_tag,
405 s_jxhtml_newline_mark,
412 * converts from CHTML5.0 to JXHTML.
414 * @param r [i] Requet_rec is appointed.
415 * @param spec [i] The result of the device specification processing which
416 * was done in advance is appointed.
417 * @param src [i] The character string before the converting is appointed.
418 * @return The character string after the converting is returned.
427 chxjconvrule_entry *entryp,
438 /*--------------------------------------------------------------------------*/
440 /*--------------------------------------------------------------------------*/
442 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
444 DBG(r,"I found qrcode xml");
447 DBG(r,"not found qrcode xml");
449 /*--------------------------------------------------------------------------*/
450 /* The CHTML structure is initialized. */
451 /*--------------------------------------------------------------------------*/
452 s_init_jxhtml(&jxhtml, &doc, r, spec);
454 jxhtml.entryp = entryp;
455 jxhtml.cookie = cookie;
457 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
459 /*--------------------------------------------------------------------------*/
460 /* The character string of the input is analyzed. */
461 /*--------------------------------------------------------------------------*/
462 qs_init_malloc(&doc);
463 qs_init_root_node(&doc);
465 ss = apr_pcalloc(r->pool, srclen + 1);
467 memset(ss, 0, srclen + 1);
468 memcpy(ss, src, srclen);
471 chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
474 qs_parse_string(&doc,ss,strlen(ss));
476 chxj_buffered_write_init(r->pool, &doc.buf);
477 /*--------------------------------------------------------------------------*/
478 /* It converts it from CHTML to JXHTML. */
479 /*--------------------------------------------------------------------------*/
480 chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
481 jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
482 dst = apr_pstrdup(r->pool, jxhtml.out);
483 chxj_buffered_write_terminate(&doc.buf);
486 qs_all_free(&doc,QX_LOGMARK);
489 return apr_pstrdup(r->pool,ss);
492 dst = apr_psprintf(r->pool, "\n");
494 *dstlen = strlen(dst);
497 chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
505 * The CHTML structure is initialized.
507 * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
508 * initialized is specified.
509 * @param doc [i] The Doc structure that should be set to the initialized
510 * JXHTML structure is specified.
511 * @param r [i] To use POOL, the pointer to request_rec is specified.
512 * @param spec [i] The pointer to the device_table
515 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
517 memset(doc, 0, sizeof(Doc));
518 memset(jxhtml, 0, sizeof(jxhtml_t));
523 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
524 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
525 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
530 * Corresponding EMOJI to a current character-code is retrieved.
531 * The substitution character string is stored in the rslt pointer if agreeing.
533 * @param jxhtml [i] The pointer to the CHTML structure is specified.
534 * @param txt [i] The character string to want to examine whether it is
535 * EMOJI is specified.
536 * @param rslt [o] The pointer to the pointer that stores the result is
538 * @return When corresponding EMOJI exists, it returns it excluding 0.
541 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
553 if (! spec) DBG(r,"spec is NULL");
555 for (ee = jxhtml->conf->emoji;
559 unsigned char hex1byte;
560 unsigned char hex2byte;
563 DBG(r,"emoji->imode is NULL");
567 hex1byte = ee->imode->hex1byte & 0xff;
568 hex2byte = ee->imode->hex2byte & 0xff;
570 if (ee->imode->string
571 && strlen(ee->imode->string) > 0
572 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
573 if (spec == NULL || spec->emoji_type == NULL) {
574 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
575 return strlen(ee->imode->string);
582 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
583 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
584 if (spec == NULL || spec->emoji_type == NULL) {
585 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
598 chxj_jxhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
612 DBG(r, "REQ[%X] start chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
613 memset(doc, 0, sizeof(Doc));
614 memset(jxhtml, 0, sizeof(jxhtml_t));
619 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
620 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
621 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
623 apr_pool_create(&pool, r->pool);
625 chxj_buffered_write_init(pool, &doc->buf);
627 for (ii=0; ii<len; ii++) {
631 rtn = s_jxhtml_search_emoji(jxhtml, (char *)&src[ii], &out);
638 if (is_sjis_kanji(src[ii])) {
639 two_byte[0] = src[ii+0];
640 two_byte[1] = src[ii+1];
646 one_byte[0] = src[ii+0];
651 jxhtml->out = chxj_buffered_write_flush(jxhtml->out, &doc->buf);
653 DBG(r, "REQ[%X] end chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
659 * It is a handler who processes the HTML tag.
661 * @param pdoc [i/o] The pointer to the CHTML structure at the output
662 * destination is specified.
663 * @param node [i] The HTML tag node is specified.
664 * @return The conversion result is returned.
667 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
674 jxhtml = GET_JXHTML(pdoc);
677 DBG(r, "REQ[%X] start s_jxhtml_start_html_tag()", TO_ADDR(r));
679 W_L("<?xml version='1.0' encoding='Shift_JIS' ?>");
681 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"html-basic10-plus.dtd\">");
684 /*--------------------------------------------------------------------------*/
686 /*--------------------------------------------------------------------------*/
689 DBG(r, "REQ[%X] end s_jxhtml_start_html_tag()", TO_ADDR(r));
696 * It is a handler who processes the HTML tag.
698 * @param pdoc [i/o] The pointer to the CHTML structure at the output
699 * destination is specified.
700 * @param node [i] The HTML tag node is specified.
701 * @return The conversion result is returned.
704 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
706 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
707 Doc *doc = jxhtml->doc;
716 * It is a handler who processes the META tag.
718 * @param pdoc [i/o] The pointer to the CHTML structure at the output
719 * destination is specified.
720 * @param node [i] The META tag node is specified.
721 * @return The conversion result is returned.
724 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
730 int content_type_flag;
733 jxhtml = GET_JXHTML(pdoc);
737 content_type_flag = 0;
740 /*--------------------------------------------------------------------------*/
742 /*--------------------------------------------------------------------------*/
743 for (attr = qs_get_attr(doc,node);
745 attr = qs_get_next_attr(doc,attr)) {
746 char *name = qs_get_attr_name(doc,attr);
747 char *value = qs_get_attr_value(doc,attr);
751 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
752 /*----------------------------------------------------------------------*/
754 /*----------------------------------------------------------------------*/
755 W_L(" http-equiv=\"");
758 if (STRCASEEQ('c','C',"content-type",value)) {
759 content_type_flag = 1;
761 if (STRCASEEQ('r','R',"refresh",value)) {
769 if (strcasecmp(name, "content") == 0 && value && *value) {
770 /*----------------------------------------------------------------------*/
772 /*----------------------------------------------------------------------*/
773 if (content_type_flag) {
777 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
786 buf = apr_pstrdup(r->pool, value);
788 url = strchr(buf, ';');
790 sec = apr_pstrdup(r->pool, buf);
793 url = chxj_encoding_parameter(r, url);
823 * It is a handler who processes the META tag.
825 * @param pdoc [i/o] The pointer to the CHTML structure at the output
826 * destination is specified.
827 * @param node [i] The META tag node is specified.
828 * @return The conversion result is returned.
831 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
833 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
840 * It is a handler who processes the HEAD tag.
842 * @param pdoc [i/o] The pointer to the CHTML structure at the output
843 * destination is specified.
844 * @param node [i] The HEAD tag node is specified.
845 * @return The conversion result is returned.
848 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
854 jxhtml = GET_JXHTML(pdoc);
864 * It is a handler who processes the HEAD tag.
866 * @param pdoc [i/o] The pointer to the CHTML structure at the output
867 * destination is specified.
868 * @param node [i] The HEAD tag node is specified.
869 * @return The conversion result is returned.
872 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
878 jxhtml = GET_JXHTML(pdoc);
888 * It is a handler who processes the TITLE tag.
890 * @param pdoc [i/o] The pointer to the CHTML structure at the output
891 * destination is specified.
892 * @param node [i] The TITLE tag node is specified.
893 * @return The conversion result is returned.
896 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
902 jxhtml = GET_JXHTML(pdoc);
912 * It is a handler who processes the TITLE tag.
914 * @param pdoc [i/o] The pointer to the CHTML structure at the output
915 * destination is specified.
916 * @param node [i] The TITLE tag node is specified.
917 * @return The conversion result is returned.
920 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
926 jxhtml = GET_JXHTML(pdoc);
936 * It is a handler who processes the BASE tag.
938 * @param pdoc [i/o] The pointer to the CHTML structure at the output
939 * destination is specified.
940 * @param node [i] The BASE tag node is specified.
941 * @return The conversion result is returned.
944 s_jxhtml_start_base_tag(void *pdoc, Node *node)
951 jxhtml = GET_JXHTML(pdoc);
956 /*--------------------------------------------------------------------------*/
958 /*--------------------------------------------------------------------------*/
959 for (attr = qs_get_attr(doc,node);
961 attr = qs_get_next_attr(doc,attr)) {
962 char *name = qs_get_attr_name(doc,attr);
963 char *value = qs_get_attr_value(doc,attr);
964 if (STRCASEEQ('h','H',"href",name)) {
976 * It is a handler who processes the BASE tag.
978 * @param pdoc [i/o] The pointer to the CHTML structure at the output
979 * destination is specified.
980 * @param node [i] The BASE tag node is specified.
981 * @return The conversion result is returned.
984 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
986 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
992 * It is a handler who processes the BODY tag.
994 * @param pdoc [i/o] The pointer to the CHTML structure at the output
995 * destination is specified.
996 * @param node [i] The BODY tag node is specified.
997 * @return The conversion result is returned.
1000 s_jxhtml_start_body_tag(void *pdoc, Node *node)
1007 jxhtml = GET_JXHTML(pdoc);
1012 /*--------------------------------------------------------------------------*/
1013 /* Get Attributes */
1014 /*--------------------------------------------------------------------------*/
1015 for (attr = qs_get_attr(doc,node);
1017 attr = qs_get_next_attr(doc,attr)) {
1018 char *name = qs_get_attr_name(doc,attr);
1019 char *value = qs_get_attr_value(doc,attr);
1020 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1021 /*----------------------------------------------------------------------*/
1023 /*----------------------------------------------------------------------*/
1028 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1029 /*----------------------------------------------------------------------*/
1031 /*----------------------------------------------------------------------*/
1036 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1037 /*----------------------------------------------------------------------*/
1039 /*----------------------------------------------------------------------*/
1044 else if (STRCASEEQ('a','A',"alink",name)) {
1045 /*----------------------------------------------------------------------*/
1047 /*----------------------------------------------------------------------*/
1050 else if (STRCASEEQ('v','V',"vlink",name)) {
1051 /*----------------------------------------------------------------------*/
1053 /*----------------------------------------------------------------------*/
1063 * It is a handler who processes the BODY tag.
1065 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1066 * destination is specified.
1067 * @param node [i] The BODY tag node is specified.
1068 * @return The conversion result is returned.
1071 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1077 jxhtml = GET_JXHTML(pdoc);
1081 W_L("</div></body>");
1087 * It is a handler who processes the A tag.
1089 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1090 * destination is specified.
1091 * @param node [i] The A tag node is specified.
1092 * @return The conversion result is returned.
1095 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1102 jxhtml = GET_JXHTML(pdoc);
1107 /*--------------------------------------------------------------------------*/
1108 /* Get Attributes */
1109 /*--------------------------------------------------------------------------*/
1110 for (attr = qs_get_attr(doc,node);
1112 attr = qs_get_next_attr(doc,attr)) {
1113 char *name = qs_get_attr_name(doc,attr);
1114 char *value = qs_get_attr_value(doc,attr);
1115 if (STRCASEEQ('n','N',"name",name)) {
1116 /*----------------------------------------------------------------------*/
1118 /*----------------------------------------------------------------------*/
1120 W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1123 else if (STRCASEEQ('h','H',"href",name)) {
1124 /*----------------------------------------------------------------------*/
1126 /*----------------------------------------------------------------------*/
1127 value = chxj_encoding_parameter(r, value);
1128 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1129 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
1135 else if (STRCASEEQ('a','A',"accesskey",name)) {
1136 /*----------------------------------------------------------------------*/
1138 /*----------------------------------------------------------------------*/
1139 W_L(" accesskey=\"");
1143 else if (STRCASEEQ('c','C',"cti",name)) {
1144 /*----------------------------------------------------------------------*/
1146 /*----------------------------------------------------------------------*/
1151 else if (STRCASEEQ('i','I',"ijam",name)) {
1152 /*----------------------------------------------------------------------*/
1154 /*----------------------------------------------------------------------*/
1157 else if (STRCASEEQ('u','U',"utn",name)) {
1158 /*----------------------------------------------------------------------*/
1160 /* It is special only for CHTML. */
1161 /*----------------------------------------------------------------------*/
1164 else if (STRCASEEQ('t','T',"telbook",name)) {
1165 /*----------------------------------------------------------------------*/
1167 /*----------------------------------------------------------------------*/
1170 else if (STRCASEEQ('k','K',"kana",name)) {
1171 /*----------------------------------------------------------------------*/
1173 /*----------------------------------------------------------------------*/
1176 else if (STRCASEEQ('e','E',"email",name)) {
1177 /*----------------------------------------------------------------------*/
1179 /*----------------------------------------------------------------------*/
1182 else if (STRCASEEQ('i','I',"ista",name)) {
1183 /*----------------------------------------------------------------------*/
1185 /*----------------------------------------------------------------------*/
1188 else if (STRCASEEQ('i','I',"ilet",name)) {
1189 /*----------------------------------------------------------------------*/
1191 /*----------------------------------------------------------------------*/
1194 else if (STRCASEEQ('i','I',"iswf",name)) {
1195 /*----------------------------------------------------------------------*/
1197 /*----------------------------------------------------------------------*/
1200 else if (STRCASEEQ('i','I',"irst",name)) {
1201 /*----------------------------------------------------------------------*/
1203 /*----------------------------------------------------------------------*/
1213 * It is a handler who processes the A tag.
1215 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1216 * destination is specified.
1217 * @param node [i] The A tag node is specified.
1218 * @return The conversion result is returned.
1221 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1227 jxhtml = GET_JXHTML(pdoc);
1237 * It is a handler who processes the BR tag.
1239 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1240 * destination is specified.
1241 * @param node [i] The BR tag node is specified.
1242 * @return The conversion result is returned.
1245 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1252 jxhtml = GET_JXHTML(pdoc);
1257 /*--------------------------------------------------------------------------*/
1258 /* Get Attributes */
1259 /*--------------------------------------------------------------------------*/
1260 for (attr = qs_get_attr(doc,node);
1262 attr = qs_get_next_attr(doc,attr)) {
1263 char *name = qs_get_attr_name(doc,attr);
1264 char *value = qs_get_attr_value(doc,attr);
1265 if (STRCASEEQ('c','C',"clear",name)) {
1266 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1279 * It is a handler who processes the BR tag.
1281 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1282 * destination is specified.
1283 * @param node [i] The BR tag node is specified.
1284 * @return The conversion result is returned.
1287 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1289 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1295 * It is a handler who processes the TR tag.
1297 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1298 * destination is specified.
1299 * @param node [i] The TR tag node is specified.
1300 * @return The conversion result is returned.
1303 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1309 jxhtml = GET_JXHTML(pdoc);
1319 * It is a handler who processes the TR tag.
1321 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1322 * destination is specified.
1323 * @param node [i] The TR tag node is specified.
1324 * @return The conversion result is returned.
1327 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1329 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1335 * It is a handler who processes the FONT tag.
1337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1338 * destination is specified.
1339 * @param node [i] The FONT tag node is specified.
1340 * @return The conversion result is returned.
1343 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1352 jxhtml = GET_JXHTML(pdoc);
1356 /*--------------------------------------------------------------------------*/
1357 /* Get Attributes */
1358 /*--------------------------------------------------------------------------*/
1359 for (attr = qs_get_attr(doc,node);
1361 attr = qs_get_next_attr(doc,attr)) {
1362 char *name = qs_get_attr_name(doc,attr);
1363 char *value = qs_get_attr_value(doc,attr);
1364 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1365 color = apr_pstrdup(doc->buf.pool, value);
1367 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1368 /*----------------------------------------------------------------------*/
1370 /*----------------------------------------------------------------------*/
1371 size = apr_pstrdup(doc->buf.pool, value);
1375 W_L("<font color=\"");
1378 jxhtml->font_flag++;
1381 jxhtml->font_size_flag++;
1383 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1384 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1385 case '3': W_L("<span style=\"font-size: small\">"); break;
1386 case '4': W_L("<span style=\"font-size: medium\">"); break;
1387 case '5': W_L("<span style=\"font-size: large\">"); break;
1388 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1389 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1391 if (*(size + 1) == '1') {
1392 W_L("<span style=\"font-size: small\">");
1395 if (*(size + 1) == '2') {
1396 W_L("<span style=\"font-size: x-small\">");
1399 if (*(size + 1) == '3') {
1400 W_L("<span style=\"font-size: xx-small\">");
1403 jxhtml->font_size_flag--;
1407 if (*(size + 1) == '1') {
1408 W_L("<span style=\"font-size: large\">");
1411 if (*(size + 1) == '2') {
1412 W_L("<span style=\"font-size: x-large\">");
1415 if (*(size + 1) == '3') {
1416 W_L("<span style=\"font-size: xx-large\">");
1419 jxhtml->font_size_flag--;
1423 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1424 jxhtml->font_size_flag--;
1432 * It is a handler who processes the FONT tag.
1434 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1435 * destination is specified.
1436 * @param node [i] The FONT tag node is specified.
1437 * @return The conversion result is returned.
1440 s_jxhtml_end_font_tag(void *pdoc, Node *UNUSED(child))
1446 jxhtml = GET_JXHTML(pdoc);
1450 if (jxhtml->font_size_flag) {
1452 jxhtml->font_size_flag--;
1454 if (jxhtml->font_flag) {
1456 jxhtml->font_flag--;
1463 * It is a handler who processes the FORM tag.
1465 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1466 * destination is specified.
1467 * @param node [i] The FORM tag node is specified.
1468 * @return The conversion result is returned.
1471 s_jxhtml_start_form_tag(void *pdoc, Node *node)
1477 char *new_hidden_tag = NULL;
1478 char *attr_method = NULL;
1479 char *attr_action = NULL;
1480 char *attr_utn = NULL;
1482 jxhtml = GET_JXHTML(pdoc);
1486 /*--------------------------------------------------------------------------*/
1487 /* Get Attributes */
1488 /*--------------------------------------------------------------------------*/
1489 for (attr = qs_get_attr(doc,node);
1491 attr = qs_get_next_attr(doc,attr)) {
1492 char *name = qs_get_attr_name(doc,attr);
1493 char *value = qs_get_attr_value(doc,attr);
1494 if (STRCASEEQ('a','A',"action", name)) {
1495 /*----------------------------------------------------------------------*/
1497 /*----------------------------------------------------------------------*/
1498 attr_action = chxj_encoding_parameter(r, value);
1499 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1501 else if (STRCASEEQ('m','M',"method", name)) {
1502 /*----------------------------------------------------------------------*/
1504 /*----------------------------------------------------------------------*/
1505 attr_method = apr_pstrdup(doc->pool, value);
1507 else if (STRCASEEQ('u','U',"utn", name)) {
1508 /*----------------------------------------------------------------------*/
1510 /* It is special only for CHTML. */
1511 /*----------------------------------------------------------------------*/
1516 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1521 char *old_qs = NULL;
1522 q = strchr(attr_action, '?');
1524 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);
1525 if (new_hidden_tag || old_qs) {
1546 if (new_hidden_tag) {
1547 W_V(new_hidden_tag);
1554 * It is a handler who processes the FORM tag.
1556 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1557 * destination is specified.
1558 * @param node [i] The FORM tag node is specified.
1559 * @return The conversion result is returned.
1562 s_jxhtml_end_form_tag(void *pdoc, Node *UNUSED(child))
1564 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1565 Doc *doc = jxhtml->doc;
1572 * It is a handler who processes the INPUT tag.
1574 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1575 * destination is specified.
1576 * @param node [i] The INPUT tag node is specified.
1577 * @return The conversion result is returned.
1580 s_jxhtml_start_input_tag(void *pdoc, Node *node)
1594 jxhtml = GET_JXHTML(pdoc);
1607 /*--------------------------------------------------------------------------*/
1608 /* Get Attributes */
1609 /*--------------------------------------------------------------------------*/
1610 type = qs_get_type_attr(doc, node, doc->buf.pool);
1611 name = qs_get_name_attr(doc, node, doc->buf.pool);
1612 value = qs_get_value_attr(doc,node, doc->buf.pool);
1613 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1614 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1615 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1616 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1617 size = qs_get_size_attr(doc, node, doc->buf.pool);
1620 if (type && (STRCASEEQ('t','T',"text", type) ||
1621 STRCASEEQ('p','P',"password",type) ||
1622 STRCASEEQ('c','C',"checkbox",type) ||
1623 STRCASEEQ('r','R',"radio", type) ||
1624 STRCASEEQ('h','H',"hidden", type) ||
1625 STRCASEEQ('s','S',"submit", type) ||
1626 STRCASEEQ('r','R',"reset", type))) {
1632 if (size && *size) {
1637 if (name && *name) {
1639 W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
1642 if (value && *value) {
1643 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
1644 apr_size_t value_len = strlen(value);
1645 value = chxj_conv_z2h(r, value, &value_len, jxhtml->entryp);
1649 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1652 if (accesskey && *accesskey) {
1653 W_L(" accesskey=\"");
1657 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1658 /*------------------------------------------------------------------------*/
1660 /*------------------------------------------------------------------------*/
1661 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
1667 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,istyle);
1673 else if (type && STRCASEEQ('p','P',"password",type)) {
1678 /*--------------------------------------------------------------------------*/
1679 /* The figure is default for the password. */
1680 /*--------------------------------------------------------------------------*/
1681 if (max_length && *max_length) {
1682 if (chxj_chk_numeric(max_length) == 0) {
1683 W_L(" maxlength=\"");
1690 W_L(" checked=\"checked\"");
1698 * It is a handler who processes the INPUT tag.
1700 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1701 * destination is specified.
1702 * @param node [i] The INPUT tag node is specified.
1703 * @return The conversion result is returned.
1706 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
1708 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1714 * It is a handler who processes the CENTER tag.
1716 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1717 * destination is specified.
1718 * @param node [i] The CENTER tag node is specified.
1719 * @return The conversion result is returned.
1722 s_jxhtml_start_center_tag(void *pdoc, Node *UNUSED(node))
1724 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1725 Doc *doc = jxhtml->doc;
1732 * It is a handler who processes the CENTER tag.
1734 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1735 * destination is specified.
1736 * @param node [i] The CENTER tag node is specified.
1737 * @return The conversion result is returned.
1740 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(child))
1746 jxhtml = GET_JXHTML(pdoc);
1756 * It is a handler who processes the li tag.
1758 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1759 * destination is specified.
1760 * @param node [i] The li tag node is specified.
1761 * @return The conversion result is returned.
1764 s_jxhtml_start_li_tag(void *pdoc, Node *node)
1771 jxhtml = GET_JXHTML(pdoc);
1776 /*--------------------------------------------------------------------------*/
1777 /* Get Attributes */
1778 /*--------------------------------------------------------------------------*/
1779 for (attr = qs_get_attr(doc,node);
1781 attr = qs_get_next_attr(doc,attr)) {
1782 char *name = qs_get_attr_name(doc,attr);
1783 char *value = qs_get_attr_value(doc,attr);
1784 if (STRCASEEQ('t','T',"type",name)) {
1785 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1791 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1803 * It is a handler who processes the li tag.
1805 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1806 * destination is specified.
1807 * @param node [i] The li tag node is specified.
1808 * @return The conversion result is returned.
1811 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
1817 jxhtml = GET_JXHTML(pdoc);
1827 * It is a handler who processes the OL tag.
1829 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1830 * destination is specified.
1831 * @param node [i] The OL tag node is specified.
1832 * @return The conversion result is returned.
1835 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
1842 jxhtml = GET_JXHTML(pdoc);
1847 /*--------------------------------------------------------------------------*/
1848 /* Get Attributes */
1849 /*--------------------------------------------------------------------------*/
1850 for (attr = qs_get_attr(doc,node);
1852 attr = qs_get_next_attr(doc,attr)) {
1853 char *name = qs_get_attr_name(doc,attr);
1854 char *value = qs_get_attr_value(doc,attr);
1855 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1860 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1872 * It is a handler who processes the OL tag.
1874 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1875 * destination is specified.
1876 * @param node [i] The OL tag node is specified.
1877 * @return The conversion result is returned.
1880 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
1886 jxhtml = GET_JXHTML(pdoc);
1896 * It is a handler who processes the P tag.
1898 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1899 * destination is specified.
1900 * @param node [i] The P tag node is specified.
1901 * @return The conversion result is returned.
1904 s_jxhtml_start_p_tag(void *pdoc, Node *node)
1912 jxhtml = GET_JXHTML(pdoc);
1917 for (attr = qs_get_attr(doc,node);
1919 attr = qs_get_next_attr(doc,attr)) {
1920 char *nm = qs_get_attr_name(doc,attr);
1921 char *val = qs_get_attr_value(doc,attr);
1922 if (STRCASEEQ('a','A',"align", nm)) {
1923 /*----------------------------------------------------------------------*/
1924 /* CHTML 1.0 (W3C version 3.2) */
1925 /*----------------------------------------------------------------------*/
1926 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1927 align = apr_pstrdup(doc->buf.pool, val);
1943 * It is a handler who processes the P tag.
1945 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1946 * destination is specified.
1947 * @param node [i] The P tag node is specified.
1948 * @return The conversion result is returned.
1951 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
1953 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1954 Doc *doc = jxhtml->doc;
1962 * It is a handler who processes the PRE tag.
1964 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1965 * destination is specified.
1966 * @param node [i] The PRE tag node is specified.
1967 * @return The conversion result is returned.
1970 s_jxhtml_start_pre_tag(void *pdoc, Node *UNUSED(node))
1972 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1973 Doc *doc = jxhtml->doc;
1982 * It is a handler who processes the PRE tag.
1984 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1985 * destination is specified.
1986 * @param node [i] The PRE tag node is specified.
1987 * @return The conversion result is returned.
1990 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
1992 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1993 Doc *doc = jxhtml->doc;
2003 * It is a handler who processes the UL tag.
2005 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2006 * destination is specified.
2007 * @param node [i] The UL tag node is specified.
2008 * @return The conversion result is returned.
2011 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
2013 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2014 Doc *doc = jxhtml->doc;
2017 /*--------------------------------------------------------------------------*/
2018 /* Get Attributes */
2019 /*--------------------------------------------------------------------------*/
2020 for (attr = qs_get_attr(doc,node);
2022 attr = qs_get_next_attr(doc,attr)) {
2023 char *name = qs_get_attr_name(doc,attr);
2024 char *value = qs_get_attr_value(doc,attr);
2025 if (STRCASEEQ('t','T',"type",name)) {
2026 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2039 * It is a handler who processes the UL tag.
2041 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2042 * destination is specified.
2043 * @param node [i] The UL tag node is specified.
2044 * @return The conversion result is returned.
2047 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
2049 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2050 Doc *doc = jxhtml->doc;
2058 * It is a handler who processes the HR tag.
2060 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2061 * destination is specified.
2062 * @param node [i] The HR tag node is specified.
2063 * @return The conversion result is returned.
2066 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
2068 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2069 Doc *doc = jxhtml->doc;
2073 for (attr = qs_get_attr(doc,node);
2075 attr = qs_get_next_attr(doc,attr)) {
2076 char *name = qs_get_attr_name(doc,attr);
2077 char *value = qs_get_attr_value(doc,attr);
2078 if (STRCASEEQ('a','A',"align",name)) {
2079 /*----------------------------------------------------------------------*/
2081 /*----------------------------------------------------------------------*/
2082 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2088 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2089 /*----------------------------------------------------------------------*/
2091 /*----------------------------------------------------------------------*/
2096 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2097 /*----------------------------------------------------------------------*/
2099 /*----------------------------------------------------------------------*/
2104 else if (STRCASEEQ('n','N',"noshade",name)) {
2105 /*----------------------------------------------------------------------*/
2107 /*----------------------------------------------------------------------*/
2110 else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2111 /*----------------------------------------------------------------------*/
2113 /*----------------------------------------------------------------------*/
2125 * It is a handler who processes the HR tag.
2127 * @param jxhtml [i/o] The pointer to the CHTML structure at the output
2128 * destination is specified.
2129 * @param node [i] The HR tag node is specified.
2130 * @return The conversion result is returned.
2133 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2135 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2141 * It is a handler who processes the IMG tag.
2143 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2144 * destination is specified.
2145 * @param node [i] The IMG tag node is specified.
2146 * @return The conversion result is returned.
2149 s_jxhtml_start_img_tag(void *pdoc, Node *node)
2151 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2152 Doc *doc = jxhtml->doc;
2153 request_rec *r = doc->r;
2155 #ifndef IMG_NOT_CONVERT_FILENAME
2156 device_table *spec = jxhtml->spec;
2161 /*--------------------------------------------------------------------------*/
2162 /* Get Attributes */
2163 /*--------------------------------------------------------------------------*/
2164 for (attr = qs_get_attr(doc,node);
2166 attr = qs_get_next_attr(doc,attr)) {
2167 char *name = qs_get_attr_name(doc,attr);
2168 char *value = qs_get_attr_value(doc,attr);
2169 if (STRCASEEQ('s','S',"src",name)) {
2170 /*----------------------------------------------------------------------*/
2172 /*----------------------------------------------------------------------*/
2173 #ifdef IMG_NOT_CONVERT_FILENAME
2174 value = chxj_encoding_parameter(r, value);
2175 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2176 value = chxj_add_cookie_no_update_parameter(r, value);
2181 value = chxj_img_conv(r, spec, value);
2182 value = chxj_encoding_parameter(r, value);
2183 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2184 value = chxj_add_cookie_no_update_parameter(r, value);
2190 else if (STRCASEEQ('a','A',"align",name)) {
2191 /*----------------------------------------------------------------------*/
2193 /*----------------------------------------------------------------------*/
2195 if (STRCASEEQ('t','T',"top", value) ||
2196 STRCASEEQ('m','M',"middle",value) ||
2197 STRCASEEQ('b','B',"bottom",value) ||
2198 STRCASEEQ('l','L',"left", value) ||
2199 STRCASEEQ('r','R',"right", value)) {
2204 else if (STRCASEEQ('c','C',"center",value)) {
2211 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2212 /*----------------------------------------------------------------------*/
2214 /*----------------------------------------------------------------------*/
2219 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2220 /*----------------------------------------------------------------------*/
2222 /*----------------------------------------------------------------------*/
2227 else if (STRCASEEQ('h','H',"hspace",name)) {
2228 /*----------------------------------------------------------------------*/
2230 /*----------------------------------------------------------------------*/
2233 else if (STRCASEEQ('v','V',"vspace",name)) {
2234 /*----------------------------------------------------------------------*/
2236 /*----------------------------------------------------------------------*/
2239 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2240 /*----------------------------------------------------------------------*/
2242 /*----------------------------------------------------------------------*/
2258 * It is a handler who processes the IMG tag.
2260 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2261 * destination is specified.
2262 * @param node [i] The IMG tag node is specified.
2263 * @return The conversion result is returned.
2266 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
2268 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2274 * It is a handler who processes the SELECT tag.
2276 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2277 * destination is specified.
2278 * @param node [i] The SELECT tag node is specified.
2279 * @return The conversion result is returned.
2282 s_jxhtml_start_select_tag(void *pdoc, Node *child)
2284 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2285 Doc *doc = jxhtml->doc;
2289 char *multiple = NULL;
2292 for (attr = qs_get_attr(doc,child);
2294 attr = qs_get_next_attr(doc,attr)) {
2295 char *nm = qs_get_attr_name(doc,attr);
2296 char *val = qs_get_attr_value(doc,attr);
2297 if (STRCASEEQ('s','S',"size",nm)) {
2298 /*----------------------------------------------------------------------*/
2299 /* CHTML 1.0 version 2.0 */
2300 /*----------------------------------------------------------------------*/
2301 size = apr_pstrdup(doc->buf.pool, val);
2303 else if (STRCASEEQ('n','N',"name",nm)) {
2304 /*----------------------------------------------------------------------*/
2305 /* CHTML 1.0 version 2.0 */
2306 /*----------------------------------------------------------------------*/
2307 name = apr_pstrdup(doc->buf.pool, val);
2309 else if (STRCASEEQ('m','M',"multiple", nm)) {
2310 /*----------------------------------------------------------------------*/
2311 /* CHTML 1.0 version 2.0 */
2312 /*----------------------------------------------------------------------*/
2313 multiple = apr_pstrdup(doc->buf.pool, val);
2316 if (size && *size) {
2321 if (name && *name) {
2335 * It is a handler who processes the SELECT tag.
2337 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2338 * destination is specified.
2339 * @param node [i] The SELECT tag node is specified.
2340 * @return The conversion result is returned.
2343 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2345 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2346 Doc *doc = jxhtml->doc;
2353 * It is a handler who processes the OPTION tag.
2355 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2356 * destination is specified.
2357 * @param node [i] The OPTION tag node is specified.
2358 * @return The conversion result is returned.
2361 s_jxhtml_start_option_tag(void *pdoc, Node *child)
2363 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2364 Doc *doc = jxhtml->doc;
2367 char *selected = NULL;
2371 for (attr = qs_get_attr(doc,child);
2373 attr = qs_get_next_attr(doc,attr)) {
2374 char *nm = qs_get_attr_name(doc,attr);
2375 char *val = qs_get_attr_value(doc,attr);
2376 if (STRCASEEQ('s','S',"selected",nm)) {
2377 /*----------------------------------------------------------------------*/
2378 /* CHTML 1.0 version 2.0 */
2379 /*----------------------------------------------------------------------*/
2380 selected = apr_pstrdup(doc->buf.pool, val);
2382 else if (STRCASEEQ('v','V',"value",nm)) {
2383 /*----------------------------------------------------------------------*/
2384 /* CHTML 1.0 version 2.0 */
2385 /*----------------------------------------------------------------------*/
2386 value = apr_pstrdup(doc->buf.pool, val);
2403 * It is a handler who processes the OPTION tag.
2405 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2406 * destination is specified.
2407 * @param node [i] The OPTION tag node is specified.
2408 * @return The conversion result is returned.
2411 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2413 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2414 Doc *doc = jxhtml->doc;
2421 * It is a handler who processes the DIV tag.
2423 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2424 * destination is specified.
2425 * @param node [i] The DIV tag node is specified.
2426 * @return The conversion result is returned.
2429 s_jxhtml_start_div_tag(void *pdoc, Node *child)
2437 jxhtml = GET_JXHTML(pdoc);
2442 for (attr = qs_get_attr(doc,child);
2444 attr = qs_get_next_attr(doc,attr)) {
2445 char *nm = qs_get_attr_name(doc,attr);
2446 char *val = qs_get_attr_value(doc,attr);
2447 if (STRCASEEQ('a','A',"align",nm)) {
2448 /*----------------------------------------------------------------------*/
2449 /* CHTML 1.0 (W3C version 3.2) */
2450 /*----------------------------------------------------------------------*/
2451 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2452 align = apr_pstrdup(doc->buf.pool, val);
2467 * It is a handler who processes the DIV tag.
2469 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2470 * destination is specified.
2471 * @param node [i] The DIV tag node is specified.
2472 * @return The conversion result is returned.
2475 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2481 jxhtml = GET_JXHTML(pdoc);
2491 s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s)
2497 case '1': return apr_psprintf(p, "hiragana");
2498 case '2': return apr_psprintf(p, "hankakukana");
2499 case '3': return apr_psprintf(p, "alphabet");
2500 case '4': return apr_psprintf(p, "numeric");
2502 tmp = apr_palloc(p, 1);
2504 return apr_pstrdup(p, tmp);
2508 tmp = apr_palloc(p, 1);
2510 return apr_pstrdup(p,tmp);
2515 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
2522 jxhtml = GET_JXHTML(pdoc);
2526 for (child = qs_get_child_node(doc, node);
2528 child = qs_get_next_node(doc, child)) {
2530 s_jxhtml_chxjif_tag(jxhtml, child);
2537 * It is a handler who processes the TEXTARE tag.
2539 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2540 * destination is specified.
2541 * @param node [i] The TEXTAREA tag node is specified.
2542 * @return The conversion result is returned.
2545 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
2552 jxhtml = GET_JXHTML(pdoc);
2556 jxhtml->textarea_flag++;
2558 for (attr = qs_get_attr(doc,node);
2560 attr = qs_get_next_attr(doc,attr)) {
2561 char *name = qs_get_attr_name(doc,attr);
2562 char *value = qs_get_attr_value(doc,attr);
2563 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2564 W_L(" accesskey=\"");
2568 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2569 char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,value);
2574 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2579 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2584 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2596 * It is a handler who processes the TEXTAREA tag.
2598 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2599 * destination is specified.
2600 * @param node [i] The TEXTAREA tag node is specified.
2601 * @return The conversion result is returned.
2604 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
2610 jxhtml = GET_JXHTML(pdoc);
2615 jxhtml->textarea_flag--;
2622 * It is a handler who processes the B tag.
2624 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2625 * destination is specified.
2626 * @param node [i] The B tag node is specified.
2627 * @return The conversion result is returned.
2630 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
2636 jxhtml = GET_JXHTML(pdoc);
2646 * It is a handler who processes the B tag.
2648 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2649 * destination is specified.
2650 * @param node [i] The B tag node is specified.
2651 * @return The conversion result is returned.
2654 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
2656 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
2657 Doc* doc = jxhtml->doc;
2664 s_jxhtml_text_tag(void* pdoc, Node* child)
2675 apr_size_t z2h_input_len;
2677 jxhtml = GET_JXHTML(pdoc);
2681 textval = qs_get_node_value(doc,child);
2682 if (strlen(textval) == 0) {
2686 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2687 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2689 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
2690 memset(one_byte, 0, sizeof(one_byte));
2693 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2695 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
2697 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2702 if (is_sjis_kanji(textval[ii])) {
2703 one_byte[0] = textval[ii+0];
2704 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2705 one_byte[0] = textval[ii+1];
2706 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2710 if (jxhtml->pre_flag) {
2711 one_byte[0] = textval[ii+0];
2712 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2715 if (jxhtml->textarea_flag) {
2716 one_byte[0] = textval[ii+0];
2717 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2720 if (textval[ii] != '\r' && textval[ii] != '\n') {
2721 one_byte[0] = textval[ii+0];
2722 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2726 z2h_input_len = strlen(tdst);
2727 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, jxhtml->entryp);
2735 * It is a handler who processes the BLOCKQUOTE tag.
2737 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2738 * destination is specified.
2739 * @param node [i] The BLOCKQUOTE tag node is specified.
2740 * @return The conversion result is returned.
2743 s_jxhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2745 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2746 Doc *doc = jxhtml->doc;
2747 W_L("<blockquote>");
2753 * It is a handler who processes the BLOCKQUOTE tag.
2755 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2756 * destination is specified.
2757 * @param node [i] The BLOCKQUOTE tag node is specified.
2758 * @return The conversion result is returned.
2761 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2763 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2764 Doc *doc = jxhtml->doc;
2765 W_L("</blockquote>");
2771 * It is a handler who processes the DIR tag.
2773 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2774 * destination is specified.
2775 * @param node [i] The DIR tag node is specified.
2776 * @return The conversion result is returned.
2779 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
2781 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2782 Doc *doc = jxhtml->doc;
2785 for (attr = qs_get_attr(doc,node);
2787 attr = qs_get_next_attr(doc,attr)) {
2788 char *name = qs_get_attr_name(doc,attr);
2789 char *value = qs_get_attr_value(doc,attr);
2790 if (STRCASEEQ('t','T',"type",name)) {
2791 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2804 * It is a handler who processes the DIR tag.
2806 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2807 * destination is specified.
2808 * @param node [i] The DIR tag node is specified.
2809 * @return The conversion result is returned.
2812 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2814 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2815 Doc *doc = jxhtml->doc;
2822 * It is a handler who processes the DL tag.
2824 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2825 * destination is specified.
2826 * @param node [i] The DL tag node is specified.
2827 * @return The conversion result is returned.
2830 s_jxhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2832 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2833 Doc *doc = jxhtml->doc;
2840 * It is a handler who processes the DL tag.
2842 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2843 * destination is specified.
2844 * @param node [i] The DL tag node is specified.
2845 * @return The conversion result is returned.
2848 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2850 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2851 Doc *doc = jxhtml->doc;
2858 * It is a handler who processes the DT tag.
2860 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2861 * destination is specified.
2862 * @param node [i] The DT tag node is specified.
2863 * @return The conversion result is returned.
2866 s_jxhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2868 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2869 Doc *doc = jxhtml->doc;
2876 * It is a handler who processes the DT tag.
2878 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2879 * destination is specified.
2880 * @param node [i] The DT tag node is specified.
2881 * @return The conversion result is returned.
2884 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2886 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2892 * It is a handler who processes the DD tag.
2894 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2895 * destination is specified.
2896 * @param node [i] The DD tag node is specified.
2897 * @return The conversion result is returned.
2900 s_jxhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2902 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2903 Doc *doc = jxhtml->doc;
2910 * It is a handler who processes the DD tag.
2912 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2913 * destination is specified.
2914 * @param node [i] The DD tag node is specified.
2915 * @return The conversion result is returned.
2918 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2920 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2926 * It is a handler who processes the H1 tag.
2928 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2929 * destination is specified.
2930 * @param node [i] The H1 tag node is specified.
2931 * @return The conversion result is returned.
2934 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
2942 jxhtml = GET_JXHTML(pdoc);
2946 for (attr = qs_get_attr(doc,node);
2948 attr = qs_get_next_attr(doc,attr)) {
2949 char *name = qs_get_attr_name(doc,attr);
2950 char *value = qs_get_attr_value(doc,attr);
2951 if (STRCASEEQ('a','A',"align", name)) {
2952 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2953 jxhtml->h1_align_flag++;
2954 align = apr_pstrdup(doc->buf.pool, value);
2960 W_L("<div align=\"");
2969 * It is a handler who processes the H1 tag.
2971 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2972 * destination is specified.
2973 * @param node [i] The H1 tag node is specified.
2974 * @return The conversion result is returned.
2977 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
2983 jxhtml = GET_JXHTML(pdoc);
2987 if (jxhtml->h1_align_flag) {
2988 jxhtml->h1_align_flag--;
2996 * It is a handler who processes the H2 tag.
2998 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2999 * destination is specified.
3000 * @param node [i] The H1 tag node is specified.
3001 * @return The conversion result is returned.
3004 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
3012 jxhtml = GET_JXHTML(pdoc);
3016 for (attr = qs_get_attr(doc,node);
3018 attr = qs_get_next_attr(doc,attr)) {
3019 char *name = qs_get_attr_name(doc,attr);
3020 char *value = qs_get_attr_value(doc,attr);
3021 if (STRCASEEQ('a','A',"align", name)) {
3022 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3023 jxhtml->h2_align_flag++;
3024 align = apr_pstrdup(doc->buf.pool, value);
3030 W_L("<div align=\"");
3039 * It is a handler who processes the H2 tag.
3041 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3042 * destination is specified.
3043 * @param node [i] The H1 tag node is specified.
3044 * @return The conversion result is returned.
3047 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
3053 jxhtml = GET_JXHTML(pdoc);
3057 if (jxhtml->h2_align_flag) {
3058 jxhtml->h2_align_flag--;
3066 * It is a handler who processes the H3 tag.
3068 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3069 * destination is specified.
3070 * @param node [i] The H1 tag node is specified.
3071 * @return The conversion result is returned.
3074 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
3082 jxhtml = GET_JXHTML(pdoc);
3086 for (attr = qs_get_attr(doc,node);
3088 attr = qs_get_next_attr(doc,attr)) {
3091 name = qs_get_attr_name(doc,attr);
3092 value = qs_get_attr_value(doc,attr);
3093 if (STRCASEEQ('a','A',"align", name)) {
3094 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3095 jxhtml->h3_align_flag++;
3096 align = apr_pstrdup(doc->buf.pool, value);
3102 W_L("<div align=\"");
3111 * It is a handler who processes the H3 tag.
3113 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3114 * destination is specified.
3115 * @param node [i] The H1 tag node is specified.
3116 * @return The conversion result is returned.
3119 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
3125 jxhtml = GET_JXHTML(pdoc);
3129 if (jxhtml->h3_align_flag) {
3130 jxhtml->h3_align_flag--;
3138 * It is a handler who processes the H4 tag.
3140 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3141 * destination is specified.
3142 * @param node [i] The H1 tag node is specified.
3143 * @return The conversion result is returned.
3146 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
3154 jxhtml = GET_JXHTML(pdoc);
3158 for (attr = qs_get_attr(doc,node);
3160 attr = qs_get_next_attr(doc,attr)) {
3161 char *name = qs_get_attr_name(doc,attr);
3162 char *value = qs_get_attr_value(doc,attr);
3163 if (STRCASEEQ('a','A',"align", name)) {
3164 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3165 jxhtml->h4_align_flag++;
3166 align = apr_pstrdup(doc->buf.pool, value);
3172 W_L("<div align=\"");
3181 * It is a handler who processes the H4 tag.
3183 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3184 * destination is specified.
3185 * @param node [i] The H1 tag node is specified.
3186 * @return The conversion result is returned.
3189 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
3195 jxhtml = GET_JXHTML(pdoc);
3199 if (jxhtml->h4_align_flag) {
3200 jxhtml->h4_align_flag--;
3208 * It is a handler who processes the H5 tag.
3210 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3211 * destination is specified.
3212 * @param node [i] The H1 tag node is specified.
3213 * @return The conversion result is returned.
3216 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
3224 jxhtml = GET_JXHTML(pdoc);
3228 for (attr = qs_get_attr(doc,node);
3230 attr = qs_get_next_attr(doc,attr)) {
3231 char *name = qs_get_attr_name(doc,attr);
3232 char *value = qs_get_attr_value(doc,attr);
3233 if (STRCASEEQ('a','A',"align", name)) {
3234 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3235 jxhtml->h5_align_flag++;
3236 align = apr_pstrdup(doc->buf.pool, value);
3242 W_L("<div align=\"");
3251 * It is a handler who processes the H5 tag.
3253 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3254 * destination is specified.
3255 * @param node [i] The H1 tag node is specified.
3256 * @return The conversion result is returned.
3259 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
3265 jxhtml = GET_JXHTML(pdoc);
3269 if (jxhtml->h5_align_flag) {
3270 jxhtml->h5_align_flag--;
3278 * It is a handler who processes the H6 tag.
3280 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3281 * destination is specified.
3282 * @param node [i] The H1 tag node is specified.
3283 * @return The conversion result is returned.
3286 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
3294 jxhtml = GET_JXHTML(pdoc);
3298 for (attr = qs_get_attr(doc,node);
3300 attr = qs_get_next_attr(doc,attr)) {
3301 char *name = qs_get_attr_name(doc,attr);
3302 char *value = qs_get_attr_value(doc,attr);
3303 if (STRCASEEQ('a','A',"align", name)) {
3304 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3305 jxhtml->h6_align_flag++;
3306 align = apr_pstrdup(doc->buf.pool, value);
3312 W_L("<div align=\"");
3321 * It is a handler who processes the H6 tag.
3323 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3324 * destination is specified.
3325 * @param node [i] The H1 tag node is specified.
3326 * @return The conversion result is returned.
3329 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
3335 jxhtml = GET_JXHTML(pdoc);
3339 if (jxhtml->h6_align_flag) {
3340 jxhtml->h6_align_flag--;
3348 * It is a handler who processes the MENU tag.
3350 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3351 * destination is specified.
3352 * @param node [i] The MENU tag node is specified.
3353 * @return The conversion result is returned.
3356 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
3358 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3359 Doc *doc = jxhtml->doc;
3362 /*--------------------------------------------------------------------------*/
3363 /* Get Attributes */
3364 /*--------------------------------------------------------------------------*/
3365 for (attr = qs_get_attr(doc,node);
3367 attr = qs_get_next_attr(doc,attr)) {
3368 char *name = qs_get_attr_name(doc,attr);
3369 char *value = qs_get_attr_value(doc,attr);
3370 if (STRCASEEQ('t','T',"type",name)) {
3371 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3384 * It is a handler who processes the MENU tag.
3386 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3387 * destination is specified.
3388 * @param node [i] The MENU tag node is specified.
3389 * @return The conversion result is returned.
3392 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3394 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3395 Doc *doc = jxhtml->doc;
3402 * It is a handler who processes the PLAINTEXT tag.
3404 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3405 * destination is specified.
3406 * @param node [i] The PLAINTEXT tag node is specified.
3407 * @return The conversion result is returned.
3410 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
3415 jxhtml = GET_JXHTML(pdoc);
3418 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
3423 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3428 jxhtml = GET_JXHTML(pdoc);
3430 for (child = qs_get_child_node(doc, node);
3432 child = qs_get_next_node(doc, child)) {
3434 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
3441 * It is a handler who processes the PLAINTEXT tag.
3443 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3444 * destination is specified.
3445 * @param node [i] The PLAINTEXT tag node is specified.
3446 * @return The conversion result is returned.
3449 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3451 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3457 * It is a handler who processes the BLINK tag.
3459 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3460 * destination is specified.
3461 * @param node [i] The BLINK tag node is specified.
3462 * @return The conversion result is returned.
3465 s_jxhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3467 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3468 Doc *doc = jxhtml->doc;
3475 * It is a handler who processes the BLINK tag.
3477 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3478 * destination is specified.
3479 * @param node [i] The BLINK tag node is specified.
3480 * @return The conversion result is returned.
3483 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3485 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3486 Doc *doc = jxhtml->doc;
3493 * It is a handler who processes the MARQUEE tag.
3495 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3496 * destination is specified.
3497 * @param node [i] The MARQUEE tag node is specified.
3498 * @return The conversion result is returned.
3501 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
3503 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3504 Doc *doc = jxhtml->doc;
3507 /*--------------------------------------------------------------------------*/
3508 /* Get Attributes */
3509 /*--------------------------------------------------------------------------*/
3510 for (attr = qs_get_attr(doc,node);
3512 attr = qs_get_next_attr(doc,attr)) {
3513 char *name = qs_get_attr_name(doc,attr);
3514 char *value = qs_get_attr_value(doc,attr);
3515 if (STRCASEEQ('d','D',"direction", name)) {
3516 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3517 W_L(" direction=\"");
3522 else if (STRCASEEQ('b','B',"behavior",name)) {
3525 else if (STRCASEEQ('l','L',"loop",name)) {
3528 else if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
3540 * It is a handler who processes the MARQUEE tag.
3542 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3543 * destination is specified.
3544 * @param node [i] The MARQUEE tag node is specified.
3545 * @return The conversion result is returned.
3548 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3550 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3551 Doc *doc = jxhtml->doc;
3558 * It is handler who processes the New Line Code.
3561 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3563 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3564 Doc *doc = jxhtml->doc;