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_table_tag (void *pdoc, Node *node);
66 static char *s_jxhtml_end_table_tag (void *pdoc, Node *node);
67 static char *s_jxhtml_start_tr_tag (void *pdoc, Node *node);
68 static char *s_jxhtml_end_tr_tag (void *pdoc, Node *node);
69 static char *s_jxhtml_start_td_tag (void *pdoc, Node *node);
70 static char *s_jxhtml_end_td_tag (void *pdoc, Node *node);
71 static char *s_jxhtml_start_font_tag (void *pdoc, Node *node);
72 static char *s_jxhtml_end_font_tag (void *pdoc, Node *node);
73 static char *s_jxhtml_start_form_tag (void *pdoc, Node *node);
74 static char *s_jxhtml_end_form_tag (void *pdoc, Node *node);
75 static char *s_jxhtml_start_input_tag (void *pdoc, Node *node);
76 static char *s_jxhtml_end_input_tag (void *pdoc, Node *node);
77 static char *s_jxhtml_start_center_tag (void *pdoc, Node *node);
78 static char *s_jxhtml_end_center_tag (void *pdoc, Node *node);
79 static char *s_jxhtml_start_hr_tag (void *pdoc, Node *node);
80 static char *s_jxhtml_end_hr_tag (void *pdoc, Node *node);
81 static char *s_jxhtml_start_img_tag (void *pdoc, Node *node);
82 static char *s_jxhtml_end_img_tag (void *pdoc, Node *node);
83 static char *s_jxhtml_start_select_tag (void *pdoc, Node *node);
84 static char *s_jxhtml_end_select_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_start_option_tag (void *pdoc, Node *node);
86 static char *s_jxhtml_end_option_tag (void *pdoc, Node *node);
87 static char *s_jxhtml_start_div_tag (void *pdoc, Node *node);
88 static char *s_jxhtml_end_div_tag (void *pdoc, Node *node);
89 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
90 static char *s_jxhtml_end_textarea_tag (void *pdoc, Node *node);
91 static char *s_jxhtml_start_b_tag (void *pdoc, Node *node);
92 static char *s_jxhtml_end_b_tag (void *pdoc, Node *node);
93 static char *s_jxhtml_chxjif_tag (void *pdoc, Node *node);
94 static char *s_jxhtml_text_tag (void *pdoc, Node *node);
95 static char *s_jxhtml_start_blockquote_tag (void *pdoc, Node *node);
96 static char *s_jxhtml_end_blockquote_tag (void *pdoc, Node *node);
97 static char *s_jxhtml_start_dir_tag (void *pdoc, Node *node);
98 static char *s_jxhtml_end_dir_tag (void *pdoc, Node *node);
99 static char *s_jxhtml_start_dl_tag (void *pdoc, Node *node);
100 static char *s_jxhtml_end_dl_tag (void *pdoc, Node *node);
101 static char *s_jxhtml_start_dt_tag (void *pdoc, Node *node);
102 static char *s_jxhtml_end_dt_tag (void *pdoc, Node *node);
103 static char *s_jxhtml_start_dd_tag (void *pdoc, Node *node);
104 static char *s_jxhtml_end_dd_tag (void *pdoc, Node *node);
105 static char *s_jxhtml_start_h1_tag (void *pdoc, Node *node);
106 static char *s_jxhtml_end_h1_tag (void *pdoc, Node *node);
107 static char *s_jxhtml_start_h2_tag (void *pdoc, Node *node);
108 static char *s_jxhtml_end_h2_tag (void *pdoc, Node *node);
109 static char *s_jxhtml_start_h3_tag (void *pdoc, Node *node);
110 static char *s_jxhtml_end_h3_tag (void *pdoc, Node *node);
111 static char *s_jxhtml_start_h4_tag (void *pdoc, Node *node);
112 static char *s_jxhtml_end_h4_tag (void *pdoc, Node *node);
113 static char *s_jxhtml_start_h5_tag (void *pdoc, Node *node);
114 static char *s_jxhtml_end_h5_tag (void *pdoc, Node *node);
115 static char *s_jxhtml_start_h6_tag (void *pdoc, Node *node);
116 static char *s_jxhtml_end_h6_tag (void *pdoc, Node *node);
117 static char *s_jxhtml_start_menu_tag (void *pdoc, Node *node);
118 static char *s_jxhtml_end_menu_tag (void *pdoc, Node *node);
119 static char *s_jxhtml_start_plaintext_tag (void *pdoc, Node *node);
120 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
121 static char *s_jxhtml_end_plaintext_tag (void *pdoc, Node *node);
122 static char *s_jxhtml_start_blink_tag (void *pdoc, Node *node);
123 static char *s_jxhtml_end_blink_tag (void *pdoc, Node *node);
124 static char *s_jxhtml_start_marquee_tag (void *pdoc, Node *node);
125 static char *s_jxhtml_end_marquee_tag (void *pdoc, Node *node);
126 static char *s_jxhtml_newline_mark (void *pdoc, Node *node);
127 static char *s_jxhtml_link_tag (void *pdoc, Node *node);
128 static char *s_jxhtml_start_span_tag (void *pdoc, Node *node);
129 static char *s_jxhtml_end_span_tag (void *pdoc, Node *node);
130 static char *s_jxhtml_style_tag (void *pdoc, Node *node);
132 static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
134 static int s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
136 static css_prop_list_t *s_jxhtml_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
137 static css_prop_list_t *s_jxhtml_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
141 tag_handler jxhtml_handler[] = {
144 s_jxhtml_start_html_tag,
145 s_jxhtml_end_html_tag,
149 s_jxhtml_start_meta_tag,
150 s_jxhtml_end_meta_tag,
154 s_jxhtml_start_textarea_tag,
155 s_jxhtml_end_textarea_tag,
159 s_jxhtml_start_p_tag,
164 s_jxhtml_start_pre_tag,
165 s_jxhtml_end_pre_tag,
169 s_jxhtml_start_ul_tag,
174 s_jxhtml_start_li_tag,
179 s_jxhtml_start_ol_tag,
184 s_jxhtml_start_h1_tag,
189 s_jxhtml_start_h2_tag,
194 s_jxhtml_start_h3_tag,
199 s_jxhtml_start_h4_tag,
204 s_jxhtml_start_h5_tag,
209 s_jxhtml_start_h6_tag,
214 s_jxhtml_start_head_tag,
215 s_jxhtml_end_head_tag,
219 s_jxhtml_start_title_tag,
220 s_jxhtml_end_title_tag,
224 s_jxhtml_start_base_tag,
225 s_jxhtml_end_base_tag,
229 s_jxhtml_start_body_tag,
230 s_jxhtml_end_body_tag,
234 s_jxhtml_start_a_tag,
239 s_jxhtml_start_br_tag,
244 s_jxhtml_start_table_tag,
245 s_jxhtml_end_table_tag,
249 s_jxhtml_start_tr_tag,
254 s_jxhtml_start_td_tag,
264 s_jxhtml_start_font_tag,
265 s_jxhtml_end_font_tag,
269 s_jxhtml_start_form_tag,
270 s_jxhtml_end_form_tag,
274 s_jxhtml_start_input_tag,
275 s_jxhtml_end_input_tag,
279 s_jxhtml_start_center_tag,
280 s_jxhtml_end_center_tag,
284 s_jxhtml_start_hr_tag,
289 s_jxhtml_start_img_tag,
290 s_jxhtml_end_img_tag,
294 s_jxhtml_start_select_tag,
295 s_jxhtml_end_select_tag,
299 s_jxhtml_start_option_tag,
300 s_jxhtml_end_option_tag,
304 s_jxhtml_start_div_tag,
305 s_jxhtml_end_div_tag,
334 s_jxhtml_start_span_tag,
335 s_jxhtml_end_span_tag,
349 s_jxhtml_start_b_tag,
359 s_jxhtml_start_dt_tag,
374 s_jxhtml_start_blockquote_tag,
375 s_jxhtml_end_blockquote_tag,
379 s_jxhtml_start_dir_tag,
380 s_jxhtml_end_dir_tag,
384 s_jxhtml_start_dl_tag,
389 s_jxhtml_start_dd_tag,
394 s_jxhtml_start_menu_tag,
395 s_jxhtml_end_menu_tag,
399 s_jxhtml_start_plaintext_tag,
400 s_jxhtml_end_plaintext_tag,
404 s_jxhtml_start_blink_tag,
405 s_jxhtml_end_blink_tag,
409 s_jxhtml_start_marquee_tag,
410 s_jxhtml_end_marquee_tag,
419 s_jxhtml_newline_mark,
426 * converts from CHTML5.0 to JXHTML.
428 * @param r [i] Requet_rec is appointed.
429 * @param spec [i] The result of the device specification processing which
430 * was done in advance is appointed.
431 * @param src [i] The character string before the converting is appointed.
432 * @return The character string after the converting is returned.
441 chxjconvrule_entry *entryp,
452 /*--------------------------------------------------------------------------*/
454 /*--------------------------------------------------------------------------*/
456 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
458 DBG(r,"I found qrcode xml");
461 DBG(r,"not found qrcode xml");
463 /*--------------------------------------------------------------------------*/
464 /* The CHTML structure is initialized. */
465 /*--------------------------------------------------------------------------*/
466 s_init_jxhtml(&jxhtml, &doc, r, spec);
468 jxhtml.entryp = entryp;
469 jxhtml.cookie = cookie;
471 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
473 /*--------------------------------------------------------------------------*/
474 /* The character string of the input is analyzed. */
475 /*--------------------------------------------------------------------------*/
476 qs_init_malloc(&doc);
477 qs_init_root_node(&doc);
479 ss = apr_pcalloc(r->pool, srclen + 1);
481 memset(ss, 0, srclen + 1);
482 memcpy(ss, src, srclen);
484 if (IS_CSS_ON(jxhtml.entryp)) {
485 /* current property list */
486 jxhtml.css_prop_stack = chxj_new_prop_list_stack(&doc);
489 chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
492 qs_parse_string(&doc,ss,strlen(ss));
494 chxj_buffered_write_init(r->pool, &doc.buf);
495 /*--------------------------------------------------------------------------*/
496 /* It converts it from CHTML to JXHTML. */
497 /*--------------------------------------------------------------------------*/
498 chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
499 jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
500 dst = apr_pstrdup(r->pool, jxhtml.out);
501 chxj_buffered_write_terminate(&doc.buf);
504 qs_all_free(&doc,QX_LOGMARK);
507 return apr_pstrdup(r->pool,ss);
510 dst = apr_psprintf(r->pool, "\n");
512 *dstlen = strlen(dst);
515 chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
523 * The JXHTML structure is initialized.
525 * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
526 * initialized is specified.
527 * @param doc [i] The Doc structure that should be set to the initialized
528 * JXHTML structure is specified.
529 * @param r [i] To use POOL, the pointer to request_rec is specified.
530 * @param spec [i] The pointer to the device_table
533 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
535 memset(doc, 0, sizeof(Doc));
536 memset(jxhtml, 0, sizeof(jxhtml_t));
541 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
542 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
543 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
548 * Corresponding EMOJI to a current character-code is retrieved.
549 * The substitution character string is stored in the rslt pointer if agreeing.
551 * @param jxhtml [i] The pointer to the JXHTML structure is specified.
552 * @param txt [i] The character string to want to examine whether it is
553 * EMOJI is specified.
554 * @param rslt [o] The pointer to the pointer that stores the result is
556 * @return When corresponding EMOJI exists, it returns it excluding 0.
559 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
571 if (! spec) DBG(r,"spec is NULL");
573 for (ee = jxhtml->conf->emoji;
577 unsigned char hex1byte;
578 unsigned char hex2byte;
581 DBG(r,"emoji->imode is NULL");
585 hex1byte = ee->imode->hex1byte & 0xff;
586 hex2byte = ee->imode->hex2byte & 0xff;
588 if (ee->imode->string
589 && strlen(ee->imode->string) > 0
590 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
591 if (spec == NULL || spec->emoji_type == NULL) {
592 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
593 return strlen(ee->imode->string);
600 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
601 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
602 if (spec == NULL || spec->emoji_type == NULL) {
603 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
616 chxj_jxhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
630 DBG(r, "REQ[%X] start chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
631 memset(doc, 0, sizeof(Doc));
632 memset(jxhtml, 0, sizeof(jxhtml_t));
637 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
638 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
639 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
641 apr_pool_create(&pool, r->pool);
643 chxj_buffered_write_init(pool, &doc->buf);
645 for (ii=0; ii<len; ii++) {
649 rtn = s_jxhtml_search_emoji(jxhtml, (char *)&src[ii], &out);
656 if (is_sjis_kanji(src[ii])) {
657 two_byte[0] = src[ii+0];
658 two_byte[1] = src[ii+1];
664 one_byte[0] = src[ii+0];
669 jxhtml->out = chxj_buffered_write_flush(jxhtml->out, &doc->buf);
671 DBG(r, "REQ[%X] end chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
677 * It is a handler who processes the HTML tag.
679 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
680 * destination is specified.
681 * @param node [i] The HTML tag node is specified.
682 * @return The conversion result is returned.
685 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
692 jxhtml = GET_JXHTML(pdoc);
695 DBG(r, "REQ[%X] start s_jxhtml_start_html_tag()", TO_ADDR(r));
697 W_L("<?xml version=\"1.0\" encoding=\"Shift_JIS\" ?>");
699 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"xhtml-basic10-plus.dtd\">");
702 /*--------------------------------------------------------------------------*/
704 /*--------------------------------------------------------------------------*/
705 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"ja\" xml:lang=\"ja\">");
707 jxhtml->start_html_flag = 1;
709 DBG(r, "REQ[%X] end s_jxhtml_start_html_tag()", TO_ADDR(r));
716 * It is a handler who processes the HTML tag.
718 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
719 * destination is specified.
720 * @param node [i] The HTML tag node is specified.
721 * @return The conversion result is returned.
724 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
726 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
727 Doc *doc = jxhtml->doc;
736 * It is a handler who processes the META tag.
738 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
739 * destination is specified.
740 * @param node [i] The META tag node is specified.
741 * @return The conversion result is returned.
744 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
750 int content_type_flag;
753 jxhtml = GET_JXHTML(pdoc);
757 content_type_flag = 0;
760 /*--------------------------------------------------------------------------*/
762 /*--------------------------------------------------------------------------*/
763 for (attr = qs_get_attr(doc,node);
765 attr = qs_get_next_attr(doc,attr)) {
766 char *name = qs_get_attr_name(doc,attr);
767 char *value = qs_get_attr_value(doc,attr);
771 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
772 /*----------------------------------------------------------------------*/
774 /*----------------------------------------------------------------------*/
775 W_L(" http-equiv=\"");
778 if (STRCASEEQ('c','C',"content-type",value)) {
779 content_type_flag = 1;
781 if (STRCASEEQ('r','R',"refresh",value)) {
789 if (strcasecmp(name, "content") == 0 && value && *value) {
790 /*----------------------------------------------------------------------*/
792 /*----------------------------------------------------------------------*/
793 if (content_type_flag) {
797 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
806 buf = apr_pstrdup(r->pool, value);
808 url = strchr(buf, ';');
810 sec = apr_pstrdup(r->pool, buf);
813 url = chxj_encoding_parameter(r, url, 1);
834 if (strcasecmp(name, "name") == 0 && value && *value) {
850 * It is a handler who processes the META tag.
852 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
853 * destination is specified.
854 * @param node [i] The META tag node is specified.
855 * @return The conversion result is returned.
858 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
860 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
867 * It is a handler who processes the HEAD tag.
869 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
870 * destination is specified.
871 * @param node [i] The HEAD tag node is specified.
872 * @return The conversion result is returned.
875 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
881 jxhtml = GET_JXHTML(pdoc);
891 * It is a handler who processes the HEAD tag.
893 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
894 * destination is specified.
895 * @param node [i] The HEAD tag node is specified.
896 * @return The conversion result is returned.
899 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
905 jxhtml = GET_JXHTML(pdoc);
915 * It is a handler who processes the TITLE tag.
917 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
918 * destination is specified.
919 * @param node [i] The TITLE tag node is specified.
920 * @return The conversion result is returned.
923 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
929 jxhtml = GET_JXHTML(pdoc);
939 * It is a handler who processes the TITLE tag.
941 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
942 * destination is specified.
943 * @param node [i] The TITLE tag node is specified.
944 * @return The conversion result is returned.
947 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
953 jxhtml = GET_JXHTML(pdoc);
963 * It is a handler who processes the BASE tag.
965 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
966 * destination is specified.
967 * @param node [i] The BASE tag node is specified.
968 * @return The conversion result is returned.
971 s_jxhtml_start_base_tag(void *pdoc, Node *node)
978 jxhtml = GET_JXHTML(pdoc);
983 /*--------------------------------------------------------------------------*/
985 /*--------------------------------------------------------------------------*/
986 for (attr = qs_get_attr(doc,node);
988 attr = qs_get_next_attr(doc,attr)) {
989 char *name = qs_get_attr_name(doc,attr);
990 char *value = qs_get_attr_value(doc,attr);
991 if (STRCASEEQ('h','H',"href",name)) {
1003 * It is a handler who processes the BASE tag.
1005 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1006 * destination is specified.
1007 * @param node [i] The BASE tag node is specified.
1008 * @return The conversion result is returned.
1011 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
1013 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1019 * It is a handler who processes the BODY tag.
1021 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1022 * destination is specified.
1023 * @param node [i] The BODY tag node is specified.
1024 * @return The conversion result is returned.
1027 s_jxhtml_start_body_tag(void *pdoc, Node *node)
1033 char *attr_bgcolor = NULL;
1034 char *attr_text = NULL;
1035 char *attr_link = NULL;
1036 char *attr_style = NULL;
1038 jxhtml = GET_JXHTML(pdoc);
1042 /*--------------------------------------------------------------------------*/
1043 /* Get Attributes */
1044 /*--------------------------------------------------------------------------*/
1045 for (attr = qs_get_attr(doc,node);
1047 attr = qs_get_next_attr(doc,attr)) {
1048 char *name = qs_get_attr_name(doc,attr);
1049 char *value = qs_get_attr_value(doc,attr);
1050 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1051 /*----------------------------------------------------------------------*/
1053 /*----------------------------------------------------------------------*/
1054 attr_bgcolor = value;
1056 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1057 /*----------------------------------------------------------------------*/
1059 /*----------------------------------------------------------------------*/
1062 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1063 /*----------------------------------------------------------------------*/
1065 /*----------------------------------------------------------------------*/
1068 else if (STRCASEEQ('a','A',"alink",name)) {
1069 /*----------------------------------------------------------------------*/
1071 /*----------------------------------------------------------------------*/
1074 else if (STRCASEEQ('v','V',"vlink",name)) {
1075 /*----------------------------------------------------------------------*/
1077 /*----------------------------------------------------------------------*/
1080 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1085 if (IS_CSS_ON(jxhtml->entryp)) {
1086 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1088 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1089 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1090 css_property_t *cur;
1091 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1092 if (cur->value && *cur->value) {
1093 attr_text = apr_pstrdup(doc->pool, cur->value);
1096 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1097 if (cur->value && *cur->value) {
1098 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1102 if (jxhtml->style) {
1103 css_stylesheet_t *pseudos = chxj_find_pseudo_selectors(doc, jxhtml->style);
1104 css_selector_t *cur_sel;
1105 for (cur_sel = pseudos->selector_head.next; cur_sel != &pseudos->selector_head; cur_sel = cur_sel->next) {
1106 if (cur_sel->name && strcasecmp(cur_sel->name, "a:link") == 0) {
1107 css_property_t *cur;
1108 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1109 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1110 attr_link = apr_pstrdup(doc->pool, cur->value);
1120 if (attr_bgcolor || attr_text) {
1123 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1124 W_L("background-color:");
1129 attr_text = chxj_css_rgb_func_to_value(doc->pool, attr_text);
1137 attr_link = chxj_css_rgb_func_to_value(doc->pool, attr_link);
1148 * It is a handler who processes the BODY tag.
1150 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1151 * destination is specified.
1152 * @param node [i] The BODY tag node is specified.
1153 * @return The conversion result is returned.
1156 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1162 jxhtml = GET_JXHTML(pdoc);
1166 W_L("</div></body>");
1167 if (IS_CSS_ON(jxhtml->entryp)) {
1168 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1175 * It is a handler who processes the A tag.
1177 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1178 * destination is specified.
1179 * @param node [i] The A tag node is specified.
1180 * @return The conversion result is returned.
1183 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1189 char *attr_style = NULL;
1191 jxhtml = GET_JXHTML(pdoc);
1196 /*--------------------------------------------------------------------------*/
1197 /* Get Attributes */
1198 /*--------------------------------------------------------------------------*/
1199 for (attr = qs_get_attr(doc,node);
1201 attr = qs_get_next_attr(doc,attr)) {
1202 char *name = qs_get_attr_name(doc,attr);
1203 char *value = qs_get_attr_value(doc,attr);
1204 if (STRCASEEQ('n','N',"name",name)) {
1205 /*----------------------------------------------------------------------*/
1207 /*----------------------------------------------------------------------*/
1209 W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1212 else if (STRCASEEQ('h','H',"href",name)) {
1213 /*----------------------------------------------------------------------*/
1215 /*----------------------------------------------------------------------*/
1216 value = chxj_encoding_parameter(r, value, 1);
1217 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1218 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
1224 else if (STRCASEEQ('a','A',"accesskey",name)) {
1225 /*----------------------------------------------------------------------*/
1227 /*----------------------------------------------------------------------*/
1228 W_L(" accesskey=\"");
1232 else if (STRCASEEQ('c','C',"cti",name)) {
1233 /*----------------------------------------------------------------------*/
1235 /*----------------------------------------------------------------------*/
1240 else if (STRCASEEQ('i','I',"ijam",name)) {
1241 /*----------------------------------------------------------------------*/
1243 /*----------------------------------------------------------------------*/
1246 else if (STRCASEEQ('u','U',"utn",name)) {
1247 /*----------------------------------------------------------------------*/
1249 /* It is special only for CHTML. */
1250 /*----------------------------------------------------------------------*/
1253 else if (STRCASEEQ('t','T',"telbook",name)) {
1254 /*----------------------------------------------------------------------*/
1256 /*----------------------------------------------------------------------*/
1259 else if (STRCASEEQ('k','K',"kana",name)) {
1260 /*----------------------------------------------------------------------*/
1262 /*----------------------------------------------------------------------*/
1265 else if (STRCASEEQ('e','E',"email",name)) {
1266 /*----------------------------------------------------------------------*/
1268 /*----------------------------------------------------------------------*/
1271 else if (STRCASEEQ('i','I',"ista",name)) {
1272 /*----------------------------------------------------------------------*/
1274 /*----------------------------------------------------------------------*/
1277 else if (STRCASEEQ('i','I',"ilet",name)) {
1278 /*----------------------------------------------------------------------*/
1280 /*----------------------------------------------------------------------*/
1283 else if (STRCASEEQ('i','I',"iswf",name)) {
1284 /*----------------------------------------------------------------------*/
1286 /*----------------------------------------------------------------------*/
1289 else if (STRCASEEQ('i','I',"irst",name)) {
1290 /*----------------------------------------------------------------------*/
1292 /*----------------------------------------------------------------------*/
1295 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1296 /*----------------------------------------------------------------------*/
1298 /*----------------------------------------------------------------------*/
1304 if (IS_CSS_ON(jxhtml->entryp)) {
1305 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1313 * It is a handler who processes the A tag.
1315 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1316 * destination is specified.
1317 * @param node [i] The A tag node is specified.
1318 * @return The conversion result is returned.
1321 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1327 jxhtml = GET_JXHTML(pdoc);
1333 if (IS_CSS_ON(jxhtml->entryp)) {
1334 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1342 * It is a handler who processes the BR tag.
1344 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1345 * destination is specified.
1346 * @param node [i] The BR tag node is specified.
1347 * @return The conversion result is returned.
1350 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1357 jxhtml = GET_JXHTML(pdoc);
1361 char *attr_style = NULL;
1362 char *attr_clear = NULL;
1364 /*--------------------------------------------------------------------------*/
1365 /* Get Attributes */
1366 /*--------------------------------------------------------------------------*/
1367 for (attr = qs_get_attr(doc,node);
1369 attr = qs_get_next_attr(doc,attr)) {
1370 char *name = qs_get_attr_name(doc,attr);
1371 char *value = qs_get_attr_value(doc,attr);
1372 if (STRCASEEQ('c','C',"clear",name)) {
1373 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1377 else if (STRCASEEQ('s','S',"style",name)) {
1378 attr_style = apr_pstrdup(doc->buf.pool, value);
1381 if (IS_CSS_ON(jxhtml->entryp)) {
1382 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1384 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
1385 css_property_t *cur;
1386 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
1387 if (cur->value && *cur->value) {
1388 if ( STRCASEEQ('l','L',"left", cur->value)
1389 || STRCASEEQ('r','R',"right", cur->value)
1390 || STRCASEEQ('b','B',"both" ,cur->value)) {
1391 attr_clear = apr_pstrdup(doc->pool, cur->value);
1409 * It is a handler who processes the BR tag.
1411 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1412 * destination is specified.
1413 * @param node [i] The BR tag node is specified.
1414 * @return The conversion result is returned.
1417 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1419 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1424 * It is a handler who processes the TABLE tag.
1426 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1427 * destination is specified.
1428 * @param node [i] The TR tag node is specified.
1429 * @return The conversion result is returned.
1432 s_jxhtml_start_table_tag(void *pdoc, Node *node)
1439 char *attr_style = NULL;
1440 char *attr_align = NULL;
1441 char *attr_width = NULL;
1442 char *attr_height = NULL;
1443 char *attr_bgcolor = NULL;
1444 char *attr_border_width = NULL;
1445 char *attr_border_color = NULL;
1447 jxhtml = GET_JXHTML(pdoc);
1451 /*--------------------------------------------------------------------------*/
1452 /* Get Attributes */
1453 /*--------------------------------------------------------------------------*/
1454 for (attr = qs_get_attr(doc,node);
1456 attr = qs_get_next_attr(doc,attr)) {
1457 char *name = qs_get_attr_name(doc,attr);
1458 char *val = qs_get_attr_value(doc,attr);
1459 if (STRCASEEQ('a','A',"align",name)) {
1460 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1461 attr_align = apr_pstrdup(doc->buf.pool, val);
1464 else if (STRCASEEQ('h','H',"height",name) && val && *val) {
1465 attr_height = apr_pstrdup(doc->buf.pool, val);
1467 else if (STRCASEEQ('w','W',"width",name) && val && *val) {
1468 attr_width = apr_pstrdup(doc->buf.pool, val);
1470 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1471 attr_style = apr_pstrdup(doc->buf.pool, val);
1473 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1474 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1475 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1477 else if (STRCASEEQ('b','B',"border",name) && val && *val) {
1478 attr_border_width = apr_pstrdup(doc->buf.pool, val);
1480 else if (STRCASEEQ('b','B',"bordercolor",name) && val && *val) {
1481 attr_border_color = apr_pstrdup(doc->buf.pool, val);
1482 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1486 if (IS_CSS_ON(jxhtml->entryp)) {
1487 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
1489 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
1490 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
1491 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1492 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1493 css_property_t *border_width_prop = chxj_css_get_property_value(doc, style, "border-width");
1494 css_property_t *border_color_prop = chxj_css_get_property_value(doc, style, "border-color");
1496 css_property_t *cur;
1497 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
1498 char *tmp = apr_pstrdup(doc->pool, cur->value);
1499 char *tmpp = strstr(tmp, "px");
1501 size_t len = strlen(tmp) - strlen(tmpp);
1502 attr_width = apr_pstrndup(doc->pool, tmp,len);
1505 attr_width = apr_pstrdup(doc->pool, tmp);
1508 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
1509 char *tmp = apr_pstrdup(doc->pool, cur->value);
1510 char *tmpp = strstr(tmp, "px");
1512 size_t len = strlen(tmp) - strlen(tmpp);
1513 attr_height = apr_pstrndup(doc->pool, tmp,len);
1516 attr_height = apr_pstrdup(doc->pool, tmp);
1519 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1520 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1521 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1524 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1525 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1526 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1528 for (cur = border_width_prop->next; cur != border_width_prop; cur = cur->next) {
1529 char *tmp = apr_pstrdup(doc->pool, cur->value);
1530 char *tmpp = strstr(tmp, "px");
1532 size_t len = strlen(tmp) - strlen(tmpp);
1533 attr_border_width = apr_pstrndup(doc->pool, tmp,len);
1536 attr_border_width = apr_pstrdup(doc->pool, tmp);
1539 for (cur = border_color_prop->next; cur != border_color_prop; cur = cur->next) {
1540 attr_border_color = apr_pstrdup(doc->pool, cur->value);
1541 attr_border_color = chxj_css_rgb_func_to_value(doc->pool, attr_border_color);
1562 if (attr_bgcolor && *attr_bgcolor){
1567 if (attr_border_width || attr_border_color ){
1568 W_L(" style=\"border:");
1569 if (attr_border_width){
1570 W_V(attr_border_width);
1577 if (attr_border_color && *attr_border_color){
1579 W_V(attr_border_color);
1589 * It is a handler who processes the TABLE tag.
1591 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1592 * destination is specified.
1593 * @param node [i] The TR tag node is specified.
1594 * @return The conversion result is returned.
1597 s_jxhtml_end_table_tag(void *pdoc, Node *UNUSED(node))
1603 jxhtml = GET_JXHTML(pdoc);
1613 * It is a handler who processes the TR tag.
1615 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1616 * destination is specified.
1617 * @param node [i] The TR tag node is specified.
1618 * @return The conversion result is returned.
1621 s_jxhtml_start_tr_tag(void *pdoc, Node *node)
1629 char *attr_style = NULL;
1630 char *attr_align = NULL;
1631 char *attr_valign = NULL;
1632 char *attr_bgcolor = NULL;
1634 jxhtml = GET_JXHTML(pdoc);
1638 /*--------------------------------------------------------------------------*/
1639 /* Get Attributes */
1640 /*--------------------------------------------------------------------------*/
1641 for (attr = qs_get_attr(doc,node);
1643 attr = qs_get_next_attr(doc,attr)) {
1644 char *name = qs_get_attr_name(doc,attr);
1645 char *val = qs_get_attr_value(doc,attr);
1646 if (STRCASEEQ('a','A',"align",name)) {
1647 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1648 attr_align = apr_pstrdup(doc->buf.pool, val);
1651 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1652 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1653 attr_valign = apr_pstrdup(doc->buf.pool, val);
1656 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1657 attr_style = apr_pstrdup(doc->buf.pool, val);
1659 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1660 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1661 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1665 if (IS_CSS_ON(jxhtml->entryp)) {
1666 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
1668 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1669 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1670 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1672 css_property_t *cur;
1673 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1674 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1675 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1678 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1679 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1680 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1683 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1684 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1685 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1701 if (attr_bgcolor && *attr_bgcolor){
1712 * It is a handler who processes the TR tag.
1714 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1715 * destination is specified.
1716 * @param node [i] The TR tag node is specified.
1717 * @return The conversion result is returned.
1720 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1726 jxhtml = GET_JXHTML(pdoc);
1735 * It is a handler who processes the TD tag.
1737 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1738 * destination is specified.
1739 * @param node [i] The TR tag node is specified.
1740 * @return The conversion result is returned.
1743 s_jxhtml_start_td_tag(void *pdoc, Node *node)
1751 char *attr_style = NULL;
1752 char *attr_align = NULL;
1753 char *attr_valign = NULL;
1754 char *attr_bgcolor = NULL;
1755 char *attr_colspan = NULL;
1756 char *attr_rowspan = NULL;
1758 jxhtml = GET_JXHTML(pdoc);
1762 /*--------------------------------------------------------------------------*/
1763 /* Get Attributes */
1764 /*--------------------------------------------------------------------------*/
1765 for (attr = qs_get_attr(doc,node);
1767 attr = qs_get_next_attr(doc,attr)) {
1768 char *name = qs_get_attr_name(doc,attr);
1769 char *val = qs_get_attr_value(doc,attr);
1770 if (STRCASEEQ('a','A',"align",name)) {
1771 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1772 attr_align = apr_pstrdup(doc->buf.pool, val);
1775 else if (STRCASEEQ('v','V',"valign",name) && val && *val) {
1776 if (val && (STRCASEEQ('t','T',"top",val) || STRCASEEQ('m','M',"middle",val) || STRCASEEQ('b','B',"bottom",val))) {
1777 attr_valign = apr_pstrdup(doc->buf.pool, val);
1780 else if (STRCASEEQ('s','S',"style",name) && val && *val) {
1781 attr_style = apr_pstrdup(doc->buf.pool, val);
1783 else if (STRCASEEQ('b','B',"bgcolor",name) && val && *val) {
1784 attr_bgcolor = apr_pstrdup(doc->buf.pool, val);
1785 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1787 else if (STRCASEEQ('c','C',"colspan",name) && val && *val) {
1788 attr_colspan = apr_pstrdup(doc->buf.pool, val);
1790 else if (STRCASEEQ('r','R',"rowspan",name) && val && *val) {
1791 attr_rowspan = apr_pstrdup(doc->buf.pool, val);
1795 if (IS_CSS_ON(jxhtml->entryp)) {
1796 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
1798 css_property_t *align_prop = chxj_css_get_property_value(doc, style, "text-align");
1799 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
1800 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1802 css_property_t *cur;
1803 for (cur = align_prop->next; cur != align_prop; cur = cur->next) {
1804 if (cur->value && (STRCASEEQ('l','L',"left",cur->value) || STRCASEEQ('r','R',"right",cur->value) || STRCASEEQ('c','C',"center",cur->value))) {
1805 attr_align = apr_pstrdup(doc->buf.pool, cur->value);
1808 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
1809 if (cur->value && (STRCASEEQ('t','T',"top",cur->value) || STRCASEEQ('m','M',"middle",cur->value) || STRCASEEQ('b','B',"bottom",cur->value))) {
1810 attr_valign = apr_pstrdup(doc->buf.pool, cur->value);
1813 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1814 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1815 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1841 if (attr_bgcolor && *attr_bgcolor){
1852 * It is a handler who processes the TD tag.
1854 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1855 * destination is specified.
1856 * @param node [i] The TR tag node is specified.
1857 * @return The conversion result is returned.
1860 s_jxhtml_end_td_tag(void *pdoc, Node *UNUSED(child))
1866 jxhtml = GET_JXHTML(pdoc);
1875 * It is a handler who processes the FONT tag.
1877 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1878 * destination is specified.
1879 * @param node [i] The FONT tag node is specified.
1880 * @return The conversion result is returned.
1883 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1889 char *attr_color = NULL;
1890 char *attr_size = NULL;
1891 char *attr_style = NULL;
1893 jxhtml = GET_JXHTML(pdoc);
1897 /*--------------------------------------------------------------------------*/
1898 /* Get Attributes */
1899 /*--------------------------------------------------------------------------*/
1900 for (attr = qs_get_attr(doc,node);
1902 attr = qs_get_next_attr(doc,attr)) {
1903 char *name = qs_get_attr_name(doc,attr);
1904 char *value = qs_get_attr_value(doc,attr);
1905 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1906 attr_color = apr_pstrdup(doc->buf.pool, value);
1908 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1909 /*----------------------------------------------------------------------*/
1911 /*----------------------------------------------------------------------*/
1912 attr_size = apr_pstrdup(doc->buf.pool, value);
1914 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1915 attr_style = apr_pstrdup(doc->buf.pool, value);
1918 if (IS_CSS_ON(jxhtml->entryp)) {
1919 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1921 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1922 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
1923 css_property_t *cur;
1924 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1925 if (cur->value && *cur->value) {
1926 attr_color = apr_pstrdup(doc->pool, cur->value);
1929 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
1930 if (cur->value && *cur->value) {
1931 attr_size = apr_pstrdup(doc->pool, cur->value);
1932 if (STRCASEEQ('x','X',"xx-small",attr_size)) {
1933 attr_size = apr_pstrdup(doc->pool, "1");
1935 else if (STRCASEEQ('x','X',"x-small",attr_size)) {
1936 attr_size = apr_pstrdup(doc->pool, "2");
1938 else if (STRCASEEQ('s','S',"small",attr_size)) {
1939 attr_size = apr_pstrdup(doc->pool, "3");
1941 else if (STRCASEEQ('m','M',"medium",attr_size)) {
1942 attr_size = apr_pstrdup(doc->pool, "4");
1944 else if (STRCASEEQ('l','L',"large",attr_size)) {
1945 attr_size = apr_pstrdup(doc->pool, "5");
1947 else if (STRCASEEQ('x','X',"x-large",attr_size)) {
1948 attr_size = apr_pstrdup(doc->pool, "6");
1950 else if (STRCASEEQ('x','X',"xx-large",attr_size)) {
1951 attr_size = apr_pstrdup(doc->pool, "7");
1957 jxhtml_flags_t *flg = (jxhtml_flags_t *)apr_palloc(doc->pool, sizeof(*flg));
1958 memset(flg, 0, sizeof(*flg));
1960 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
1961 W_L("<font color=\"");
1964 flg->font_color_flag = 1;
1967 flg->font_size_flag = 1;
1968 switch(*attr_size) {
1969 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1970 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1971 case '3': W_L("<span style=\"font-size: small\">"); break;
1972 case '4': W_L("<span style=\"font-size: medium\">"); break;
1973 case '5': W_L("<span style=\"font-size: large\">"); break;
1974 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1975 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1977 if (*(attr_size + 1) == '1') {
1978 W_L("<span style=\"font-size: small\">");
1981 if (*(attr_size + 1) == '2') {
1982 W_L("<span style=\"font-size: x-small\">");
1985 if (*(attr_size + 1) == '3') {
1986 W_L("<span style=\"font-size: xx-small\">");
1989 flg->font_size_flag = 0;
1993 if (*(attr_size + 1) == '1') {
1994 W_L("<span style=\"font-size: large\">");
1997 if (*(attr_size + 1) == '2') {
1998 W_L("<span style=\"font-size: x-large\">");
2001 if (*(attr_size + 1) == '3') {
2002 W_L("<span style=\"font-size: xx-large\">");
2005 flg->font_size_flag = 0;
2009 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", attr_size);
2010 flg->font_size_flag = 0;
2013 node->userData = flg;
2019 * It is a handler who processes the FONT tag.
2021 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2022 * destination is specified.
2023 * @param node [i] The FONT tag node is specified.
2024 * @return The conversion result is returned.
2027 s_jxhtml_end_font_tag(void *pdoc, Node *node)
2033 jxhtml = GET_JXHTML(pdoc);
2037 jxhtml_flags_t *flg = (jxhtml_flags_t *)node->userData;
2038 if (flg && flg->font_size_flag) {
2041 if (flg && flg->font_color_flag) {
2044 if (IS_CSS_ON(jxhtml->entryp)) {
2045 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2053 * It is a handler who processes the FORM tag.
2055 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2056 * destination is specified.
2057 * @param node [i] The FORM tag node is specified.
2058 * @return The conversion result is returned.
2061 s_jxhtml_start_form_tag(void *pdoc, Node *node)
2067 char *attr_action = NULL;
2068 char *attr_method = NULL;
2069 char *attr_style = NULL;
2070 char *attr_color = NULL;
2071 char *attr_align = NULL;
2072 char *attr_name = NULL;
2073 char *new_hidden_tag = NULL;
2075 jxhtml = GET_JXHTML(pdoc);
2079 /*--------------------------------------------------------------------------*/
2080 /* Get Attributes */
2081 /*--------------------------------------------------------------------------*/
2082 for (attr = qs_get_attr(doc,node);
2084 attr = qs_get_next_attr(doc,attr)) {
2085 char *name = qs_get_attr_name(doc,attr);
2086 char *value = qs_get_attr_value(doc,attr);
2090 if (strcasecmp(name, "action") == 0) {
2091 /*--------------------------------------------------------------------*/
2093 /*--------------------------------------------------------------------*/
2094 attr_action = value;
2100 if (strcasecmp(name, "method") == 0) {
2101 /*--------------------------------------------------------------------*/
2103 /*--------------------------------------------------------------------*/
2104 attr_method = value;
2110 if (strcasecmp(name, "name") == 0) {
2111 /*--------------------------------------------------------------------*/
2113 /*--------------------------------------------------------------------*/
2120 if (strcasecmp(name, "style") == 0) {
2129 if (IS_CSS_ON(jxhtml->entryp)) {
2130 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2132 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
2133 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2134 css_property_t *cur;
2135 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
2136 if (STRCASEEQ('l','L',"left", cur->value)) {
2137 attr_align = apr_pstrdup(doc->pool, "left");
2139 else if (STRCASEEQ('c','C',"center",cur->value)) {
2140 attr_align = apr_pstrdup(doc->pool, "center");
2142 else if (STRCASEEQ('r','R',"right",cur->value)) {
2143 attr_align = apr_pstrdup(doc->pool, "right");
2146 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2147 attr_color = apr_pstrdup(doc->pool, cur->value);
2152 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
2156 attr_action = chxj_encoding_parameter(r, attr_action, 1);
2157 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
2159 char *old_qs = NULL;
2160 q = strchr(attr_action, '?');
2162 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);
2163 if (new_hidden_tag || old_qs) {
2187 jxhtml_flags_t *flg = (jxhtml_flags_t *)apr_palloc(doc->pool, sizeof(jxhtml_flags_t));
2188 memset(flg, 0, sizeof(*flg));
2190 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2191 W_L("<font color=\"");
2194 flg->with_font_flag = 1;
2197 W_L("<div align=\"");
2200 flg->with_div_flag = 1;
2202 node->userData = flg;
2203 if (new_hidden_tag) {
2204 W_V(new_hidden_tag);
2211 * It is a handler who processes the FORM tag.
2213 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2214 * destination is specified.
2215 * @param node [i] The FORM tag node is specified.
2216 * @return The conversion result is returned.
2219 s_jxhtml_end_form_tag(void *pdoc, Node *node)
2221 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2222 Doc *doc = jxhtml->doc;
2224 jxhtml_flags_t *flg = (jxhtml_flags_t *)node->userData;
2225 if (flg && flg->with_div_flag) {
2228 if (flg && flg->with_font_flag) {
2232 if (IS_CSS_ON(jxhtml->entryp)) {
2233 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2241 * It is a handler who processes the INPUT tag.
2243 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2244 * destination is specified.
2245 * @param node [i] The INPUT tag node is specified.
2246 * @return The conversion result is returned.
2249 s_jxhtml_start_input_tag(void *pdoc, Node *node)
2255 char *attr_accesskey = NULL;
2256 char *attr_max_length = NULL;
2257 char *attr_type = NULL;
2258 char *attr_name = NULL;
2259 char *attr_value = NULL;
2260 char *attr_istyle = NULL;
2261 char *attr_size = NULL;
2262 char *attr_checked = NULL;
2263 char *attr_style = NULL;
2265 jxhtml = GET_JXHTML(pdoc);
2269 /*--------------------------------------------------------------------------*/
2270 /* Get Attributes */
2271 /*--------------------------------------------------------------------------*/
2272 for (attr = qs_get_attr(doc,node);
2274 attr = qs_get_next_attr(doc,attr)) {
2275 char *name = qs_get_attr_name(doc,attr);
2276 char *value = qs_get_attr_value(doc,attr);
2277 if (STRCASEEQ('t','T',"type",name) && value && *value) {
2278 char *tmp_type = qs_trim_string(doc->buf.pool, value);
2279 if (tmp_type && (STRCASEEQ('t','T',"text", tmp_type) ||
2280 STRCASEEQ('p','P',"password",tmp_type) ||
2281 STRCASEEQ('c','C',"checkbox",tmp_type) ||
2282 STRCASEEQ('r','R',"radio", tmp_type) ||
2283 STRCASEEQ('h','H',"hidden", tmp_type) ||
2284 STRCASEEQ('s','S',"submit", tmp_type) ||
2285 STRCASEEQ('r','R',"reset", tmp_type))) {
2286 attr_type = tmp_type;
2289 else if (STRCASEEQ('n','N',"name",name) && value && *value) {
2292 else if (STRCASEEQ('v','V',"value",name) && value && *value) {
2295 else if (STRCASEEQ('i','I',"istyle",name) && value && *value) {
2296 attr_istyle = value;
2298 else if (STRCASEEQ('m','M',"maxlength",name) && value && *value) {
2299 attr_max_length = value;
2301 else if (STRCASEEQ('c','C',"checked", name)) {
2302 attr_checked = value;
2304 else if (STRCASEEQ('a','A',"accesskey", name) && value && *value) {
2305 attr_accesskey = value;
2307 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
2310 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2315 if (IS_CSS_ON(jxhtml->entryp)) {
2316 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
2318 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
2319 css_property_t *cur;
2320 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
2321 if (strcasestr(cur->value, "<ja:n>")) {
2324 else if (strcasestr(cur->value, "<ja:en>")) {
2327 else if (strcasestr(cur->value, "<ja:hk>")) {
2330 else if (strcasestr(cur->value, "<ja:h>")) {
2350 W_V(chxj_jreserved_to_safe_tag(r, attr_name, jxhtml->entryp));
2355 W_V(chxj_add_slash_to_doublequote(doc->pool, attr_value));
2358 if (attr_accesskey) {
2359 W_L(" accesskey=\"");
2360 W_V(attr_accesskey);
2363 if (attr_istyle && (*attr_istyle == '1' || *attr_istyle == '2' || *attr_istyle == '3' || *attr_istyle == '4')) {
2368 else if(attr_type && STRCASEEQ('p','P',"password",attr_type)) {
2369 W_L(" istyle=\"4\"");
2371 /*--------------------------------------------------------------------------*/
2372 /* The figure is default for the password. */
2373 /*--------------------------------------------------------------------------*/
2374 if (attr_max_length && *attr_max_length) {
2375 if (chxj_chk_numeric(attr_max_length) == 0) {
2376 W_L(" maxlength=\"");
2377 W_V(attr_max_length);
2382 W_L(" checked=\"checked\"");
2398 jxhtml = GET_JXHTML(pdoc);
2411 /*--------------------------------------------------------------------------*/
2412 /* Get Attributes */
2413 /*--------------------------------------------------------------------------*/
2414 type = qs_get_type_attr(doc, node, doc->buf.pool);
2415 name = qs_get_name_attr(doc, node, doc->buf.pool);
2416 value = qs_get_value_attr(doc,node, doc->buf.pool);
2417 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
2418 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
2419 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
2420 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
2421 size = qs_get_size_attr(doc, node, doc->buf.pool);
2424 if (type && (STRCASEEQ('t','T',"text", type) ||
2425 STRCASEEQ('p','P',"password",type) ||
2426 STRCASEEQ('c','C',"checkbox",type) ||
2427 STRCASEEQ('r','R',"radio", type) ||
2428 STRCASEEQ('h','H',"hidden", type) ||
2429 STRCASEEQ('s','S',"submit", type) ||
2430 STRCASEEQ('r','R',"reset", type))) {
2436 if (size && *size) {
2441 if (name && *name) {
2443 W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
2446 if (value && *value) {
2447 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
2448 apr_size_t value_len = strlen(value);
2449 value = chxj_conv_z2h(r, value, &value_len, jxhtml->entryp);
2453 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2456 if (accesskey && *accesskey) {
2457 W_L(" accesskey=\"");
2461 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
2462 /*------------------------------------------------------------------------*/
2464 /*------------------------------------------------------------------------*/
2465 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
2466 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2469 char *vv = qs_conv_istyle_to_format(doc->buf.pool, istyle);
2471 W_L("-wap-input-format:'*");
2477 else if (type && STRCASEEQ('p','P',"password",type)) {
2478 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2480 /*--------------------------------------------------------------------------*/
2481 /* The figure is default for the password. */
2482 /*--------------------------------------------------------------------------*/
2483 if (max_length && *max_length) {
2484 if (chxj_chk_numeric(max_length) == 0) {
2485 W_L(" maxlength=\"");
2492 W_L(" checked=\"checked\"");
2501 * It is a handler who processes the INPUT tag.
2503 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2504 * destination is specified.
2505 * @param node [i] The INPUT tag node is specified.
2506 * @return The conversion result is returned.
2509 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
2511 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2517 * It is a handler who processes the CENTER tag.
2519 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2520 * destination is specified.
2521 * @param node [i] The CENTER tag node is specified.
2522 * @return The conversion result is returned.
2525 s_jxhtml_start_center_tag(void *pdoc, Node *node)
2530 char *attr_style = NULL;
2531 char *attr_color = NULL;
2532 char *attr_size = NULL;
2534 jxhtml = GET_JXHTML(pdoc);
2537 for (attr = qs_get_attr(doc,node);
2539 attr = qs_get_next_attr(doc,attr)) {
2540 char *name = qs_get_attr_name(doc,attr);
2541 char *value = qs_get_attr_value(doc,attr);
2542 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2546 if (IS_CSS_ON(jxhtml->entryp)) {
2547 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2549 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2550 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2551 css_property_t *cur;
2552 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2553 if (cur->value && *cur->value) {
2554 attr_color = apr_pstrdup(doc->pool, cur->value);
2557 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2558 if (cur->value && *cur->value) {
2559 attr_size = apr_pstrdup(doc->pool, cur->value);
2566 if (attr_size || attr_color) {
2574 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2588 * It is a handler who processes the CENTER tag.
2590 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2591 * destination is specified.
2592 * @param node [i] The CENTER tag node is specified.
2593 * @return The conversion result is returned.
2596 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(node))
2602 jxhtml = GET_JXHTML(pdoc);
2607 if (IS_CSS_ON(jxhtml->entryp)) {
2608 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2615 * It is a handler who processes the li tag.
2617 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2618 * destination is specified.
2619 * @param node [i] The li tag node is specified.
2620 * @return The conversion result is returned.
2623 s_jxhtml_start_li_tag(void *pdoc, Node *node)
2629 char *attr_type = NULL;
2630 char *attr_value = NULL;
2631 char *attr_style = NULL;
2633 jxhtml = GET_JXHTML(pdoc);
2637 for (attr = qs_get_attr(doc,node);
2639 attr = qs_get_next_attr(doc,attr)) {
2640 char *name = qs_get_attr_name(doc,attr);
2641 char *value = qs_get_attr_value(doc,attr);
2642 if (STRCASEEQ('t','T',"type",name)) {
2643 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2644 if (*value == '1') {
2645 attr_type = apr_pstrdup(doc->pool, "decimal");
2647 else if (*value == 'a') {
2648 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2650 else if (*value == 'A') {
2651 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2658 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2661 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2665 if (IS_CSS_ON(jxhtml->entryp)) {
2666 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2668 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2669 css_property_t *cur;
2670 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2671 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2672 attr_type = apr_pstrdup(doc->pool, "decimal");
2674 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2675 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2677 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2678 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2680 else if (STRCASEEQ('d','D',"disc", cur->value)) {
2681 attr_type = apr_pstrdup(doc->pool, "disc");
2683 else if (STRCASEEQ('s','S',"square", cur->value)) {
2684 attr_type = apr_pstrdup(doc->pool, "square");
2686 else if (STRCASEEQ('c','C',"circle", cur->value)) {
2687 attr_type = apr_pstrdup(doc->pool, "circle");
2697 W_L("list-style-type:");
2713 * It is a handler who processes the li tag.
2715 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2716 * destination is specified.
2717 * @param node [i] The li tag node is specified.
2718 * @return The conversion result is returned.
2721 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
2727 jxhtml = GET_JXHTML(pdoc);
2731 if (IS_CSS_ON(jxhtml->entryp)) {
2732 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2740 * It is a handler who processes the OL tag.
2742 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2743 * destination is specified.
2744 * @param node [i] The OL tag node is specified.
2745 * @return The conversion result is returned.
2748 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
2754 char *attr_style = NULL;
2755 char *attr_start = NULL;
2756 char *attr_type = NULL;
2758 jxhtml = GET_JXHTML(pdoc);
2762 /*--------------------------------------------------------------------------*/
2763 /* Get Attributes */
2764 /*--------------------------------------------------------------------------*/
2765 for (attr = qs_get_attr(doc,node);
2767 attr = qs_get_next_attr(doc,attr)) {
2768 char *name = qs_get_attr_name(doc,attr);
2769 char *value = qs_get_attr_value(doc,attr);
2770 if (STRCASEEQ('t','T',"type",name) && value) {
2771 if (*value == '1') {
2772 attr_type = apr_pstrdup(doc->pool, "decimal");
2774 else if (*value == 'a') {
2775 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2777 else if (*value == 'A') {
2778 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2781 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2784 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2788 if (IS_CSS_ON(jxhtml->entryp)) {
2789 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2791 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2792 css_property_t *cur;
2793 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2794 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2795 attr_type = apr_pstrdup(doc->pool, "decimal");
2797 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2798 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2800 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2801 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2809 W_L("list-style-type:");
2826 * It is a handler who processes the OL tag.
2828 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2829 * destination is specified.
2830 * @param node [i] The OL tag node is specified.
2831 * @return The conversion result is returned.
2834 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
2840 jxhtml = GET_JXHTML(pdoc);
2845 if (IS_CSS_ON(jxhtml->entryp)) {
2846 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2853 * It is a handler who processes the P tag.
2855 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2856 * destination is specified.
2857 * @param node [i] The P tag node is specified.
2858 * @return The conversion result is returned.
2861 s_jxhtml_start_p_tag(void *pdoc, Node *node)
2867 char *attr_align = NULL;
2868 char *attr_style = NULL;
2869 char *attr_color = NULL;
2870 char *attr_blink = NULL;
2871 char *css_clear = NULL;
2873 jxhtml = GET_JXHTML(pdoc);
2877 for (attr = qs_get_attr(doc,node);
2879 attr = qs_get_next_attr(doc,attr)) {
2880 char *nm = qs_get_attr_name(doc,attr);
2881 char *val = qs_get_attr_value(doc,attr);
2882 if (STRCASEEQ('a','A',"align", nm)) {
2883 /*----------------------------------------------------------------------*/
2884 /* CHTML 1.0 (W3C version 3.2) */
2885 /*----------------------------------------------------------------------*/
2886 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2887 attr_align = apr_pstrdup(doc->buf.pool, val);
2891 else if (STRCASEEQ('s','S',"style", nm) && val && *val) {
2892 attr_style = apr_pstrdup(doc->buf.pool, val);
2895 if (IS_CSS_ON(jxhtml->entryp)) {
2896 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2898 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
2899 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2900 css_property_t *text_deco_prop = chxj_css_get_property_value(doc, style, "text-decoration");
2901 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
2902 css_property_t *cur;
2903 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
2904 if (STRCASEEQ('l','L',"left",cur->value)) {
2905 attr_align = apr_pstrdup(doc->pool, "left");
2907 else if (STRCASEEQ('c','C',"center",cur->value)) {
2908 attr_align = apr_pstrdup(doc->pool, "center");
2910 else if (STRCASEEQ('r','R',"right",cur->value)) {
2911 attr_align = apr_pstrdup(doc->pool, "right");
2914 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2915 if (cur->value && *cur->value) {
2916 attr_color = apr_pstrdup(doc->pool, cur->value);
2919 for (cur = text_deco_prop->next; cur != text_deco_prop; cur = cur->next) {
2920 if (cur->value && *cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
2921 attr_blink = apr_pstrdup(doc->pool, cur->value);
2924 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
2925 css_clear = apr_pstrdup(doc->pool, cur->value);
2930 if ((attr_align && *attr_align) || (attr_color && *attr_color) || (attr_blink && *attr_blink) || css_clear) {
2938 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2944 W_L("text-decoration:");
2961 * It is a handler who processes the P tag.
2963 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2964 * destination is specified.
2965 * @param node [i] The P tag node is specified.
2966 * @return The conversion result is returned.
2969 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
2971 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2972 Doc *doc = jxhtml->doc;
2975 if (IS_CSS_ON(jxhtml->entryp)) {
2976 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2983 * It is a handler who processes the PRE tag.
2985 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2986 * destination is specified.
2987 * @param node [i] The PRE tag node is specified.
2988 * @return The conversion result is returned.
2991 s_jxhtml_start_pre_tag(void *pdoc, Node *node)
2993 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2994 Doc *doc = jxhtml->doc;
2996 char *attr_style = NULL;
2998 for (attr = qs_get_attr(doc,node);
3000 attr = qs_get_next_attr(doc,attr)) {
3001 char *nm = qs_get_attr_name(doc,attr);
3002 char *val = qs_get_attr_value(doc,attr);
3003 if (val && STRCASEEQ('s','S',"style", nm)) {
3008 if (IS_CSS_ON(jxhtml->entryp)) {
3009 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3019 * It is a handler who processes the PRE tag.
3021 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3022 * destination is specified.
3023 * @param node [i] The PRE tag node is specified.
3024 * @return The conversion result is returned.
3027 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
3029 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3030 Doc *doc = jxhtml->doc;
3034 if (IS_CSS_ON(jxhtml->entryp)) {
3035 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3043 * It is a handler who processes the UL tag.
3045 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3046 * destination is specified.
3047 * @param node [i] The UL tag node is specified.
3048 * @return The conversion result is returned.
3051 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
3053 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3054 Doc *doc = jxhtml->doc;
3056 char *attr_type = NULL;
3057 char *attr_style = NULL;
3058 /*--------------------------------------------------------------------------*/
3059 /* Get Attributes */
3060 /*--------------------------------------------------------------------------*/
3061 for (attr = qs_get_attr(doc,node);
3063 attr = qs_get_next_attr(doc,attr)) {
3064 char *name = qs_get_attr_name(doc,attr);
3065 char *value = qs_get_attr_value(doc,attr);
3066 if (STRCASEEQ('t','T',"type",name)) {
3067 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3071 else if (value && *value && STRCASEEQ('s','S',"style", name)) {
3075 if (IS_CSS_ON(jxhtml->entryp)) {
3076 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3078 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
3079 css_property_t *cur;
3080 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3081 if (STRCASEEQ('d','D',"disc",cur->value)) {
3082 attr_type = apr_pstrdup(doc->pool, "disc");
3084 else if (STRCASEEQ('c','C',"circle",cur->value)) {
3085 attr_type = apr_pstrdup(doc->pool, "circle");
3087 else if (STRCASEEQ('s','S',"square",cur->value)) {
3088 attr_type = apr_pstrdup(doc->pool, "square");
3096 W_L("list-style-type:");
3107 * It is a handler who processes the UL tag.
3109 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3110 * destination is specified.
3111 * @param node [i] The UL tag node is specified.
3112 * @return The conversion result is returned.
3115 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
3117 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3118 Doc *doc = jxhtml->doc;
3121 if (IS_CSS_ON(jxhtml->entryp)) {
3122 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3129 * It is a handler who processes the HR tag.
3131 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3132 * destination is specified.
3133 * @param node [i] The HR tag node is specified.
3134 * @return The conversion result is returned.
3137 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
3143 char *attr_align = NULL;
3144 char *attr_size = NULL;
3145 char *attr_width = NULL;
3146 char *attr_noshade = NULL;
3147 char *attr_style = NULL;
3148 char *attr_color = NULL;
3150 char *style_float = NULL;
3151 char *style_border_color = NULL;
3153 jxhtml = GET_JXHTML(pdoc);
3157 for (attr = qs_get_attr(doc,node);
3159 attr = qs_get_next_attr(doc,attr)) {
3160 char *name = qs_get_attr_name (doc,attr);
3161 char *value = qs_get_attr_value(doc,attr);
3165 if (strcasecmp(name, "align") == 0) {
3166 /*--------------------------------------------------------------------*/
3168 /*--------------------------------------------------------------------*/
3169 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3177 if (strcasecmp(name, "size") == 0) {
3178 /*--------------------------------------------------------------------*/
3180 /*--------------------------------------------------------------------*/
3181 if (value && *value) {
3185 else if (strcasecmp(name, "style") == 0) {
3186 if (value && *value) {
3194 if (strcasecmp(name, "width") == 0) {
3195 /*--------------------------------------------------------------------*/
3197 /*--------------------------------------------------------------------*/
3198 if (value && *value) {
3206 if (strcasecmp(name, "noshade") == 0) {
3207 /*--------------------------------------------------------------------*/
3209 /*--------------------------------------------------------------------*/
3210 attr_noshade = apr_pstrdup(doc->pool, "noshade");
3216 if (strcasecmp(name, "color") == 0 && value && *value) {
3217 /*--------------------------------------------------------------------*/
3219 /*--------------------------------------------------------------------*/
3228 if (IS_CSS_ON(jxhtml->entryp)) {
3229 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
3231 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
3232 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3233 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3235 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
3236 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3237 css_property_t *border_color_prop = chxj_css_get_property_value(doc, style, "border-color");
3238 css_property_t *cur;
3240 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
3241 if (STRCASEEQ('s','S',"solid",cur->value)) {
3242 attr_noshade = "noshade";
3245 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3246 char *tmp = apr_pstrdup(doc->pool, cur->value);
3247 char *tmpp = strstr(tmp, "px");
3249 attr_size = apr_pstrdup(doc->pool, tmp);
3253 for(cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next){
3254 char *tmp = apr_pstrdup(doc->pool,cur->value);
3255 attr_color = apr_pstrdup(doc->pool,tmp);
3258 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3259 char *tmp = apr_pstrdup(doc->pool, cur->value);
3260 char *tmpp = strstr(tmp,"none");
3262 style_float = "center";
3265 style_float = apr_pstrdup(doc->pool,tmp);
3270 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3271 char *tmp = apr_pstrdup(doc->pool, cur->value);
3272 char *tmpp = strstr(tmp, "px");
3274 attr_width = apr_pstrdup(doc->pool, tmp);
3277 tmpp = strstr(tmp, "%");
3279 attr_width = apr_pstrdup(doc->pool, tmp);
3284 for (cur = border_color_prop->next; cur != border_color_prop; cur = cur->next) {
3285 char *tmp = apr_pstrdup(doc->pool, cur->value);
3287 style_border_color = apr_pstrdup(doc->pool, tmp);
3305 if (attr_size || attr_width || attr_noshade || style_border_color) {
3310 if (!strstr(attr_size, "px")) {
3318 if (!strstr(attr_width, "px") && !strstr(attr_width, "%")) {
3324 W_L("border-style:solid;");
3326 if(style_border_color){
3327 W_L("border-color:");
3328 W_V(style_border_color);
3346 * It is a handler who processes the HR tag.
3348 * @param jxhtml [i/o] The pointer to the JXHTML structure at the output
3349 * destination is specified.
3350 * @param node [i] The HR tag node is specified.
3351 * @return The conversion result is returned.
3354 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
3356 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3362 * It is a handler who processes the IMG tag.
3364 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3365 * destination is specified.
3366 * @param node [i] The IMG tag node is specified.
3367 * @return The conversion result is returned.
3370 s_jxhtml_start_img_tag(void *pdoc, Node *node)
3372 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3373 Doc *doc = jxhtml->doc;
3374 request_rec *r = doc->r;
3376 char *attr_src = NULL;
3377 char *attr_height = NULL;
3378 char *attr_width = NULL;
3379 char *attr_align = NULL;
3380 char *attr_alt = NULL;
3381 char *attr_style = NULL;
3382 char *attr_hspace = NULL;
3383 char *attr_vspace = NULL;
3385 char *css_float = NULL;
3386 char *css_margin_left = NULL;
3387 char *css_margin_right = NULL;
3388 char *css_margin_top = NULL;
3389 char *css_margin_bottom = NULL;
3390 char *css_display = NULL;
3391 char *css_valign = NULL;
3393 #ifndef IMG_NOT_CONVERT_FILENAME
3394 device_table *spec = jxhtml->spec;
3397 /*--------------------------------------------------------------------------*/
3398 /* Get Attributes */
3399 /*--------------------------------------------------------------------------*/
3400 for (attr = qs_get_attr(doc,node);
3402 attr = qs_get_next_attr(doc,attr)) {
3403 char *name = qs_get_attr_name(doc,attr);
3404 char *value = qs_get_attr_value(doc,attr);
3405 if (STRCASEEQ('s','S',"src",name)) {
3406 /*----------------------------------------------------------------------*/
3408 /*----------------------------------------------------------------------*/
3409 #ifdef IMG_NOT_CONVERT_FILENAME
3410 value = chxj_encoding_parameter(r, value, 1);
3411 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
3412 value = chxj_add_cookie_no_update_parameter(r, value);
3415 value = chxj_img_conv(r, spec, value);
3416 value = chxj_encoding_parameter(r, value, 1);
3417 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
3418 value = chxj_add_cookie_no_update_parameter(r, value);
3422 else if (STRCASEEQ('a','A',"align",name)) {
3423 /*----------------------------------------------------------------------*/
3425 /*----------------------------------------------------------------------*/
3427 if (STRCASEEQ('t','T',"top", value) ||
3428 STRCASEEQ('m','M',"middle",value) ||
3429 STRCASEEQ('b','B',"bottom",value)){
3431 }else if (STRCASEEQ('l','L',"left", value) || STRCASEEQ('r','R',"right", value)) {
3434 else if (STRCASEEQ('c','C',"center",value)) {
3435 css_valign = apr_pstrdup(doc->pool, "middle");
3439 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
3440 /*----------------------------------------------------------------------*/
3442 /*----------------------------------------------------------------------*/
3445 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
3446 /*----------------------------------------------------------------------*/
3448 /*----------------------------------------------------------------------*/
3449 attr_height = value;
3451 else if (STRCASEEQ('h','H',"hspace",name)) {
3452 /*----------------------------------------------------------------------*/
3454 /*----------------------------------------------------------------------*/
3455 attr_hspace = value;
3457 else if (STRCASEEQ('v','V',"vspace",name)) {
3458 /*----------------------------------------------------------------------*/
3460 /*----------------------------------------------------------------------*/
3461 attr_vspace = value;
3463 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
3464 /*----------------------------------------------------------------------*/
3466 /*----------------------------------------------------------------------*/
3469 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
3470 /*----------------------------------------------------------------------*/
3472 /*----------------------------------------------------------------------*/
3477 if (IS_CSS_ON(jxhtml->entryp)) {
3478 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
3480 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
3481 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
3482 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
3483 css_property_t *margin_left_prop = chxj_css_get_property_value(doc, style, "margin-left");
3484 css_property_t *margin_right_prop = chxj_css_get_property_value(doc, style, "margin-right");
3485 css_property_t *margin_top_prop = chxj_css_get_property_value(doc, style, "margin-top");
3486 css_property_t *margin_bottom_prop = chxj_css_get_property_value(doc, style, "margin-bottom");
3489 css_property_t *cur;
3490 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
3491 attr_height = apr_pstrdup(doc->pool, cur->value);
3493 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
3494 attr_width = apr_pstrdup(doc->pool, cur->value);
3497 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
3498 css_valign = apr_pstrdup(doc->pool, cur->value);
3501 if (! attr_hspace) {
3502 for (cur = margin_left_prop->next; cur != margin_left_prop; cur = cur->next) {
3503 css_margin_left = apr_pstrdup(doc->pool, cur->value);
3505 for (cur = margin_right_prop->next; cur != margin_right_prop; cur = cur->next) {
3506 css_margin_right = apr_pstrdup(doc->pool, cur->value);
3509 if (! attr_vspace) {
3510 for (cur = margin_top_prop->next; cur != margin_top_prop; cur = cur->next) {
3511 css_margin_top = apr_pstrdup(doc->pool, cur->value);
3513 for (cur = margin_bottom_prop->next; cur != margin_bottom_prop; cur = cur->next) {
3514 css_margin_bottom = apr_pstrdup(doc->pool, cur->value);
3518 css_property_t *float_prop = chxj_css_get_property_value(doc, style, "float");
3519 for (cur = float_prop->next; cur != float_prop; cur = cur->next) {
3520 css_float = apr_pstrdup(doc->pool, cur->value);
3524 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
3525 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
3526 char *tmp = apr_pstrdup(doc->pool, cur->value);
3527 char *tmpp = strstr(tmp, "none");
3529 css_display = apr_pstrdup(doc->pool, tmp);
3541 if (attr_hspace || attr_vspace || css_float || css_margin_left || css_margin_right || css_margin_top || css_margin_bottom || css_valign || css_display) {
3549 W_L("vertical-align:");
3554 W_L("margin-left:");
3557 W_L("margin-right:");
3562 if(css_margin_left){
3563 W_L("margin-left:");
3564 W_V(css_margin_left);
3567 if(css_margin_right){
3568 W_L("margin-right:");
3569 W_V(css_margin_right);
3577 W_L("margin-bottom:");
3584 W_V(css_margin_top);
3587 if(css_margin_bottom){
3588 W_L("margin-bottom:");
3589 W_V(css_margin_bottom);
3594 W_L("display:none;");
3623 * It is a handler who processes the IMG tag.
3625 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3626 * destination is specified.
3627 * @param node [i] The IMG tag node is specified.
3628 * @return The conversion result is returned.
3631 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
3633 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3639 * It is a handler who processes the SELECT tag.
3641 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3642 * destination is specified.
3643 * @param node [i] The SELECT tag node is specified.
3644 * @return The conversion result is returned.
3647 s_jxhtml_start_select_tag(void *pdoc, Node *node)
3649 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3650 Doc *doc = jxhtml->doc;
3654 char *multiple = NULL;
3655 char *attr_style = NULL;
3658 for (attr = qs_get_attr(doc,node);
3660 attr = qs_get_next_attr(doc,attr)) {
3661 char *nm = qs_get_attr_name(doc,attr);
3662 char *val = qs_get_attr_value(doc,attr);
3663 if (STRCASEEQ('s','S',"size",nm)) {
3664 /*----------------------------------------------------------------------*/
3665 /* CHTML 1.0 version 2.0 */
3666 /*----------------------------------------------------------------------*/
3667 size = apr_pstrdup(doc->buf.pool, val);
3669 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3670 /*----------------------------------------------------------------------*/
3671 /* CHTML 1.0 version 2.0 */
3672 /*----------------------------------------------------------------------*/
3673 attr_style = apr_pstrdup(doc->buf.pool, val);
3675 else if (STRCASEEQ('n','N',"name",nm)) {
3676 /*----------------------------------------------------------------------*/
3677 /* CHTML 1.0 version 2.0 */
3678 /*----------------------------------------------------------------------*/
3679 name = apr_pstrdup(doc->buf.pool, val);
3681 else if (STRCASEEQ('m','M',"multiple", nm)) {
3682 /*----------------------------------------------------------------------*/
3683 /* CHTML 1.0 version 2.0 */
3684 /*----------------------------------------------------------------------*/
3685 multiple = apr_pstrdup(doc->buf.pool, val);
3688 if (size && *size) {
3693 if (name && *name) {
3703 if (IS_CSS_ON(jxhtml->entryp)) {
3704 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3712 * It is a handler who processes the SELECT tag.
3714 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3715 * destination is specified.
3716 * @param node [i] The SELECT tag node is specified.
3717 * @return The conversion result is returned.
3720 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
3722 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3723 Doc *doc = jxhtml->doc;
3726 if (IS_CSS_ON(jxhtml->entryp)) {
3727 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3734 * It is a handler who processes the OPTION tag.
3736 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3737 * destination is specified.
3738 * @param node [i] The OPTION tag node is specified.
3739 * @return The conversion result is returned.
3742 s_jxhtml_start_option_tag(void *pdoc, Node *node)
3744 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3745 Doc *doc = jxhtml->doc;
3748 char *selected = NULL;
3750 char *attr_style = NULL;
3753 for (attr = qs_get_attr(doc,node);
3755 attr = qs_get_next_attr(doc,attr)) {
3756 char *nm = qs_get_attr_name(doc,attr);
3757 char *val = qs_get_attr_value(doc,attr);
3758 if (STRCASEEQ('s','S',"selected",nm)) {
3759 /*----------------------------------------------------------------------*/
3760 /* CHTML 1.0 version 2.0 */
3761 /*----------------------------------------------------------------------*/
3762 selected = apr_pstrdup(doc->buf.pool, val);
3764 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3765 /*----------------------------------------------------------------------*/
3766 /* CHTML 1.0 version 2.0 */
3767 /*----------------------------------------------------------------------*/
3768 attr_style = apr_pstrdup(doc->buf.pool, val);
3770 else if (STRCASEEQ('v','V',"value",nm)) {
3771 /*----------------------------------------------------------------------*/
3772 /* CHTML 1.0 version 2.0 */
3773 /*----------------------------------------------------------------------*/
3774 value = apr_pstrdup(doc->buf.pool, val);
3787 if (IS_CSS_ON(jxhtml->entryp)) {
3788 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3796 * It is a handler who processes the OPTION tag.
3798 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3799 * destination is specified.
3800 * @param node [i] The OPTION tag node is specified.
3801 * @return The conversion result is returned.
3804 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
3806 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3807 Doc *doc = jxhtml->doc;
3810 if (IS_CSS_ON(jxhtml->entryp)) {
3811 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3819 * It is a handler who processes the DIV tag.
3821 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3822 * destination is specified.
3823 * @param node [i] The DIV tag node is specified.
3824 * @return The conversion result is returned.
3827 s_jxhtml_start_div_tag(void *pdoc, Node *node)
3833 char *attr_style = NULL;
3834 char *attr_align = NULL;
3835 char *attr_display = NULL;
3836 char *attr_decoration = NULL;
3837 char *attr_wap_marquee_style = NULL;
3838 char *attr_wap_marquee_dir = NULL;
3839 char *attr_wap_marquee_loop = NULL;
3840 char *attr_color = NULL;
3841 char *attr_bgcolor = NULL;
3842 char *attr_font_size = NULL;
3843 char *css_clear = NULL;
3845 jxhtml = GET_JXHTML(pdoc);
3849 for (attr = qs_get_attr(doc,node);
3851 attr = qs_get_next_attr(doc,attr)) {
3852 char *nm = qs_get_attr_name(doc,attr);
3853 char *val = qs_get_attr_value(doc,attr);
3854 if (STRCASEEQ('a','A',"align",nm)) {
3855 /*----------------------------------------------------------------------*/
3856 /* CHTML 1.0 (W3C version 3.2) */
3857 /*----------------------------------------------------------------------*/
3858 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3859 attr_align = apr_pstrdup(doc->buf.pool, val);
3862 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3863 attr_style = apr_pstrdup(doc->buf.pool, val);
3867 if (IS_CSS_ON(jxhtml->entryp)) {
3868 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
3870 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
3871 css_property_t *text_decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
3872 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3873 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
3874 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
3875 css_property_t *background_color_prop = chxj_css_get_property_value(doc, style, "background-color");
3876 css_property_t *background_prop = chxj_css_get_property_value(doc, style, "background");
3877 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
3879 css_property_t *cur;
3880 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
3881 if (strcasecmp("-wap-marquee", cur->value) == 0) {
3882 attr_display = apr_pstrdup(doc->pool, cur->value);
3885 for (cur = text_decoration_prop->next; cur != text_decoration_prop; cur = cur->next) {
3886 if (STRCASEEQ('b','B',"blink", cur->value)) {
3887 attr_decoration = apr_pstrdup(doc->pool, cur->value);
3890 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3891 attr_color = apr_pstrdup(doc->pool, cur->value);
3893 for (cur = background_color_prop->next; cur != background_color_prop; cur = cur->next) {
3894 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3895 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
3897 for (cur = background_prop->next; cur != background_prop; cur = cur->next) {
3898 char *ss = strchr(cur->value, '#');
3900 ss = strstr(cur->value, "rgb");
3903 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3904 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
3907 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
3908 attr_align = apr_pstrdup(doc->pool, cur->value);
3910 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
3911 if ( STRCASEEQ('x','X',"xx-small",cur->value)
3912 || STRCASEEQ('x','X',"x-small",cur->value)
3913 || STRCASEEQ('s','S',"small",cur->value)
3914 || STRCASEEQ('m','M',"medium",cur->value)
3915 || STRCASEEQ('l','L',"large",cur->value)
3916 || STRCASEEQ('x','X',"x-large",cur->value)
3917 || STRCASEEQ('x','X',"xx-large",cur->value)) {
3918 attr_font_size = apr_pstrdup(doc->pool, cur->value);
3922 css_property_t *wap_marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
3923 css_property_t *wap_marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
3924 css_property_t *wap_marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
3925 for (cur = wap_marquee_style_prop->next; cur != wap_marquee_style_prop; cur = cur->next) {
3926 if (STRCASEEQ('s','S',"scroll", cur->value) || STRCASEEQ('s','S',"slide",cur->value) || STRCASEEQ('a','A',"alternate",cur->value)) {
3927 attr_wap_marquee_style = apr_pstrdup(doc->pool, cur->value);
3930 for (cur = wap_marquee_dir_prop->next; cur != wap_marquee_dir_prop; cur = cur->next) {
3931 if (STRCASEEQ('l','L',"ltr",cur->value)) {
3932 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
3934 else if (STRCASEEQ('r','R',"rtl",cur->value)) {
3935 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
3938 for (cur = wap_marquee_loop_prop->next; cur != wap_marquee_loop_prop; cur = cur->next) {
3939 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
3940 attr_wap_marquee_loop = "infinite";
3943 attr_wap_marquee_loop = apr_pstrdup(doc->pool, cur->value);
3947 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
3948 css_clear = apr_pstrdup(doc->pool, cur->value);
3956 || attr_wap_marquee_style
3957 || attr_wap_marquee_dir
3958 || attr_wap_marquee_loop
3974 if (attr_decoration) {
3975 W_L("text-decoration:");
3976 W_V(attr_decoration);
3979 if (attr_wap_marquee_style) {
3980 W_L("-wap-marquee-style:");
3981 W_V(attr_wap_marquee_style);
3984 if (attr_wap_marquee_dir) {
3985 W_L("-wap-marquee-dir:");
3986 W_V(attr_wap_marquee_dir);
3989 if (attr_wap_marquee_loop) {
3990 W_L("-wap-marquee-loop:");
3991 W_V(attr_wap_marquee_loop);
4000 W_L("background-color:");
4004 if (attr_font_size) {
4006 W_V(attr_font_size);
4022 * It is a handler who processes the DIV tag.
4024 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4025 * destination is specified.
4026 * @param node [i] The DIV tag node is specified.
4027 * @return The conversion result is returned.
4030 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
4036 jxhtml = GET_JXHTML(pdoc);
4041 if (IS_CSS_ON(jxhtml->entryp)) {
4042 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4049 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
4056 jxhtml = GET_JXHTML(pdoc);
4060 for (child = qs_get_child_node(doc, node);
4062 child = qs_get_next_node(doc, child)) {
4064 s_jxhtml_chxjif_tag(jxhtml, child);
4071 * It is a handler who processes the TEXTARE tag.
4073 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4074 * destination is specified.
4075 * @param node [i] The TEXTAREA tag node is specified.
4076 * @return The conversion result is returned.
4079 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
4085 char *attr_accesskey = NULL;
4086 char *attr_name = NULL;
4087 char *attr_rows = NULL;
4088 char *attr_cols = NULL;
4089 char *attr_istyle = NULL;
4090 char *attr_style = NULL;
4093 jxhtml = GET_JXHTML(pdoc);
4097 jxhtml->textarea_flag++;
4098 for (attr = qs_get_attr(doc,node);
4100 attr = qs_get_next_attr(doc,attr)) {
4101 char *name = qs_get_attr_name(doc,attr);
4102 char *value = qs_get_attr_value(doc,attr);
4103 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
4104 attr_accesskey = value;
4106 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
4107 attr_istyle = value;
4109 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
4112 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
4115 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
4118 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4122 if (IS_CSS_ON(jxhtml->entryp)) {
4123 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
4125 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
4126 css_property_t *cur;
4127 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
4128 if (strcasestr(cur->value, "<ja:n>")) {
4131 else if (strcasestr(cur->value, "<ja:en>")) {
4134 else if (strcasestr(cur->value, "<ja:hk>")) {
4137 else if (strcasestr(cur->value, "<ja:h>")) {
4144 if (attr_accesskey) {
4145 W_L(" accesskey=\"");
4146 W_V(attr_accesskey);
4175 * It is a handler who processes the TEXTAREA tag.
4177 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4178 * destination is specified.
4179 * @param node [i] The TEXTAREA tag node is specified.
4180 * @return The conversion result is returned.
4183 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
4189 jxhtml = GET_JXHTML(pdoc);
4194 jxhtml->textarea_flag--;
4201 * It is a handler who processes the B tag.
4203 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4204 * destination is specified.
4205 * @param node [i] The B tag node is specified.
4206 * @return The conversion result is returned.
4209 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
4215 jxhtml = GET_JXHTML(pdoc);
4225 * It is a handler who processes the B tag.
4227 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4228 * destination is specified.
4229 * @param node [i] The B tag node is specified.
4230 * @return The conversion result is returned.
4233 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
4235 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
4236 Doc* doc = jxhtml->doc;
4243 s_jxhtml_text_tag(void* pdoc, Node* child)
4254 apr_size_t z2h_input_len;
4256 jxhtml = GET_JXHTML(pdoc);
4260 textval = qs_get_node_value(doc,child);
4261 if (strlen(textval) == 0) {
4265 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
4266 memset(tmp, 0, qs_get_node_size(doc,child)+1);
4268 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
4269 memset(one_byte, 0, sizeof(one_byte));
4272 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
4274 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
4276 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
4281 if (is_sjis_kanji(textval[ii])) {
4282 one_byte[0] = textval[ii+0];
4283 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4284 one_byte[0] = textval[ii+1];
4285 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4289 if (jxhtml->pre_flag) {
4290 one_byte[0] = textval[ii+0];
4291 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4294 if (jxhtml->textarea_flag) {
4295 one_byte[0] = textval[ii+0];
4296 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4299 if (textval[ii] != '\r' && textval[ii] != '\n') {
4300 one_byte[0] = textval[ii+0];
4301 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
4305 z2h_input_len = strlen(tdst);
4306 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, jxhtml->entryp);
4314 * It is a handler who processes the BLOCKQUOTE tag.
4316 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4317 * destination is specified.
4318 * @param node [i] The BLOCKQUOTE tag node is specified.
4319 * @return The conversion result is returned.
4322 s_jxhtml_start_blockquote_tag(void *pdoc, Node *node)
4327 char *attr_style = NULL;
4328 char *attr_color = NULL;
4329 char *attr_size = NULL;
4331 jxhtml = GET_JXHTML(pdoc);
4333 for (attr = qs_get_attr(doc,node);
4335 attr = qs_get_next_attr(doc,attr)) {
4336 char *nm = qs_get_attr_name(doc,attr);
4337 char *val = qs_get_attr_value(doc,attr);
4338 if (val && STRCASEEQ('s','S',"style", nm)) {
4342 if (IS_CSS_ON(jxhtml->entryp)) {
4343 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4345 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4346 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
4347 css_property_t *cur;
4348 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4349 if (cur->value && *cur->value) {
4350 attr_color = apr_pstrdup(doc->pool, cur->value);
4353 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
4354 if (cur->value && *cur->value) {
4355 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4356 attr_size = apr_pstrdup(doc->pool, cur->value);
4358 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4359 attr_size = apr_pstrdup(doc->pool, cur->value);
4361 else if (STRCASEEQ('s','S',"small",cur->value)) {
4362 attr_size = apr_pstrdup(doc->pool, cur->value);
4364 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4365 attr_size = apr_pstrdup(doc->pool, cur->value);
4367 else if (STRCASEEQ('l','L',"large",cur->value)) {
4368 attr_size = apr_pstrdup(doc->pool, cur->value);
4370 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4371 attr_size = apr_pstrdup(doc->pool, cur->value);
4373 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4374 attr_size = apr_pstrdup(doc->pool, cur->value);
4381 if (attr_color || attr_size) {
4384 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4402 * It is a handler who processes the BLOCKQUOTE tag.
4404 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4405 * destination is specified.
4406 * @param node [i] The BLOCKQUOTE tag node is specified.
4407 * @return The conversion result is returned.
4410 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
4412 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4413 Doc *doc = jxhtml->doc;
4414 W_L("</blockquote>");
4415 if (IS_CSS_ON(jxhtml->entryp)) {
4416 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4423 * It is a handler who processes the DIR tag.
4425 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4426 * destination is specified.
4427 * @param node [i] The DIR tag node is specified.
4428 * @return The conversion result is returned.
4431 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
4433 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4434 Doc *doc = jxhtml->doc;
4436 char *attr_style = NULL;
4437 char *attr_color = NULL;
4438 char *attr_type = NULL;
4439 char *attr_size = NULL;
4440 for (attr = qs_get_attr(doc,node);
4442 attr = qs_get_next_attr(doc,attr)) {
4443 char *name = qs_get_attr_name(doc,attr);
4444 char *value = qs_get_attr_value(doc,attr);
4445 if (STRCASEEQ('t','T',"type",name)) {
4446 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
4450 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4454 if (IS_CSS_ON(jxhtml->entryp)) {
4455 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4457 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4458 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4459 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
4460 css_property_t *cur;
4461 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4462 if (cur->value && *cur->value) {
4463 attr_color = apr_pstrdup(doc->pool, cur->value);
4466 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4467 if (cur->value && *cur->value) {
4468 attr_type = apr_pstrdup(doc->pool, cur->value);
4471 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4472 if (cur->value && *cur->value) {
4473 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4474 attr_size = apr_pstrdup(doc->pool, cur->value);
4476 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4477 attr_size = apr_pstrdup(doc->pool, cur->value);
4479 else if (STRCASEEQ('s','S',"small",cur->value)) {
4480 attr_size = apr_pstrdup(doc->pool, cur->value);
4482 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4483 attr_size = apr_pstrdup(doc->pool, cur->value);
4485 else if (STRCASEEQ('l','L',"large",cur->value)) {
4486 attr_size = apr_pstrdup(doc->pool, cur->value);
4488 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4489 attr_size = apr_pstrdup(doc->pool, cur->value);
4491 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4492 attr_size = apr_pstrdup(doc->pool, cur->value);
4499 if (attr_type || attr_color || attr_size) {
4502 W_L("list-style-type:");
4507 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4525 * It is a handler who processes the DIR tag.
4527 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4528 * destination is specified.
4529 * @param node [i] The DIR tag node is specified.
4530 * @return The conversion result is returned.
4533 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
4535 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4536 Doc *doc = jxhtml->doc;
4538 if (IS_CSS_ON(jxhtml->entryp)) {
4539 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4546 * It is a handler who processes the DL tag.
4548 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4549 * destination is specified.
4550 * @param node [i] The DL tag node is specified.
4551 * @return The conversion result is returned.
4554 s_jxhtml_start_dl_tag(void *pdoc, Node *node)
4556 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4557 Doc *doc = jxhtml->doc;
4559 char *attr_style = NULL;
4560 char *attr_color = NULL;
4561 char *attr_size = NULL;
4562 for (attr = qs_get_attr(doc,node);
4564 attr = qs_get_next_attr(doc,attr)) {
4565 char *name = qs_get_attr_name(doc,attr);
4566 char *value = qs_get_attr_value(doc,attr);
4567 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4571 if (IS_CSS_ON(jxhtml->entryp)) {
4572 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4574 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4575 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4576 css_property_t *cur;
4577 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4578 if (cur->value && *cur->value) {
4579 attr_color = apr_pstrdup(doc->pool, cur->value);
4582 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4583 if (cur->value && *cur->value) {
4584 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4585 attr_size = apr_pstrdup(doc->pool, cur->value);
4587 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4588 attr_size = apr_pstrdup(doc->pool, cur->value);
4590 else if (STRCASEEQ('s','S',"small",cur->value)) {
4591 attr_size = apr_pstrdup(doc->pool, cur->value);
4593 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4594 attr_size = apr_pstrdup(doc->pool, cur->value);
4596 else if (STRCASEEQ('l','L',"large",cur->value)) {
4597 attr_size = apr_pstrdup(doc->pool, cur->value);
4599 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4600 attr_size = apr_pstrdup(doc->pool, cur->value);
4602 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4603 attr_size = apr_pstrdup(doc->pool, cur->value);
4610 if (attr_color || attr_size) {
4613 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4631 * It is a handler who processes the DL tag.
4633 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4634 * destination is specified.
4635 * @param node [i] The DL tag node is specified.
4636 * @return The conversion result is returned.
4639 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
4641 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4642 Doc *doc = jxhtml->doc;
4644 if (IS_CSS_ON(jxhtml->entryp)) {
4645 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4652 * It is a handler who processes the DT tag.
4654 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4655 * destination is specified.
4656 * @param node [i] The DT tag node is specified.
4657 * @return The conversion result is returned.
4660 s_jxhtml_start_dt_tag(void *pdoc, Node *node)
4662 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4663 Doc *doc = jxhtml->doc;
4665 char *attr_style = NULL;
4666 char *attr_color = NULL;
4667 char *attr_size = NULL;
4668 for (attr = qs_get_attr(doc,node);
4670 attr = qs_get_next_attr(doc,attr)) {
4671 char *name = qs_get_attr_name(doc,attr);
4672 char *value = qs_get_attr_value(doc,attr);
4673 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4677 if (IS_CSS_ON(jxhtml->entryp)) {
4678 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4680 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4681 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4682 css_property_t *cur;
4683 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4684 if (cur->value && *cur->value) {
4685 attr_color = apr_pstrdup(doc->pool, cur->value);
4688 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4689 if (cur->value && *cur->value) {
4690 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4691 attr_size = apr_pstrdup(doc->pool, cur->value);
4693 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4694 attr_size = apr_pstrdup(doc->pool, cur->value);
4696 else if (STRCASEEQ('s','S',"small",cur->value)) {
4697 attr_size = apr_pstrdup(doc->pool, cur->value);
4699 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4700 attr_size = apr_pstrdup(doc->pool, cur->value);
4702 else if (STRCASEEQ('l','L',"large",cur->value)) {
4703 attr_size = apr_pstrdup(doc->pool, cur->value);
4705 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4706 attr_size = apr_pstrdup(doc->pool, cur->value);
4708 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4709 attr_size = apr_pstrdup(doc->pool, cur->value);
4716 if (attr_color || attr_size) {
4719 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4737 * It is a handler who processes the DT tag.
4739 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4740 * destination is specified.
4741 * @param node [i] The DT tag node is specified.
4742 * @return The conversion result is returned.
4745 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
4747 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4748 Doc *doc = jxhtml->doc;
4750 if (IS_CSS_ON(jxhtml->entryp)) {
4751 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4758 * It is a handler who processes the DD tag.
4760 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4761 * destination is specified.
4762 * @param node [i] The DD tag node is specified.
4763 * @return The conversion result is returned.
4766 s_jxhtml_start_dd_tag(void *pdoc, Node *node)
4768 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4769 Doc *doc = jxhtml->doc;
4771 char *attr_style = NULL;
4772 char *attr_color = NULL;
4773 char *attr_size = NULL;
4774 for (attr = qs_get_attr(doc,node);
4776 attr = qs_get_next_attr(doc,attr)) {
4777 char *name = qs_get_attr_name(doc,attr);
4778 char *value = qs_get_attr_value(doc,attr);
4779 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4783 if (IS_CSS_ON(jxhtml->entryp)) {
4784 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4786 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4787 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4788 css_property_t *cur;
4789 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4790 if (cur->value && *cur->value) {
4791 attr_color = apr_pstrdup(doc->pool, cur->value);
4794 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4795 if (cur->value && *cur->value) {
4796 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4797 attr_size = apr_pstrdup(doc->pool, cur->value);
4799 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4800 attr_size = apr_pstrdup(doc->pool, cur->value);
4802 else if (STRCASEEQ('s','S',"small",cur->value)) {
4803 attr_size = apr_pstrdup(doc->pool, cur->value);
4805 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4806 attr_size = apr_pstrdup(doc->pool, cur->value);
4808 else if (STRCASEEQ('l','L',"large",cur->value)) {
4809 attr_size = apr_pstrdup(doc->pool, cur->value);
4811 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4812 attr_size = apr_pstrdup(doc->pool, cur->value);
4814 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4815 attr_size = apr_pstrdup(doc->pool, cur->value);
4822 if (attr_color || attr_size) {
4825 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4843 * It is a handler who processes the DD tag.
4845 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4846 * destination is specified.
4847 * @param node [i] The DD tag node is specified.
4848 * @return The conversion result is returned.
4851 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
4853 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4854 Doc *doc = jxhtml->doc;
4856 if (IS_CSS_ON(jxhtml->entryp)) {
4857 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4864 * It is a handler who processes the H1 tag.
4866 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4867 * destination is specified.
4868 * @param node [i] The H1 tag node is specified.
4869 * @return The conversion result is returned.
4872 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
4878 char *attr_style = NULL;
4879 char *attr_align = NULL;
4880 char *css_clear = NULL;
4882 jxhtml = GET_JXHTML(pdoc);
4886 for (attr = qs_get_attr(doc,node);
4888 attr = qs_get_next_attr(doc,attr)) {
4889 char *name = qs_get_attr_name(doc,attr);
4890 char *value = qs_get_attr_value(doc,attr);
4891 if (STRCASEEQ('a','A',"align", name)) {
4892 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4896 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4900 if (IS_CSS_ON(jxhtml->entryp)) {
4901 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4903 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4904 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
4905 css_property_t *cur;
4906 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4907 if (STRCASEEQ('l','L',"left", cur->value)) {
4908 attr_align = apr_pstrdup(doc->pool, "left");
4910 else if (STRCASEEQ('c','C',"center",cur->value)) {
4911 attr_align = apr_pstrdup(doc->pool, "center");
4913 else if (STRCASEEQ('r','R',"right",cur->value)) {
4914 attr_align = apr_pstrdup(doc->pool, "right");
4917 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
4918 if (STRCASEEQ('b','B',"both", cur->value)) {
4919 css_clear = apr_pstrdup(doc->pool, "both");
4921 else if (STRCASEEQ('r','R',"right", cur->value)) {
4922 css_clear = apr_pstrdup(doc->pool, "right");
4924 else if (STRCASEEQ('l','L',"left", cur->value)) {
4925 css_clear = apr_pstrdup(doc->pool, "left");
4931 if (attr_align || css_clear ) {
4952 * It is a handler who processes the H1 tag.
4954 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4955 * destination is specified.
4956 * @param node [i] The H1 tag node is specified.
4957 * @return The conversion result is returned.
4960 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
4966 jxhtml = GET_JXHTML(pdoc);
4971 if (IS_CSS_ON(jxhtml->entryp)) {
4972 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4980 * It is a handler who processes the H2 tag.
4982 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4983 * destination is specified.
4984 * @param node [i] The H1 tag node is specified.
4985 * @return The conversion result is returned.
4988 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
4994 char *attr_style = NULL;
4995 char *attr_align = NULL;
4996 char *css_clear = NULL;
4998 jxhtml = GET_JXHTML(pdoc);
5002 for (attr = qs_get_attr(doc,node);
5004 attr = qs_get_next_attr(doc,attr)) {
5005 char *name = qs_get_attr_name(doc,attr);
5006 char *value = qs_get_attr_value(doc,attr);
5007 if (STRCASEEQ('a','A',"align", name)) {
5008 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5012 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5016 if (IS_CSS_ON(jxhtml->entryp)) {
5017 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5019 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5020 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5021 css_property_t *cur;
5022 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5023 if (STRCASEEQ('l','L',"left", cur->value)) {
5024 attr_align = apr_pstrdup(doc->pool, "left");
5026 else if (STRCASEEQ('c','C',"center",cur->value)) {
5027 attr_align = apr_pstrdup(doc->pool, "center");
5029 else if (STRCASEEQ('r','R',"right",cur->value)) {
5030 attr_align = apr_pstrdup(doc->pool, "right");
5033 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5034 if (STRCASEEQ('b','B',"both", cur->value)) {
5035 css_clear = apr_pstrdup(doc->pool, "both");
5037 else if (STRCASEEQ('r','R',"right", cur->value)) {
5038 css_clear = apr_pstrdup(doc->pool, "right");
5040 else if (STRCASEEQ('l','L',"left", cur->value)) {
5041 css_clear = apr_pstrdup(doc->pool, "left");
5047 if (attr_align || css_clear ) {
5068 * It is a handler who processes the H2 tag.
5070 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5071 * destination is specified.
5072 * @param node [i] The H1 tag node is specified.
5073 * @return The conversion result is returned.
5076 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
5082 jxhtml = GET_JXHTML(pdoc);
5087 if (IS_CSS_ON(jxhtml->entryp)) {
5088 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5095 * It is a handler who processes the H3 tag.
5097 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5098 * destination is specified.
5099 * @param node [i] The H1 tag node is specified.
5100 * @return The conversion result is returned.
5103 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
5109 char *attr_style = NULL;
5110 char *attr_align = NULL;
5111 char *css_clear = NULL;
5113 jxhtml = GET_JXHTML(pdoc);
5117 for (attr = qs_get_attr(doc,node);
5119 attr = qs_get_next_attr(doc,attr)) {
5120 char *name = qs_get_attr_name(doc,attr);
5121 char *value = qs_get_attr_value(doc,attr);
5122 if (STRCASEEQ('a','A',"align", name)) {
5123 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5127 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5131 if (IS_CSS_ON(jxhtml->entryp)) {
5132 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5134 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5135 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5136 css_property_t *cur;
5137 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5138 if (STRCASEEQ('l','L',"left", cur->value)) {
5139 attr_align = apr_pstrdup(doc->pool, "left");
5141 else if (STRCASEEQ('c','C',"center",cur->value)) {
5142 attr_align = apr_pstrdup(doc->pool, "center");
5144 else if (STRCASEEQ('r','R',"right",cur->value)) {
5145 attr_align = apr_pstrdup(doc->pool, "right");
5148 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5149 if (STRCASEEQ('b','B',"both", cur->value)) {
5150 css_clear = apr_pstrdup(doc->pool, "both");
5152 else if (STRCASEEQ('r','R',"right", cur->value)) {
5153 css_clear = apr_pstrdup(doc->pool, "right");
5155 else if (STRCASEEQ('l','L',"left", cur->value)) {
5156 css_clear = apr_pstrdup(doc->pool, "left");
5162 if (attr_align || css_clear ) {
5183 * It is a handler who processes the H3 tag.
5185 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5186 * destination is specified.
5187 * @param node [i] The H1 tag node is specified.
5188 * @return The conversion result is returned.
5191 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
5197 jxhtml = GET_JXHTML(pdoc);
5202 if (IS_CSS_ON(jxhtml->entryp)) {
5203 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5210 * It is a handler who processes the H4 tag.
5212 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5213 * destination is specified.
5214 * @param node [i] The H1 tag node is specified.
5215 * @return The conversion result is returned.
5218 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
5224 char *attr_style = NULL;
5225 char *attr_align = NULL;
5226 char *css_clear = NULL;
5228 jxhtml = GET_JXHTML(pdoc);
5232 for (attr = qs_get_attr(doc,node);
5234 attr = qs_get_next_attr(doc,attr)) {
5235 char *name = qs_get_attr_name(doc,attr);
5236 char *value = qs_get_attr_value(doc,attr);
5237 if (STRCASEEQ('a','A',"align", name)) {
5238 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5242 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5246 if (IS_CSS_ON(jxhtml->entryp)) {
5247 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5249 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5250 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5251 css_property_t *cur;
5252 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5253 if (STRCASEEQ('l','L',"left", cur->value)) {
5254 attr_align = apr_pstrdup(doc->pool, "left");
5256 else if (STRCASEEQ('c','C',"center",cur->value)) {
5257 attr_align = apr_pstrdup(doc->pool, "center");
5259 else if (STRCASEEQ('r','R',"right",cur->value)) {
5260 attr_align = apr_pstrdup(doc->pool, "right");
5263 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5264 if (STRCASEEQ('b','B',"both", cur->value)) {
5265 css_clear = apr_pstrdup(doc->pool, "both");
5267 else if (STRCASEEQ('r','R',"right", cur->value)) {
5268 css_clear = apr_pstrdup(doc->pool, "right");
5270 else if (STRCASEEQ('l','L',"left", cur->value)) {
5271 css_clear = apr_pstrdup(doc->pool, "left");
5277 if (attr_align || css_clear ) {
5298 * It is a handler who processes the H4 tag.
5300 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5301 * destination is specified.
5302 * @param node [i] The H1 tag node is specified.
5303 * @return The conversion result is returned.
5306 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
5312 jxhtml = GET_JXHTML(pdoc);
5317 if (IS_CSS_ON(jxhtml->entryp)) {
5318 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5326 * It is a handler who processes the H5 tag.
5328 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5329 * destination is specified.
5330 * @param node [i] The H1 tag node is specified.
5331 * @return The conversion result is returned.
5334 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
5340 char *attr_style = NULL;
5341 char *attr_align = NULL;
5342 char *css_clear = NULL;
5344 jxhtml = GET_JXHTML(pdoc);
5348 for (attr = qs_get_attr(doc,node);
5350 attr = qs_get_next_attr(doc,attr)) {
5351 char *name = qs_get_attr_name(doc,attr);
5352 char *value = qs_get_attr_value(doc,attr);
5353 if (STRCASEEQ('a','A',"align", name)) {
5354 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5358 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5362 if (IS_CSS_ON(jxhtml->entryp)) {
5363 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5365 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5366 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5367 css_property_t *cur;
5368 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5369 if (STRCASEEQ('l','L',"left", cur->value)) {
5370 attr_align = apr_pstrdup(doc->pool, "left");
5372 else if (STRCASEEQ('c','C',"center",cur->value)) {
5373 attr_align = apr_pstrdup(doc->pool, "center");
5375 else if (STRCASEEQ('r','R',"right",cur->value)) {
5376 attr_align = apr_pstrdup(doc->pool, "right");
5379 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5380 if (STRCASEEQ('b','B',"both", cur->value)) {
5381 css_clear = apr_pstrdup(doc->pool, "both");
5383 else if (STRCASEEQ('r','R',"right", cur->value)) {
5384 css_clear = apr_pstrdup(doc->pool, "right");
5386 else if (STRCASEEQ('l','L',"left", cur->value)) {
5387 css_clear = apr_pstrdup(doc->pool, "left");
5393 if (attr_align || css_clear ) {
5414 * It is a handler who processes the H5 tag.
5416 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5417 * destination is specified.
5418 * @param node [i] The H1 tag node is specified.
5419 * @return The conversion result is returned.
5422 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
5428 jxhtml = GET_JXHTML(pdoc);
5433 if (IS_CSS_ON(jxhtml->entryp)) {
5434 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5442 * It is a handler who processes the H6 tag.
5444 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5445 * destination is specified.
5446 * @param node [i] The H1 tag node is specified.
5447 * @return The conversion result is returned.
5450 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
5456 char *attr_style = NULL;
5457 char *attr_align = NULL;
5458 char *css_clear = NULL;
5460 jxhtml = GET_JXHTML(pdoc);
5464 for (attr = qs_get_attr(doc,node);
5466 attr = qs_get_next_attr(doc,attr)) {
5467 char *name = qs_get_attr_name(doc,attr);
5468 char *value = qs_get_attr_value(doc,attr);
5469 if (STRCASEEQ('a','A',"align", name)) {
5470 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
5474 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5478 if (IS_CSS_ON(jxhtml->entryp)) {
5479 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5481 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
5482 css_property_t *clear_prop = chxj_css_get_property_value(doc, style, "clear");
5483 css_property_t *cur;
5484 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5485 if (STRCASEEQ('l','L',"left", cur->value)) {
5486 attr_align = apr_pstrdup(doc->pool, "left");
5488 else if (STRCASEEQ('c','C',"center",cur->value)) {
5489 attr_align = apr_pstrdup(doc->pool, "center");
5491 else if (STRCASEEQ('r','R',"right",cur->value)) {
5492 attr_align = apr_pstrdup(doc->pool, "right");
5495 for (cur = clear_prop->next; cur != clear_prop; cur = cur->next) {
5496 if (STRCASEEQ('b','B',"both", cur->value)) {
5497 css_clear = apr_pstrdup(doc->pool, "both");
5499 else if (STRCASEEQ('r','R',"right", cur->value)) {
5500 css_clear = apr_pstrdup(doc->pool, "right");
5502 else if (STRCASEEQ('l','L',"left", cur->value)) {
5503 css_clear = apr_pstrdup(doc->pool, "left");
5509 if (attr_align || css_clear ) {
5530 * It is a handler who processes the H6 tag.
5532 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5533 * destination is specified.
5534 * @param node [i] The H1 tag node is specified.
5535 * @return The conversion result is returned.
5538 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
5544 jxhtml = GET_JXHTML(pdoc);
5549 if (IS_CSS_ON(jxhtml->entryp)) {
5550 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5558 * It is a handler who processes the MENU tag.
5560 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5561 * destination is specified.
5562 * @param node [i] The MENU tag node is specified.
5563 * @return The conversion result is returned.
5566 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
5568 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5569 Doc *doc = jxhtml->doc;
5571 char *attr_style = NULL;
5572 char *attr_color = NULL;
5573 char *attr_type = NULL;
5574 char *attr_size = NULL;
5575 for (attr = qs_get_attr(doc,node);
5577 attr = qs_get_next_attr(doc,attr)) {
5578 char *name = qs_get_attr_name(doc,attr);
5579 char *value = qs_get_attr_value(doc,attr);
5580 if (STRCASEEQ('t','T',"type",name)) {
5581 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
5585 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
5589 if (IS_CSS_ON(jxhtml->entryp)) {
5590 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5592 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5593 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5594 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
5595 css_property_t *cur;
5596 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5597 if (cur->value && *cur->value) {
5598 attr_color = apr_pstrdup(doc->pool, cur->value);
5601 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
5602 if (cur->value && *cur->value) {
5603 attr_type = apr_pstrdup(doc->pool, cur->value);
5606 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5607 if (cur->value && *cur->value) {
5608 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5609 attr_size = apr_pstrdup(doc->pool, cur->value);
5611 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5612 attr_size = apr_pstrdup(doc->pool, cur->value);
5614 else if (STRCASEEQ('s','S',"small",cur->value)) {
5615 attr_size = apr_pstrdup(doc->pool, cur->value);
5617 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5618 attr_size = apr_pstrdup(doc->pool, cur->value);
5620 else if (STRCASEEQ('l','L',"large",cur->value)) {
5621 attr_size = apr_pstrdup(doc->pool, cur->value);
5623 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5624 attr_size = apr_pstrdup(doc->pool, cur->value);
5626 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5627 attr_size = apr_pstrdup(doc->pool, cur->value);
5634 if (attr_type || attr_color || attr_size) {
5637 W_L("list-style-type:");
5642 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5660 * It is a handler who processes the MENU tag.
5662 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5663 * destination is specified.
5664 * @param node [i] The MENU tag node is specified.
5665 * @return The conversion result is returned.
5668 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
5670 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5671 Doc *doc = jxhtml->doc;
5673 if (IS_CSS_ON(jxhtml->entryp)) {
5674 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5681 * It is a handler who processes the PLAINTEXT tag.
5683 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5684 * destination is specified.
5685 * @param node [i] The PLAINTEXT tag node is specified.
5686 * @return The conversion result is returned.
5689 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
5694 jxhtml = GET_JXHTML(pdoc);
5697 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
5702 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
5707 jxhtml = GET_JXHTML(pdoc);
5709 for (child = qs_get_child_node(doc, node);
5711 child = qs_get_next_node(doc, child)) {
5713 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
5720 * It is a handler who processes the PLAINTEXT tag.
5722 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5723 * destination is specified.
5724 * @param node [i] The PLAINTEXT tag node is specified.
5725 * @return The conversion result is returned.
5728 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
5730 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5736 * It is a handler who processes the BLINK tag.
5738 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5739 * destination is specified.
5740 * @param node [i] The BLINK tag node is specified.
5741 * @return The conversion result is returned.
5744 s_jxhtml_start_blink_tag(void *pdoc, Node *node)
5746 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5747 Doc *doc = jxhtml->doc;
5749 char *attr_style = NULL;
5750 char *attr_color = NULL;
5751 char *attr_size = NULL;
5752 for (attr = qs_get_attr(doc,node);
5754 attr = qs_get_next_attr(doc,attr)) {
5755 char *name = qs_get_attr_name(doc,attr);
5756 char *value = qs_get_attr_value(doc,attr);
5757 if (STRCASEEQ('s','S',"style", name) && value && *value) {
5761 if (IS_CSS_ON(jxhtml->entryp)) {
5762 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5764 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5765 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5766 css_property_t *cur;
5767 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5768 if (cur->value && *cur->value) {
5769 attr_color = apr_pstrdup(doc->pool, cur->value);
5772 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5773 if (cur->value && *cur->value) {
5774 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5775 attr_size = apr_pstrdup(doc->pool, cur->value);
5777 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5778 attr_size = apr_pstrdup(doc->pool, cur->value);
5780 else if (STRCASEEQ('s','S',"small",cur->value)) {
5781 attr_size = apr_pstrdup(doc->pool, cur->value);
5783 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5784 attr_size = apr_pstrdup(doc->pool, cur->value);
5786 else if (STRCASEEQ('l','L',"large",cur->value)) {
5787 attr_size = apr_pstrdup(doc->pool, cur->value);
5789 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5790 attr_size = apr_pstrdup(doc->pool, cur->value);
5792 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5793 attr_size = apr_pstrdup(doc->pool, cur->value);
5800 if (attr_color || attr_size) {
5803 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5821 * It is a handler who processes the BLINK tag.
5823 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5824 * destination is specified.
5825 * @param node [i] The BLINK tag node is specified.
5826 * @return The conversion result is returned.
5829 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
5831 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5832 Doc *doc = jxhtml->doc;
5834 if (IS_CSS_ON(jxhtml->entryp)) {
5835 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5842 * It is a handler who processes the MARQUEE tag.
5844 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5845 * destination is specified.
5846 * @param node [i] The MARQUEE tag node is specified.
5847 * @return The conversion result is returned.
5850 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
5852 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5853 Doc *doc = jxhtml->doc;
5855 char *attr_direction = NULL;
5856 char *attr_style = NULL;
5857 char *attr_color = NULL;
5858 char *attr_size = NULL;
5859 char *attr_bgcolor = NULL;
5860 /*--------------------------------------------------------------------------*/
5861 /* Get Attributes */
5862 /*--------------------------------------------------------------------------*/
5863 for (attr = qs_get_attr(doc,node);
5865 attr = qs_get_next_attr(doc,attr)) {
5866 char *name = qs_get_attr_name(doc,attr);
5867 char *value = qs_get_attr_value(doc,attr);
5868 if (STRCASEEQ('d','D',"direction", name)) {
5870 if (STRCASEEQ('l','L',"left",value)) {
5871 attr_direction = "rtl";
5873 else if (STRCASEEQ('r','R',"right",value)) {
5874 attr_direction = "ltr";
5878 else if (STRCASEEQ('b','B',"behavior",name)) {
5881 else if (STRCASEEQ('l','L',"loop",name)) {
5884 else if (STRCASEEQ('b','B',"bgcolor",name)) {
5885 if (value && *value) {
5886 attr_bgcolor = value;
5889 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5893 if (IS_CSS_ON(jxhtml->entryp)) {
5894 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5896 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5897 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5898 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
5899 css_property_t *direction_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
5900 css_property_t *cur;
5901 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5902 if (cur->value && *cur->value) {
5903 attr_color = apr_pstrdup(doc->pool, cur->value);
5906 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
5907 if (cur->value && *cur->value) {
5908 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
5911 for (cur = direction_prop->next; cur != direction_prop; cur = cur->next) {
5912 if (cur->value && *cur->value) {
5913 attr_direction = apr_pstrdup(doc->pool, cur->value);
5916 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5917 if (cur->value && *cur->value) {
5918 if ( STRCASEEQ('x','X',"xx-small",cur->value)
5919 || STRCASEEQ('x','X',"x-small", cur->value)
5920 || STRCASEEQ('s','S',"small", cur->value)
5921 || STRCASEEQ('m','M',"medium", cur->value)
5922 || STRCASEEQ('l','L',"large", cur->value)
5923 || STRCASEEQ('x','X',"x-large", cur->value)
5924 || STRCASEEQ('x','X',"xx-large",cur->value)) {
5925 attr_size = apr_pstrdup(doc->pool, cur->value);
5932 if (attr_color || attr_size || attr_direction || attr_bgcolor) {
5934 if (attr_direction) {
5935 W_L("-wap-marquee-dir:");
5936 W_V(attr_direction);
5940 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
5941 W_L("background-color:");
5946 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5965 * It is a handler who processes the MARQUEE tag.
5967 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5968 * destination is specified.
5969 * @param node [i] The MARQUEE tag node is specified.
5970 * @return The conversion result is returned.
5973 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(node))
5975 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5976 Doc *doc = jxhtml->doc;
5978 if (IS_CSS_ON(jxhtml->entryp)) {
5979 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5986 * It is handler who processes the New Line Code.
5989 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
5991 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5992 if (jxhtml->start_html_flag) {
5993 Doc *doc = jxhtml->doc;
6001 * It is a handler who processes the LINK tag.
6003 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
6004 * destination is specified.
6005 * @param node [i] The LINK tag node is specified.
6006 * @return The conversion result is returned.
6009 s_jxhtml_link_tag(void *pdoc, Node *node)
6018 jxhtml = GET_JXHTML(pdoc);
6021 if (! IS_CSS_ON(jxhtml->entryp)) {
6025 for (attr = qs_get_attr(doc,node);
6027 attr = qs_get_next_attr(doc,attr)) {
6028 char *name = qs_get_attr_name(doc,attr);
6029 char *value = qs_get_attr_value(doc,attr);
6030 if (STRCASEEQ('r','R',"rel", name)) {
6031 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
6035 else if (STRCASEEQ('h','H',"href", name)) {
6036 if (value && *value) {
6040 else if (STRCASEEQ('t','T',"type", name)) {
6041 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6047 if (rel && href && type) {
6048 DBG(doc->r, "start load CSS. url:[%s]", href);
6049 jxhtml->style = chxj_css_parse_from_uri(doc->r, doc->pool, jxhtml->style, href);
6050 DBG(doc->r, "end load CSS. url:[%s]", href);
6057 static css_prop_list_t *
6058 s_jxhtml_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6060 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
6061 Doc *doc = jxhtml->doc;
6062 css_prop_list_t *last_css = NULL;
6063 if (IS_CSS_ON(jxhtml->entryp)) {
6064 css_prop_list_t *dup_css;
6065 css_selector_t *selector;
6067 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
6068 dup_css = chxj_dup_css_prop_list(doc, last_css);
6069 selector = chxj_css_find_selector(doc, jxhtml->style, node);
6071 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6073 chxj_css_push_prop_list(jxhtml->css_prop_stack, dup_css);
6074 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
6076 if (style_attr_value) {
6077 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
6079 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6087 static css_prop_list_t *
6088 s_jxhtml_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
6090 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
6091 Doc *doc = jxhtml->doc;
6092 css_prop_list_t *last_css = NULL;
6093 if (IS_CSS_ON(jxhtml->entryp)) {
6094 css_prop_list_t *dup_css;
6095 css_selector_t *selector;
6097 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
6098 dup_css = chxj_dup_css_prop_list(doc, last_css);
6099 selector = chxj_css_find_selector(doc, jxhtml->style, node);
6101 chxj_css_prop_list_merge_property(doc, dup_css, selector);
6105 if (style_attr_value) {
6106 css_stylesheet_t *ssheet = chxj_css_parse_style_attr(doc, NULL, apr_pstrdup(doc->pool, node->name), NULL, NULL, apr_pstrdup(doc->pool, style_attr_value));
6108 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
6117 * It is a handler who processes the SPAN tag.
6119 * @param pdoc [i/o] The pointer to the JHTML structure at the output
6120 * destination is specified.
6121 * @param node [i] The SPAN tag node is specified.
6122 * @return The conversion result is returned.
6125 s_jxhtml_start_span_tag(void *pdoc, Node *node)
6130 char *attr_style = NULL;
6131 char *attr_color = NULL;
6132 char *attr_size = NULL;
6133 char *attr_align = NULL;
6134 char *attr_blink = NULL;
6135 char *attr_marquee = NULL;
6136 char *attr_marquee_dir = NULL;
6137 char *attr_marquee_style = NULL;
6138 char *attr_marquee_loop = NULL;
6139 char *css_bgcolor = NULL;
6141 jxhtml = GET_JXHTML(pdoc);
6144 for (attr = qs_get_attr(doc,node);
6146 attr = qs_get_next_attr(doc,attr)) {
6147 char *nm = qs_get_attr_name(doc,attr);
6148 char *val = qs_get_attr_value(doc,attr);
6149 if (val && STRCASEEQ('s','S',"style", nm)) {
6153 if (IS_CSS_ON(jxhtml->entryp)) {
6154 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
6156 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
6157 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
6158 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
6159 css_property_t *decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
6160 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
6161 css_property_t *marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
6162 css_property_t *marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
6163 css_property_t *marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
6164 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
6166 css_property_t *cur;
6167 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
6168 attr_color = apr_pstrdup(doc->pool, cur->value);
6170 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
6171 if (cur->value && *cur->value) {
6172 if ( STRCASEEQ('x','X',"xx-small",cur->value)
6173 || STRCASEEQ('x','X',"x-small", cur->value)
6174 || STRCASEEQ('s','S',"small", cur->value)
6175 || STRCASEEQ('m','M',"medium", cur->value)
6176 || STRCASEEQ('l','L',"large", cur->value)
6177 || STRCASEEQ('x','X',"x-large", cur->value)
6178 || STRCASEEQ('x','X',"xx-large",cur->value)) {
6179 attr_size = apr_pstrdup(doc->pool, cur->value);
6183 for (cur = decoration_prop->next; cur != decoration_prop; cur = cur->next) {
6184 if (cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
6185 attr_blink = apr_pstrdup(doc->pool, cur->value);
6188 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
6189 if (cur->value && strcasecmp("-wap-marquee",cur->value) == 0) {
6190 attr_marquee = apr_pstrdup(doc->pool, cur->value);
6193 for (cur = marquee_dir_prop->next; cur != marquee_dir_prop; cur = cur->next) {
6194 if (cur->value && *cur->value) {
6195 if ( STRCASEEQ('l','L',"ltr",cur->value)
6196 || STRCASEEQ('r','R',"rtl",cur->value)) {
6197 attr_marquee_dir = apr_pstrdup(doc->pool, cur->value);
6201 for (cur = marquee_style_prop->next; cur != marquee_style_prop; cur = cur->next) {
6202 if (cur->value && *cur->value) {
6203 if ( STRCASEEQ('s','S',"scroll",cur->value)
6204 || STRCASEEQ('s','S',"slide",cur->value)
6205 || STRCASEEQ('a','A',"alternate",cur->value)) {
6206 attr_marquee_style = apr_pstrdup(doc->pool, cur->value);
6210 for (cur = marquee_loop_prop->next; cur != marquee_loop_prop; cur = cur->next) {
6211 if (cur->value && *cur->value) {
6212 if(strcmp(cur->value,"0") == 0 || strcmp(cur->value,"-1") == 0){
6213 attr_marquee_loop = "infinite";
6216 attr_marquee_loop = apr_pstrdup(doc->pool, cur->value);
6220 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
6221 if (STRCASEEQ('l','L',"left", cur->value)) {
6222 attr_align = apr_pstrdup(doc->pool, "left");
6224 else if (STRCASEEQ('c','C',"center",cur->value)) {
6225 attr_align = apr_pstrdup(doc->pool, "center");
6227 else if (STRCASEEQ('r','R',"right",cur->value)) {
6228 attr_align = apr_pstrdup(doc->pool, "right");
6231 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
6232 if (cur->value && *cur->value) {
6233 css_bgcolor = apr_pstrdup(doc->pool, cur->value);
6240 if (attr_color || attr_size || attr_align || attr_blink || attr_marquee || css_bgcolor) {
6243 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
6259 W_L("text-decoration:");
6264 W_L("display:-wap-marquee;");
6265 if (attr_marquee_dir) {
6266 W_L("-wap-marquee-dir:");
6267 W_V(attr_marquee_dir);
6270 if (attr_marquee_style) {
6271 W_L("-wap-marquee-style:");
6272 W_V(attr_marquee_style);
6275 if (attr_marquee_loop) {
6276 W_L("-wap-marquee-loop:");
6277 W_V(attr_marquee_loop);
6282 W_L("background-color:");
6294 * It is a handler who processes the SPAN tag.
6296 * @param pdoc [i/o] The pointer to the JHTML structure at the output
6297 * destination is specified.
6298 * @param node [i] The SPAN tag node is specified.
6299 * @return The conversion result is returned.
6302 s_jxhtml_end_span_tag(void *pdoc, Node *UNUSED(node))
6304 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
6305 Doc *doc = jxhtml->doc;
6308 if (IS_CSS_ON(jxhtml->entryp)) {
6309 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
6316 * It is a handler who processes the STYLE tag.
6318 * @param pdoc [i/o] The pointer to the SoftBank XHTML structure at the output
6319 * destination is specified.
6320 * @param node [i] The STYLE tag node is specified.
6321 * @return The conversion result is returned.
6324 s_jxhtml_style_tag(void *pdoc, Node *node)
6331 jxhtml = GET_JXHTML(pdoc);
6334 if (! IS_CSS_ON(jxhtml->entryp)) {
6338 for (attr = qs_get_attr(doc,node);
6340 attr = qs_get_next_attr(doc,attr)) {
6341 char *name = qs_get_attr_name(doc,attr);
6342 char *value = qs_get_attr_value(doc,attr);
6343 if (STRCASEEQ('t','T',"type", name)) {
6344 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
6350 Node *child = qs_get_child_node(doc, node);
6351 if (type && child) {
6352 char *name = qs_get_node_name(doc, child);
6353 if (STRCASEEQ('t','T',"text", name)) {
6354 char *value = qs_get_node_value(doc, child);
6355 DBG(doc->r, "start load CSS. buf:[%s]", value);
6356 jxhtml->style = chxj_css_parse_style_value(doc, jxhtml->style, value);
6357 DBG(doc->r, "end load CSS. value:[%s]", value);