2 * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "chxj_jxhtml.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_header_inf.h"
26 #include "chxj_jreserved_tag.h"
27 #include "chxj_conv_z2h.h"
30 #define GET_JXHTML(X) ((jxhtml_t *)(X))
33 #define W_L(X) do { jxhtml->out = BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, (X)); } while(0)
34 #define W_V(X) do { jxhtml->out = (X) ? BUFFERED_WRITE_VALUE(jxhtml->out, &doc->buf, (X)) \
35 : BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, ""); } while(0)
37 #define W_NLCODE() do { char *nlcode = TO_NLCODE(jxhtml->conf); W_V(nlcode); } while (0)
39 static char *s_jxhtml_start_html_tag (void *pdoc, Node *node);
40 static char *s_jxhtml_end_html_tag (void *pdoc, Node *node);
41 static char *s_jxhtml_start_meta_tag (void *pdoc, Node *node);
42 static char *s_jxhtml_end_meta_tag (void *pdoc, Node *node);
43 static char *s_jxhtml_start_head_tag (void *pdoc, Node *node);
44 static char *s_jxhtml_end_head_tag (void *pdoc, Node *node);
45 static char *s_jxhtml_start_title_tag (void *pdoc, Node *node);
46 static char *s_jxhtml_end_title_tag (void *pdoc, Node *node);
47 static char *s_jxhtml_start_base_tag (void *pdoc, Node *node);
48 static char *s_jxhtml_end_base_tag (void *pdoc, Node *node);
49 static char *s_jxhtml_start_body_tag (void *pdoc, Node *node);
50 static char *s_jxhtml_end_body_tag (void *pdoc, Node *node);
51 static char *s_jxhtml_start_a_tag (void *pdoc, Node *node);
52 static char *s_jxhtml_end_a_tag (void *pdoc, Node *node);
53 static char *s_jxhtml_start_pre_tag (void *pdoc, Node *node);
54 static char *s_jxhtml_end_pre_tag (void *pdoc, Node *node);
55 static char *s_jxhtml_start_p_tag (void *pdoc, Node *node);
56 static char *s_jxhtml_end_p_tag (void *pdoc, Node *node);
57 static char *s_jxhtml_start_ul_tag (void *pdoc, Node *node);
58 static char *s_jxhtml_end_ul_tag (void *pdoc, Node *node);
59 static char *s_jxhtml_start_ol_tag (void *pdoc, Node *node);
60 static char *s_jxhtml_end_ol_tag (void *pdoc, Node *node);
61 static char *s_jxhtml_start_li_tag (void *pdoc, Node *node);
62 static char *s_jxhtml_end_li_tag (void *pdoc, Node *node);
63 static char *s_jxhtml_start_br_tag (void *pdoc, Node *node);
64 static char *s_jxhtml_end_br_tag (void *pdoc, Node *node);
65 static char *s_jxhtml_start_tr_tag (void *pdoc, Node *node);
66 static char *s_jxhtml_end_tr_tag (void *pdoc, Node *node);
67 static char *s_jxhtml_start_font_tag (void *pdoc, Node *node);
68 static char *s_jxhtml_end_font_tag (void *pdoc, Node *node);
69 static char *s_jxhtml_start_form_tag (void *pdoc, Node *node);
70 static char *s_jxhtml_end_form_tag (void *pdoc, Node *node);
71 static char *s_jxhtml_start_input_tag (void *pdoc, Node *node);
72 static char *s_jxhtml_end_input_tag (void *pdoc, Node *node);
73 static char *s_jxhtml_start_center_tag (void *pdoc, Node *node);
74 static char *s_jxhtml_end_center_tag (void *pdoc, Node *node);
75 static char *s_jxhtml_start_hr_tag (void *pdoc, Node *node);
76 static char *s_jxhtml_end_hr_tag (void *pdoc, Node *node);
77 static char *s_jxhtml_start_img_tag (void *pdoc, Node *node);
78 static char *s_jxhtml_end_img_tag (void *pdoc, Node *node);
79 static char *s_jxhtml_start_select_tag (void *pdoc, Node *node);
80 static char *s_jxhtml_end_select_tag (void *pdoc, Node *node);
81 static char *s_jxhtml_start_option_tag (void *pdoc, Node *node);
82 static char *s_jxhtml_end_option_tag (void *pdoc, Node *node);
83 static char *s_jxhtml_start_div_tag (void *pdoc, Node *node);
84 static char *s_jxhtml_end_div_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
86 static char *s_jxhtml_end_textarea_tag (void *pdoc, Node *node);
87 static char *s_jxhtml_start_b_tag (void *pdoc, Node *node);
88 static char *s_jxhtml_end_b_tag (void *pdoc, Node *node);
89 static char *s_jxhtml_chxjif_tag (void *pdoc, Node *node);
90 static char *s_jxhtml_text_tag (void *pdoc, Node *node);
91 static char *s_jxhtml_start_blockquote_tag (void *pdoc, Node *node);
92 static char *s_jxhtml_end_blockquote_tag (void *pdoc, Node *node);
93 static char *s_jxhtml_start_dir_tag (void *pdoc, Node *node);
94 static char *s_jxhtml_end_dir_tag (void *pdoc, Node *node);
95 static char *s_jxhtml_start_dl_tag (void *pdoc, Node *node);
96 static char *s_jxhtml_end_dl_tag (void *pdoc, Node *node);
97 static char *s_jxhtml_start_dt_tag (void *pdoc, Node *node);
98 static char *s_jxhtml_end_dt_tag (void *pdoc, Node *node);
99 static char *s_jxhtml_start_dd_tag (void *pdoc, Node *node);
100 static char *s_jxhtml_end_dd_tag (void *pdoc, Node *node);
101 static char *s_jxhtml_start_h1_tag (void *pdoc, Node *node);
102 static char *s_jxhtml_end_h1_tag (void *pdoc, Node *node);
103 static char *s_jxhtml_start_h2_tag (void *pdoc, Node *node);
104 static char *s_jxhtml_end_h2_tag (void *pdoc, Node *node);
105 static char *s_jxhtml_start_h3_tag (void *pdoc, Node *node);
106 static char *s_jxhtml_end_h3_tag (void *pdoc, Node *node);
107 static char *s_jxhtml_start_h4_tag (void *pdoc, Node *node);
108 static char *s_jxhtml_end_h4_tag (void *pdoc, Node *node);
109 static char *s_jxhtml_start_h5_tag (void *pdoc, Node *node);
110 static char *s_jxhtml_end_h5_tag (void *pdoc, Node *node);
111 static char *s_jxhtml_start_h6_tag (void *pdoc, Node *node);
112 static char *s_jxhtml_end_h6_tag (void *pdoc, Node *node);
113 static char *s_jxhtml_start_menu_tag (void *pdoc, Node *node);
114 static char *s_jxhtml_end_menu_tag (void *pdoc, Node *node);
115 static char *s_jxhtml_start_plaintext_tag (void *pdoc, Node *node);
116 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
117 static char *s_jxhtml_end_plaintext_tag (void *pdoc, Node *node);
118 static char *s_jxhtml_start_blink_tag (void *pdoc, Node *node);
119 static char *s_jxhtml_end_blink_tag (void *pdoc, Node *node);
120 static char *s_jxhtml_start_marquee_tag (void *pdoc, Node *node);
121 static char *s_jxhtml_end_marquee_tag (void *pdoc, Node *node);
122 static char *s_jxhtml_newline_mark (void *pdoc, Node *node);
123 static char *s_jxhtml_link_tag (void *pdoc, Node *node);
124 static char *s_jxhtml_start_span_tag (void *pdoc, Node *node);
125 static char *s_jxhtml_end_span_tag (void *pdoc, Node *node);
126 static char *s_jxhtml_style_tag (void *pdoc, Node *node);
128 static void s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
130 static int s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
132 static css_prop_list_t *s_jxhtml_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
133 static css_prop_list_t *s_jxhtml_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value);
137 tag_handler jxhtml_handler[] = {
140 s_jxhtml_start_html_tag,
141 s_jxhtml_end_html_tag,
145 s_jxhtml_start_meta_tag,
146 s_jxhtml_end_meta_tag,
150 s_jxhtml_start_textarea_tag,
151 s_jxhtml_end_textarea_tag,
155 s_jxhtml_start_p_tag,
160 s_jxhtml_start_pre_tag,
161 s_jxhtml_end_pre_tag,
165 s_jxhtml_start_ul_tag,
170 s_jxhtml_start_li_tag,
175 s_jxhtml_start_ol_tag,
180 s_jxhtml_start_h1_tag,
185 s_jxhtml_start_h2_tag,
190 s_jxhtml_start_h3_tag,
195 s_jxhtml_start_h4_tag,
200 s_jxhtml_start_h5_tag,
205 s_jxhtml_start_h6_tag,
210 s_jxhtml_start_head_tag,
211 s_jxhtml_end_head_tag,
215 s_jxhtml_start_title_tag,
216 s_jxhtml_end_title_tag,
220 s_jxhtml_start_base_tag,
221 s_jxhtml_end_base_tag,
225 s_jxhtml_start_body_tag,
226 s_jxhtml_end_body_tag,
230 s_jxhtml_start_a_tag,
235 s_jxhtml_start_br_tag,
245 s_jxhtml_start_tr_tag,
260 s_jxhtml_start_font_tag,
261 s_jxhtml_end_font_tag,
265 s_jxhtml_start_form_tag,
266 s_jxhtml_end_form_tag,
270 s_jxhtml_start_input_tag,
271 s_jxhtml_end_input_tag,
275 s_jxhtml_start_center_tag,
276 s_jxhtml_end_center_tag,
280 s_jxhtml_start_hr_tag,
285 s_jxhtml_start_img_tag,
286 s_jxhtml_end_img_tag,
290 s_jxhtml_start_select_tag,
291 s_jxhtml_end_select_tag,
295 s_jxhtml_start_option_tag,
296 s_jxhtml_end_option_tag,
300 s_jxhtml_start_div_tag,
301 s_jxhtml_end_div_tag,
330 s_jxhtml_start_span_tag,
331 s_jxhtml_end_span_tag,
345 s_jxhtml_start_b_tag,
355 s_jxhtml_start_dt_tag,
370 s_jxhtml_start_blockquote_tag,
371 s_jxhtml_end_blockquote_tag,
375 s_jxhtml_start_dir_tag,
376 s_jxhtml_end_dir_tag,
380 s_jxhtml_start_dl_tag,
385 s_jxhtml_start_dd_tag,
390 s_jxhtml_start_menu_tag,
391 s_jxhtml_end_menu_tag,
395 s_jxhtml_start_plaintext_tag,
396 s_jxhtml_end_plaintext_tag,
400 s_jxhtml_start_blink_tag,
401 s_jxhtml_end_blink_tag,
405 s_jxhtml_start_marquee_tag,
406 s_jxhtml_end_marquee_tag,
415 s_jxhtml_newline_mark,
422 * converts from CHTML5.0 to JXHTML.
424 * @param r [i] Requet_rec is appointed.
425 * @param spec [i] The result of the device specification processing which
426 * was done in advance is appointed.
427 * @param src [i] The character string before the converting is appointed.
428 * @return The character string after the converting is returned.
437 chxjconvrule_entry *entryp,
448 /*--------------------------------------------------------------------------*/
450 /*--------------------------------------------------------------------------*/
452 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
454 DBG(r,"I found qrcode xml");
457 DBG(r,"not found qrcode xml");
459 /*--------------------------------------------------------------------------*/
460 /* The CHTML structure is initialized. */
461 /*--------------------------------------------------------------------------*/
462 s_init_jxhtml(&jxhtml, &doc, r, spec);
464 jxhtml.entryp = entryp;
465 jxhtml.cookie = cookie;
467 chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
469 /*--------------------------------------------------------------------------*/
470 /* The character string of the input is analyzed. */
471 /*--------------------------------------------------------------------------*/
472 qs_init_malloc(&doc);
473 qs_init_root_node(&doc);
475 ss = apr_pcalloc(r->pool, srclen + 1);
477 memset(ss, 0, srclen + 1);
478 memcpy(ss, src, srclen);
480 if (IS_CSS_ON(jxhtml.entryp)) {
481 /* current property list */
482 jxhtml.css_prop_stack = chxj_new_prop_list_stack(&doc);
485 chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
488 qs_parse_string(&doc,ss,strlen(ss));
490 chxj_buffered_write_init(r->pool, &doc.buf);
491 /*--------------------------------------------------------------------------*/
492 /* It converts it from CHTML to JXHTML. */
493 /*--------------------------------------------------------------------------*/
494 chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
495 jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
496 dst = apr_pstrdup(r->pool, jxhtml.out);
497 chxj_buffered_write_terminate(&doc.buf);
500 qs_all_free(&doc,QX_LOGMARK);
503 return apr_pstrdup(r->pool,ss);
506 dst = apr_psprintf(r->pool, "\n");
508 *dstlen = strlen(dst);
511 chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
519 * The JXHTML structure is initialized.
521 * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
522 * initialized is specified.
523 * @param doc [i] The Doc structure that should be set to the initialized
524 * JXHTML structure is specified.
525 * @param r [i] To use POOL, the pointer to request_rec is specified.
526 * @param spec [i] The pointer to the device_table
529 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
531 memset(doc, 0, sizeof(Doc));
532 memset(jxhtml, 0, sizeof(jxhtml_t));
537 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
538 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
539 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
544 * Corresponding EMOJI to a current character-code is retrieved.
545 * The substitution character string is stored in the rslt pointer if agreeing.
547 * @param jxhtml [i] The pointer to the JXHTML structure is specified.
548 * @param txt [i] The character string to want to examine whether it is
549 * EMOJI is specified.
550 * @param rslt [o] The pointer to the pointer that stores the result is
552 * @return When corresponding EMOJI exists, it returns it excluding 0.
555 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
567 if (! spec) DBG(r,"spec is NULL");
569 for (ee = jxhtml->conf->emoji;
573 unsigned char hex1byte;
574 unsigned char hex2byte;
577 DBG(r,"emoji->imode is NULL");
581 hex1byte = ee->imode->hex1byte & 0xff;
582 hex2byte = ee->imode->hex2byte & 0xff;
584 if (ee->imode->string
585 && strlen(ee->imode->string) > 0
586 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
587 if (spec == NULL || spec->emoji_type == NULL) {
588 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
589 return strlen(ee->imode->string);
596 && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
597 && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
598 if (spec == NULL || spec->emoji_type == NULL) {
599 *rslt = apr_psprintf(r->pool,"
\e%s
\ f", ee->jphone->string);
612 chxj_jxhtml_emoji_only_converter(request_rec *r, device_table *spec, const char *src, apr_size_t len)
626 DBG(r, "REQ[%X] start chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
627 memset(doc, 0, sizeof(Doc));
628 memset(jxhtml, 0, sizeof(jxhtml_t));
633 jxhtml->out = qs_alloc_zero_byte_string(r->pool);
634 jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
635 jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
637 apr_pool_create(&pool, r->pool);
639 chxj_buffered_write_init(pool, &doc->buf);
641 for (ii=0; ii<len; ii++) {
645 rtn = s_jxhtml_search_emoji(jxhtml, (char *)&src[ii], &out);
652 if (is_sjis_kanji(src[ii])) {
653 two_byte[0] = src[ii+0];
654 two_byte[1] = src[ii+1];
660 one_byte[0] = src[ii+0];
665 jxhtml->out = chxj_buffered_write_flush(jxhtml->out, &doc->buf);
667 DBG(r, "REQ[%X] end chxj_jxhtml_emoji_eonly_converter()", (unsigned int)(apr_size_t)r);
673 * It is a handler who processes the HTML tag.
675 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
676 * destination is specified.
677 * @param node [i] The HTML tag node is specified.
678 * @return The conversion result is returned.
681 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node))
688 jxhtml = GET_JXHTML(pdoc);
691 DBG(r, "REQ[%X] start s_jxhtml_start_html_tag()", TO_ADDR(r));
693 W_L("<?xml version=\"1.0\" encoding=\"Shift_JIS\" ?>");
695 W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"xhtml-basic10-plus.dtd\">");
698 /*--------------------------------------------------------------------------*/
700 /*--------------------------------------------------------------------------*/
701 W_L("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"ja\" xml:lang=\"ja\">");
703 jxhtml->start_html_flag = 1;
705 DBG(r, "REQ[%X] end s_jxhtml_start_html_tag()", TO_ADDR(r));
712 * It is a handler who processes the HTML tag.
714 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
715 * destination is specified.
716 * @param node [i] The HTML tag node is specified.
717 * @return The conversion result is returned.
720 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child))
722 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
723 Doc *doc = jxhtml->doc;
732 * It is a handler who processes the META tag.
734 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
735 * destination is specified.
736 * @param node [i] The META tag node is specified.
737 * @return The conversion result is returned.
740 s_jxhtml_start_meta_tag(void *pdoc, Node *node)
746 int content_type_flag;
749 jxhtml = GET_JXHTML(pdoc);
753 content_type_flag = 0;
756 /*--------------------------------------------------------------------------*/
758 /*--------------------------------------------------------------------------*/
759 for (attr = qs_get_attr(doc,node);
761 attr = qs_get_next_attr(doc,attr)) {
762 char *name = qs_get_attr_name(doc,attr);
763 char *value = qs_get_attr_value(doc,attr);
767 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
768 /*----------------------------------------------------------------------*/
770 /*----------------------------------------------------------------------*/
771 W_L(" http-equiv=\"");
774 if (STRCASEEQ('c','C',"content-type",value)) {
775 content_type_flag = 1;
777 if (STRCASEEQ('r','R',"refresh",value)) {
785 if (strcasecmp(name, "content") == 0 && value && *value) {
786 /*----------------------------------------------------------------------*/
788 /*----------------------------------------------------------------------*/
789 if (content_type_flag) {
793 W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
802 buf = apr_pstrdup(r->pool, value);
804 url = strchr(buf, ';');
806 sec = apr_pstrdup(r->pool, buf);
809 url = chxj_encoding_parameter(r, url, 1);
839 * It is a handler who processes the META tag.
841 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
842 * destination is specified.
843 * @param node [i] The META tag node is specified.
844 * @return The conversion result is returned.
847 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child))
849 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
856 * It is a handler who processes the HEAD tag.
858 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
859 * destination is specified.
860 * @param node [i] The HEAD tag node is specified.
861 * @return The conversion result is returned.
864 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node))
870 jxhtml = GET_JXHTML(pdoc);
880 * It is a handler who processes the HEAD tag.
882 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
883 * destination is specified.
884 * @param node [i] The HEAD tag node is specified.
885 * @return The conversion result is returned.
888 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child))
894 jxhtml = GET_JXHTML(pdoc);
904 * It is a handler who processes the TITLE tag.
906 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
907 * destination is specified.
908 * @param node [i] The TITLE tag node is specified.
909 * @return The conversion result is returned.
912 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
918 jxhtml = GET_JXHTML(pdoc);
928 * It is a handler who processes the TITLE tag.
930 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
931 * destination is specified.
932 * @param node [i] The TITLE tag node is specified.
933 * @return The conversion result is returned.
936 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child))
942 jxhtml = GET_JXHTML(pdoc);
952 * It is a handler who processes the BASE tag.
954 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
955 * destination is specified.
956 * @param node [i] The BASE tag node is specified.
957 * @return The conversion result is returned.
960 s_jxhtml_start_base_tag(void *pdoc, Node *node)
967 jxhtml = GET_JXHTML(pdoc);
972 /*--------------------------------------------------------------------------*/
974 /*--------------------------------------------------------------------------*/
975 for (attr = qs_get_attr(doc,node);
977 attr = qs_get_next_attr(doc,attr)) {
978 char *name = qs_get_attr_name(doc,attr);
979 char *value = qs_get_attr_value(doc,attr);
980 if (STRCASEEQ('h','H',"href",name)) {
992 * It is a handler who processes the BASE tag.
994 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
995 * destination is specified.
996 * @param node [i] The BASE tag node is specified.
997 * @return The conversion result is returned.
1000 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child))
1002 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1008 * It is a handler who processes the BODY tag.
1010 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1011 * destination is specified.
1012 * @param node [i] The BODY tag node is specified.
1013 * @return The conversion result is returned.
1016 s_jxhtml_start_body_tag(void *pdoc, Node *node)
1022 char *attr_bgcolor = NULL;
1023 char *attr_text = NULL;
1024 char *attr_link = NULL;
1025 char *attr_style = NULL;
1027 jxhtml = GET_JXHTML(pdoc);
1031 /*--------------------------------------------------------------------------*/
1032 /* Get Attributes */
1033 /*--------------------------------------------------------------------------*/
1034 for (attr = qs_get_attr(doc,node);
1036 attr = qs_get_next_attr(doc,attr)) {
1037 char *name = qs_get_attr_name(doc,attr);
1038 char *value = qs_get_attr_value(doc,attr);
1039 if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
1040 /*----------------------------------------------------------------------*/
1042 /*----------------------------------------------------------------------*/
1043 attr_bgcolor = value;
1045 else if (STRCASEEQ('t','T',"text",name) && value && *value) {
1046 /*----------------------------------------------------------------------*/
1048 /*----------------------------------------------------------------------*/
1051 else if (STRCASEEQ('l','L',"link",name) && value && *value) {
1052 /*----------------------------------------------------------------------*/
1054 /*----------------------------------------------------------------------*/
1057 else if (STRCASEEQ('a','A',"alink",name)) {
1058 /*----------------------------------------------------------------------*/
1060 /*----------------------------------------------------------------------*/
1063 else if (STRCASEEQ('v','V',"vlink",name)) {
1064 /*----------------------------------------------------------------------*/
1066 /*----------------------------------------------------------------------*/
1069 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1074 if (IS_CSS_ON(jxhtml->entryp)) {
1075 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1077 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1078 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
1079 css_property_t *cur;
1080 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1081 if (cur->value && *cur->value) {
1082 attr_text = apr_pstrdup(doc->pool, cur->value);
1085 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
1086 if (cur->value && *cur->value) {
1087 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
1091 if (jxhtml->style) {
1092 css_stylesheet_t *pseudos = chxj_find_pseudo_selectors(doc, jxhtml->style);
1093 css_selector_t *cur_sel;
1094 for (cur_sel = pseudos->selector_head.next; cur_sel != &pseudos->selector_head; cur_sel = cur_sel->next) {
1095 if (cur_sel->name && strcasecmp(cur_sel->name, "a:link") == 0) {
1096 css_property_t *cur;
1097 for (cur = cur_sel->property_head.next; cur != &cur_sel->property_head; cur = cur->next) {
1098 if (cur->name && strcasecmp(cur->name, "color") == 0) {
1099 attr_link = apr_pstrdup(doc->pool, cur->value);
1109 if (attr_bgcolor || attr_text) {
1112 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
1113 W_L("background-color:");
1118 attr_text = chxj_css_rgb_func_to_value(doc->pool, attr_text);
1126 attr_link = chxj_css_rgb_func_to_value(doc->pool, attr_link);
1137 * It is a handler who processes the BODY tag.
1139 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1140 * destination is specified.
1141 * @param node [i] The BODY tag node is specified.
1142 * @return The conversion result is returned.
1145 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child))
1151 jxhtml = GET_JXHTML(pdoc);
1155 W_L("</div></body>");
1156 if (IS_CSS_ON(jxhtml->entryp)) {
1157 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1164 * It is a handler who processes the A tag.
1166 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1167 * destination is specified.
1168 * @param node [i] The A tag node is specified.
1169 * @return The conversion result is returned.
1172 s_jxhtml_start_a_tag(void *pdoc, Node *node)
1178 char *attr_style = NULL;
1180 jxhtml = GET_JXHTML(pdoc);
1185 /*--------------------------------------------------------------------------*/
1186 /* Get Attributes */
1187 /*--------------------------------------------------------------------------*/
1188 for (attr = qs_get_attr(doc,node);
1190 attr = qs_get_next_attr(doc,attr)) {
1191 char *name = qs_get_attr_name(doc,attr);
1192 char *value = qs_get_attr_value(doc,attr);
1193 if (STRCASEEQ('n','N',"name",name)) {
1194 /*----------------------------------------------------------------------*/
1196 /*----------------------------------------------------------------------*/
1198 W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1201 else if (STRCASEEQ('h','H',"href",name)) {
1202 /*----------------------------------------------------------------------*/
1204 /*----------------------------------------------------------------------*/
1205 value = chxj_encoding_parameter(r, value, 1);
1206 if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1207 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
1213 else if (STRCASEEQ('a','A',"accesskey",name)) {
1214 /*----------------------------------------------------------------------*/
1216 /*----------------------------------------------------------------------*/
1217 W_L(" accesskey=\"");
1221 else if (STRCASEEQ('c','C',"cti",name)) {
1222 /*----------------------------------------------------------------------*/
1224 /*----------------------------------------------------------------------*/
1229 else if (STRCASEEQ('i','I',"ijam",name)) {
1230 /*----------------------------------------------------------------------*/
1232 /*----------------------------------------------------------------------*/
1235 else if (STRCASEEQ('u','U',"utn",name)) {
1236 /*----------------------------------------------------------------------*/
1238 /* It is special only for CHTML. */
1239 /*----------------------------------------------------------------------*/
1242 else if (STRCASEEQ('t','T',"telbook",name)) {
1243 /*----------------------------------------------------------------------*/
1245 /*----------------------------------------------------------------------*/
1248 else if (STRCASEEQ('k','K',"kana",name)) {
1249 /*----------------------------------------------------------------------*/
1251 /*----------------------------------------------------------------------*/
1254 else if (STRCASEEQ('e','E',"email",name)) {
1255 /*----------------------------------------------------------------------*/
1257 /*----------------------------------------------------------------------*/
1260 else if (STRCASEEQ('i','I',"ista",name)) {
1261 /*----------------------------------------------------------------------*/
1263 /*----------------------------------------------------------------------*/
1266 else if (STRCASEEQ('i','I',"ilet",name)) {
1267 /*----------------------------------------------------------------------*/
1269 /*----------------------------------------------------------------------*/
1272 else if (STRCASEEQ('i','I',"iswf",name)) {
1273 /*----------------------------------------------------------------------*/
1275 /*----------------------------------------------------------------------*/
1278 else if (STRCASEEQ('i','I',"irst",name)) {
1279 /*----------------------------------------------------------------------*/
1281 /*----------------------------------------------------------------------*/
1284 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1285 /*----------------------------------------------------------------------*/
1287 /*----------------------------------------------------------------------*/
1293 if (IS_CSS_ON(jxhtml->entryp)) {
1294 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1302 * It is a handler who processes the A tag.
1304 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1305 * destination is specified.
1306 * @param node [i] The A tag node is specified.
1307 * @return The conversion result is returned.
1310 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child))
1316 jxhtml = GET_JXHTML(pdoc);
1322 if (IS_CSS_ON(jxhtml->entryp)) {
1323 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1331 * It is a handler who processes the BR tag.
1333 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1334 * destination is specified.
1335 * @param node [i] The BR tag node is specified.
1336 * @return The conversion result is returned.
1339 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1346 jxhtml = GET_JXHTML(pdoc);
1351 /*--------------------------------------------------------------------------*/
1352 /* Get Attributes */
1353 /*--------------------------------------------------------------------------*/
1354 for (attr = qs_get_attr(doc,node);
1356 attr = qs_get_next_attr(doc,attr)) {
1357 char *name = qs_get_attr_name(doc,attr);
1358 char *value = qs_get_attr_value(doc,attr);
1359 if (STRCASEEQ('c','C',"clear",name)) {
1360 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1373 * It is a handler who processes the BR tag.
1375 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1376 * destination is specified.
1377 * @param node [i] The BR tag node is specified.
1378 * @return The conversion result is returned.
1381 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child))
1383 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1389 * It is a handler who processes the TR tag.
1391 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1392 * destination is specified.
1393 * @param node [i] The TR tag node is specified.
1394 * @return The conversion result is returned.
1397 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1403 jxhtml = GET_JXHTML(pdoc);
1413 * It is a handler who processes the TR tag.
1415 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1416 * destination is specified.
1417 * @param node [i] The TR tag node is specified.
1418 * @return The conversion result is returned.
1421 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1423 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1429 * It is a handler who processes the FONT tag.
1431 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1432 * destination is specified.
1433 * @param node [i] The FONT tag node is specified.
1434 * @return The conversion result is returned.
1437 s_jxhtml_start_font_tag(void *pdoc, Node *node)
1443 char *attr_color = NULL;
1444 char *attr_size = NULL;
1445 char *attr_style = 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 *value = qs_get_attr_value(doc,attr);
1459 if (STRCASEEQ('c','C',"color",name) && value && *value) {
1460 attr_color = apr_pstrdup(doc->buf.pool, value);
1462 else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1463 /*----------------------------------------------------------------------*/
1465 /*----------------------------------------------------------------------*/
1466 attr_size = apr_pstrdup(doc->buf.pool, value);
1468 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
1469 attr_style = apr_pstrdup(doc->buf.pool, value);
1472 if (IS_CSS_ON(jxhtml->entryp)) {
1473 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1475 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1476 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
1477 css_property_t *cur;
1478 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1479 if (cur->value && *cur->value) {
1480 attr_color = apr_pstrdup(doc->pool, cur->value);
1483 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
1484 if (cur->value && *cur->value) {
1485 attr_size = apr_pstrdup(doc->pool, cur->value);
1486 if (STRCASEEQ('x','X',"xx-small",attr_size)) {
1487 attr_size = apr_pstrdup(doc->pool, "1");
1489 else if (STRCASEEQ('x','X',"x-small",attr_size)) {
1490 attr_size = apr_pstrdup(doc->pool, "2");
1492 else if (STRCASEEQ('s','S',"small",attr_size)) {
1493 attr_size = apr_pstrdup(doc->pool, "3");
1495 else if (STRCASEEQ('m','M',"medium",attr_size)) {
1496 attr_size = apr_pstrdup(doc->pool, "4");
1498 else if (STRCASEEQ('l','L',"large",attr_size)) {
1499 attr_size = apr_pstrdup(doc->pool, "5");
1501 else if (STRCASEEQ('x','X',"x-large",attr_size)) {
1502 attr_size = apr_pstrdup(doc->pool, "6");
1504 else if (STRCASEEQ('x','X',"xx-large",attr_size)) {
1505 attr_size = apr_pstrdup(doc->pool, "7");
1511 jxhtml_flags_t *flg = (jxhtml_flags_t *)apr_palloc(doc->pool, sizeof(*flg));
1512 memset(flg, 0, sizeof(*flg));
1514 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
1515 W_L("<font color=\"");
1518 flg->font_color_flag = 1;
1521 flg->font_size_flag = 1;
1522 switch(*attr_size) {
1523 case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1524 case '2': W_L("<span style=\"font-size: x-small\">"); break;
1525 case '3': W_L("<span style=\"font-size: small\">"); break;
1526 case '4': W_L("<span style=\"font-size: medium\">"); break;
1527 case '5': W_L("<span style=\"font-size: large\">"); break;
1528 case '6': W_L("<span style=\"font-size: x-large\">"); break;
1529 case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1531 if (*(attr_size + 1) == '1') {
1532 W_L("<span style=\"font-size: small\">");
1535 if (*(attr_size + 1) == '2') {
1536 W_L("<span style=\"font-size: x-small\">");
1539 if (*(attr_size + 1) == '3') {
1540 W_L("<span style=\"font-size: xx-small\">");
1543 flg->font_size_flag = 0;
1547 if (*(attr_size + 1) == '1') {
1548 W_L("<span style=\"font-size: large\">");
1551 if (*(attr_size + 1) == '2') {
1552 W_L("<span style=\"font-size: x-large\">");
1555 if (*(attr_size + 1) == '3') {
1556 W_L("<span style=\"font-size: xx-large\">");
1559 flg->font_size_flag = 0;
1563 WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", attr_size);
1564 flg->font_size_flag = 0;
1567 node->userData = flg;
1573 * It is a handler who processes the FONT tag.
1575 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1576 * destination is specified.
1577 * @param node [i] The FONT tag node is specified.
1578 * @return The conversion result is returned.
1581 s_jxhtml_end_font_tag(void *pdoc, Node *node)
1587 jxhtml = GET_JXHTML(pdoc);
1591 jxhtml_flags_t *flg = (jxhtml_flags_t *)node->userData;
1592 if (flg && flg->font_size_flag) {
1595 if (flg && flg->font_color_flag) {
1598 if (IS_CSS_ON(jxhtml->entryp)) {
1599 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1607 * It is a handler who processes the FORM tag.
1609 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1610 * destination is specified.
1611 * @param node [i] The FORM tag node is specified.
1612 * @return The conversion result is returned.
1615 s_jxhtml_start_form_tag(void *pdoc, Node *node)
1621 char *attr_action = NULL;
1622 char *attr_method = NULL;
1623 char *attr_style = NULL;
1624 char *attr_color = NULL;
1625 char *attr_align = NULL;
1626 char *attr_name = NULL;
1627 char *new_hidden_tag = NULL;
1629 jxhtml = GET_JXHTML(pdoc);
1633 /*--------------------------------------------------------------------------*/
1634 /* Get Attributes */
1635 /*--------------------------------------------------------------------------*/
1636 for (attr = qs_get_attr(doc,node);
1638 attr = qs_get_next_attr(doc,attr)) {
1639 char *name = qs_get_attr_name(doc,attr);
1640 char *value = qs_get_attr_value(doc,attr);
1644 if (strcasecmp(name, "action") == 0) {
1645 /*--------------------------------------------------------------------*/
1647 /*--------------------------------------------------------------------*/
1648 attr_action = value;
1654 if (strcasecmp(name, "method") == 0) {
1655 /*--------------------------------------------------------------------*/
1657 /*--------------------------------------------------------------------*/
1658 attr_method = value;
1664 if (strcasecmp(name, "name") == 0) {
1665 /*--------------------------------------------------------------------*/
1667 /*--------------------------------------------------------------------*/
1674 if (strcasecmp(name, "style") == 0) {
1683 if (IS_CSS_ON(jxhtml->entryp)) {
1684 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
1686 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
1687 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
1688 css_property_t *cur;
1689 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
1690 if (STRCASEEQ('l','L',"left", cur->value)) {
1691 attr_align = apr_pstrdup(doc->pool, "left");
1693 else if (STRCASEEQ('c','C',"center",cur->value)) {
1694 attr_align = apr_pstrdup(doc->pool, "center");
1696 else if (STRCASEEQ('r','R',"right",cur->value)) {
1697 attr_align = apr_pstrdup(doc->pool, "right");
1700 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
1701 attr_color = apr_pstrdup(doc->pool, cur->value);
1706 int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1710 attr_action = chxj_encoding_parameter(r, attr_action, 1);
1711 attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1713 char *old_qs = NULL;
1714 q = strchr(attr_action, '?');
1716 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);
1717 if (new_hidden_tag || old_qs) {
1741 jxhtml_flags_t *flg = (jxhtml_flags_t *)apr_palloc(doc->pool, sizeof(jxhtml_flags_t));
1742 memset(flg, 0, sizeof(*flg));
1744 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
1745 W_L("<font color=\"");
1748 flg->with_font_flag = 1;
1751 W_L("<div align=\"");
1754 flg->with_div_flag = 1;
1756 node->userData = flg;
1757 if (new_hidden_tag) {
1758 W_V(new_hidden_tag);
1765 * It is a handler who processes the FORM tag.
1767 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1768 * destination is specified.
1769 * @param node [i] The FORM tag node is specified.
1770 * @return The conversion result is returned.
1773 s_jxhtml_end_form_tag(void *pdoc, Node *node)
1775 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1776 Doc *doc = jxhtml->doc;
1778 jxhtml_flags_t *flg = (jxhtml_flags_t *)node->userData;
1779 if (flg && flg->with_div_flag) {
1782 if (flg && flg->with_font_flag) {
1786 if (IS_CSS_ON(jxhtml->entryp)) {
1787 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
1795 * It is a handler who processes the INPUT tag.
1797 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
1798 * destination is specified.
1799 * @param node [i] The INPUT tag node is specified.
1800 * @return The conversion result is returned.
1803 s_jxhtml_start_input_tag(void *pdoc, Node *node)
1809 char *attr_accesskey = NULL;
1810 char *attr_max_length = NULL;
1811 char *attr_type = NULL;
1812 char *attr_name = NULL;
1813 char *attr_value = NULL;
1814 char *attr_istyle = NULL;
1815 char *attr_size = NULL;
1816 char *attr_checked = NULL;
1817 char *attr_style = NULL;
1819 jxhtml = GET_JXHTML(pdoc);
1823 /*--------------------------------------------------------------------------*/
1824 /* Get Attributes */
1825 /*--------------------------------------------------------------------------*/
1826 for (attr = qs_get_attr(doc,node);
1828 attr = qs_get_next_attr(doc,attr)) {
1829 char *name = qs_get_attr_name(doc,attr);
1830 char *value = qs_get_attr_value(doc,attr);
1831 if (STRCASEEQ('t','T',"type",name) && value && *value) {
1832 char *tmp_type = qs_trim_string(doc->buf.pool, value);
1833 if (tmp_type && (STRCASEEQ('t','T',"text", tmp_type) ||
1834 STRCASEEQ('p','P',"password",tmp_type) ||
1835 STRCASEEQ('c','C',"checkbox",tmp_type) ||
1836 STRCASEEQ('r','R',"radio", tmp_type) ||
1837 STRCASEEQ('h','H',"hidden", tmp_type) ||
1838 STRCASEEQ('s','S',"submit", tmp_type) ||
1839 STRCASEEQ('r','R',"reset", tmp_type))) {
1840 attr_type = tmp_type;
1843 else if (STRCASEEQ('n','N',"name",name) && value && *value) {
1846 else if (STRCASEEQ('v','V',"value",name) && value && *value) {
1849 else if (STRCASEEQ('i','I',"istyle",name) && value && *value) {
1850 attr_istyle = value;
1852 else if (STRCASEEQ('m','M',"maxlength",name) && value && *value) {
1853 attr_max_length = value;
1855 else if (STRCASEEQ('c','C',"checked", name)) {
1856 attr_checked = value;
1858 else if (STRCASEEQ('a','A',"accesskey", name) && value && *value) {
1859 attr_accesskey = value;
1861 else if (STRCASEEQ('s','S',"size", name) && value && *value) {
1864 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
1869 if (IS_CSS_ON(jxhtml->entryp)) {
1870 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
1872 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
1873 css_property_t *cur;
1874 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
1875 if (strcasestr(cur->value, "<ja:n>")) {
1878 else if (strcasestr(cur->value, "<ja:en>")) {
1881 else if (strcasestr(cur->value, "<ja:hk>")) {
1884 else if (strcasestr(cur->value, "<ja:h>")) {
1904 W_V(chxj_jreserved_to_safe_tag(r, attr_name, jxhtml->entryp));
1909 W_V(chxj_add_slash_to_doublequote(doc->pool, attr_value));
1912 if (attr_accesskey) {
1913 W_L(" accesskey=\"");
1914 W_V(attr_accesskey);
1917 if (attr_istyle && (*attr_istyle == '1' || *attr_istyle == '2' || *attr_istyle == '3' || *attr_istyle == '4')) {
1918 /*------------------------------------------------------------------------*/
1920 /*------------------------------------------------------------------------*/
1921 if (attr_type && STRCASEEQ('p','P',"password", attr_type) && ! jxhtml->entryp->pc_flag ) {
1922 char *vv = qs_conv_istyle_to_format(doc->buf.pool, "4");
1923 W_L(" style=\"-wap-input-format:"*");
1928 char *vv = qs_conv_istyle_to_format(doc->buf.pool, attr_istyle);
1930 W_L("-wap-input-format:"*");
1936 else if (attr_type && STRCASEEQ('p','P',"password",attr_type)) {
1937 char *vv = qs_conv_istyle_to_format(doc->buf.pool, "4");
1938 W_L(" style=\"-wap-input-format:"*");
1942 /*--------------------------------------------------------------------------*/
1943 /* The figure is default for the password. */
1944 /*--------------------------------------------------------------------------*/
1945 if (attr_max_length && *attr_max_length) {
1946 if (chxj_chk_numeric(attr_max_length) == 0) {
1947 W_L(" maxlength=\"");
1948 W_V(attr_max_length);
1953 W_L(" checked=\"checked\"");
1969 jxhtml = GET_JXHTML(pdoc);
1982 /*--------------------------------------------------------------------------*/
1983 /* Get Attributes */
1984 /*--------------------------------------------------------------------------*/
1985 type = qs_get_type_attr(doc, node, doc->buf.pool);
1986 name = qs_get_name_attr(doc, node, doc->buf.pool);
1987 value = qs_get_value_attr(doc,node, doc->buf.pool);
1988 istyle = qs_get_istyle_attr(doc,node,doc->buf.pool);
1989 max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1990 checked = qs_get_checked_attr(doc,node,doc->buf.pool);
1991 accesskey = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1992 size = qs_get_size_attr(doc, node, doc->buf.pool);
1995 if (type && (STRCASEEQ('t','T',"text", type) ||
1996 STRCASEEQ('p','P',"password",type) ||
1997 STRCASEEQ('c','C',"checkbox",type) ||
1998 STRCASEEQ('r','R',"radio", type) ||
1999 STRCASEEQ('h','H',"hidden", type) ||
2000 STRCASEEQ('s','S',"submit", type) ||
2001 STRCASEEQ('r','R',"reset", type))) {
2007 if (size && *size) {
2012 if (name && *name) {
2014 W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
2017 if (value && *value) {
2018 if (type && (STRCASEEQ('s','S',"submit",type) || STRCASEEQ('r','R',"reset",type))) {
2019 apr_size_t value_len = strlen(value);
2020 value = chxj_conv_z2h(r, value, &value_len, jxhtml->entryp);
2024 W_V(chxj_add_slash_to_doublequote(doc->pool, value));
2027 if (accesskey && *accesskey) {
2028 W_L(" accesskey=\"");
2032 if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
2033 /*------------------------------------------------------------------------*/
2035 /*------------------------------------------------------------------------*/
2036 if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
2037 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2040 char *vv = qs_conv_istyle_to_format(doc->buf.pool, istyle);
2042 W_L("-wap-input-format:'*");
2048 else if (type && STRCASEEQ('p','P',"password",type)) {
2049 W_L(" style=\"-wap-input-format: "*<ja:n>";\"");
2051 /*--------------------------------------------------------------------------*/
2052 /* The figure is default for the password. */
2053 /*--------------------------------------------------------------------------*/
2054 if (max_length && *max_length) {
2055 if (chxj_chk_numeric(max_length) == 0) {
2056 W_L(" maxlength=\"");
2063 W_L(" checked=\"checked\"");
2072 * It is a handler who processes the INPUT tag.
2074 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2075 * destination is specified.
2076 * @param node [i] The INPUT tag node is specified.
2077 * @return The conversion result is returned.
2080 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child))
2082 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2088 * It is a handler who processes the CENTER tag.
2090 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2091 * destination is specified.
2092 * @param node [i] The CENTER tag node is specified.
2093 * @return The conversion result is returned.
2096 s_jxhtml_start_center_tag(void *pdoc, Node *node)
2101 char *attr_style = NULL;
2102 char *attr_color = NULL;
2103 char *attr_size = NULL;
2105 jxhtml = GET_JXHTML(pdoc);
2108 for (attr = qs_get_attr(doc,node);
2110 attr = qs_get_next_attr(doc,attr)) {
2111 char *name = qs_get_attr_name(doc,attr);
2112 char *value = qs_get_attr_value(doc,attr);
2113 if (STRCASEEQ('s','S',"style",name) && value && *value) {
2117 if (IS_CSS_ON(jxhtml->entryp)) {
2118 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2120 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2121 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
2122 css_property_t *cur;
2123 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2124 if (cur->value && *cur->value) {
2125 attr_color = apr_pstrdup(doc->pool, cur->value);
2128 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
2129 if (cur->value && *cur->value) {
2130 attr_size = apr_pstrdup(doc->pool, cur->value);
2137 if (attr_size || attr_color) {
2145 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2159 * It is a handler who processes the CENTER tag.
2161 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2162 * destination is specified.
2163 * @param node [i] The CENTER tag node is specified.
2164 * @return The conversion result is returned.
2167 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(node))
2173 jxhtml = GET_JXHTML(pdoc);
2178 if (IS_CSS_ON(jxhtml->entryp)) {
2179 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2186 * It is a handler who processes the li tag.
2188 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2189 * destination is specified.
2190 * @param node [i] The li tag node is specified.
2191 * @return The conversion result is returned.
2194 s_jxhtml_start_li_tag(void *pdoc, Node *node)
2200 char *attr_type = NULL;
2201 char *attr_value = NULL;
2202 char *attr_style = NULL;
2204 jxhtml = GET_JXHTML(pdoc);
2208 for (attr = qs_get_attr(doc,node);
2210 attr = qs_get_next_attr(doc,attr)) {
2211 char *name = qs_get_attr_name(doc,attr);
2212 char *value = qs_get_attr_value(doc,attr);
2213 if (STRCASEEQ('t','T',"type",name)) {
2214 if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('s','S',"square",value) || STRCASEEQ('c','C',"circle",value))) {
2215 if (*value == '1') {
2216 attr_type = apr_pstrdup(doc->pool, "decimal");
2218 else if (*value == 'a') {
2219 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2221 else if (*value == 'A') {
2222 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2229 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2232 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2236 if (IS_CSS_ON(jxhtml->entryp)) {
2237 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2239 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2240 css_property_t *cur;
2241 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2242 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2243 attr_type = apr_pstrdup(doc->pool, "decimal");
2245 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2246 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2248 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2249 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2251 else if (STRCASEEQ('d','D',"disc", cur->value)) {
2252 attr_type = apr_pstrdup(doc->pool, "disc");
2254 else if (STRCASEEQ('s','S',"square", cur->value)) {
2255 attr_type = apr_pstrdup(doc->pool, "square");
2257 else if (STRCASEEQ('c','C',"circle", cur->value)) {
2258 attr_type = apr_pstrdup(doc->pool, "circle");
2268 W_L("list-style-type:");
2284 * It is a handler who processes the li tag.
2286 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2287 * destination is specified.
2288 * @param node [i] The li tag node is specified.
2289 * @return The conversion result is returned.
2292 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child))
2298 jxhtml = GET_JXHTML(pdoc);
2302 if (IS_CSS_ON(jxhtml->entryp)) {
2303 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2311 * It is a handler who processes the OL tag.
2313 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2314 * destination is specified.
2315 * @param node [i] The OL tag node is specified.
2316 * @return The conversion result is returned.
2319 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
2325 char *attr_style = NULL;
2326 char *attr_start = NULL;
2327 char *attr_type = NULL;
2329 jxhtml = GET_JXHTML(pdoc);
2333 /*--------------------------------------------------------------------------*/
2334 /* Get Attributes */
2335 /*--------------------------------------------------------------------------*/
2336 for (attr = qs_get_attr(doc,node);
2338 attr = qs_get_next_attr(doc,attr)) {
2339 char *name = qs_get_attr_name(doc,attr);
2340 char *value = qs_get_attr_value(doc,attr);
2341 if (STRCASEEQ('t','T',"type",name) && value) {
2342 if (*value == '1') {
2343 attr_type = apr_pstrdup(doc->pool, "decimal");
2345 else if (*value == 'a') {
2346 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2348 else if (*value == 'A') {
2349 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2352 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2355 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
2359 if (IS_CSS_ON(jxhtml->entryp)) {
2360 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2362 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2363 css_property_t *cur;
2364 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2365 if (STRCASEEQ('d','D',"decimal", cur->value)) {
2366 attr_type = apr_pstrdup(doc->pool, "decimal");
2368 else if (STRCASEEQ('u','U',"upper-alpha", cur->value)) {
2369 attr_type = apr_pstrdup(doc->pool, "upper-alpha");
2371 else if (STRCASEEQ('l','L',"lower-alpha", cur->value)) {
2372 attr_type = apr_pstrdup(doc->pool, "lower-alpha");
2380 W_L("list-style-type:");
2397 * It is a handler who processes the OL tag.
2399 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2400 * destination is specified.
2401 * @param node [i] The OL tag node is specified.
2402 * @return The conversion result is returned.
2405 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child))
2411 jxhtml = GET_JXHTML(pdoc);
2416 if (IS_CSS_ON(jxhtml->entryp)) {
2417 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2424 * It is a handler who processes the P tag.
2426 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2427 * destination is specified.
2428 * @param node [i] The P tag node is specified.
2429 * @return The conversion result is returned.
2432 s_jxhtml_start_p_tag(void *pdoc, Node *node)
2438 char *attr_align = NULL;
2439 char *attr_style = NULL;
2440 char *attr_color = NULL;
2441 char *attr_blink = NULL;
2443 jxhtml = GET_JXHTML(pdoc);
2447 for (attr = qs_get_attr(doc,node);
2449 attr = qs_get_next_attr(doc,attr)) {
2450 char *nm = qs_get_attr_name(doc,attr);
2451 char *val = qs_get_attr_value(doc,attr);
2452 if (STRCASEEQ('a','A',"align", nm)) {
2453 /*----------------------------------------------------------------------*/
2454 /* CHTML 1.0 (W3C version 3.2) */
2455 /*----------------------------------------------------------------------*/
2456 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2457 attr_align = apr_pstrdup(doc->buf.pool, val);
2461 else if (STRCASEEQ('s','S',"style", nm) && val && *val) {
2462 attr_style = apr_pstrdup(doc->buf.pool, val);
2465 if (IS_CSS_ON(jxhtml->entryp)) {
2466 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2468 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
2469 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
2470 css_property_t *text_deco_prop = chxj_css_get_property_value(doc, style, "text-decoration");
2471 css_property_t *cur;
2472 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
2473 if (STRCASEEQ('l','L',"left",cur->value)) {
2474 attr_align = apr_pstrdup(doc->pool, "left");
2476 else if (STRCASEEQ('c','C',"center",cur->value)) {
2477 attr_align = apr_pstrdup(doc->pool, "center");
2479 else if (STRCASEEQ('r','R',"right",cur->value)) {
2480 attr_align = apr_pstrdup(doc->pool, "right");
2483 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
2484 if (cur->value && *cur->value) {
2485 attr_color = apr_pstrdup(doc->pool, cur->value);
2488 for (cur = text_deco_prop->next; cur != text_deco_prop; cur = cur->next) {
2489 if (cur->value && *cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
2490 attr_blink = apr_pstrdup(doc->pool, cur->value);
2496 if ((attr_align && *attr_align) || (attr_color && *attr_color) || (attr_blink && *attr_blink)) {
2504 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
2510 W_L("text-decoration:");
2522 * It is a handler who processes the P tag.
2524 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2525 * destination is specified.
2526 * @param node [i] The P tag node is specified.
2527 * @return The conversion result is returned.
2530 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child))
2532 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2533 Doc *doc = jxhtml->doc;
2536 if (IS_CSS_ON(jxhtml->entryp)) {
2537 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2544 * It is a handler who processes the PRE tag.
2546 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2547 * destination is specified.
2548 * @param node [i] The PRE tag node is specified.
2549 * @return The conversion result is returned.
2552 s_jxhtml_start_pre_tag(void *pdoc, Node *node)
2554 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2555 Doc *doc = jxhtml->doc;
2557 char *attr_style = NULL;
2559 for (attr = qs_get_attr(doc,node);
2561 attr = qs_get_next_attr(doc,attr)) {
2562 char *nm = qs_get_attr_name(doc,attr);
2563 char *val = qs_get_attr_value(doc,attr);
2564 if (val && STRCASEEQ('s','S',"style", nm)) {
2569 if (IS_CSS_ON(jxhtml->entryp)) {
2570 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2580 * It is a handler who processes the PRE tag.
2582 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2583 * destination is specified.
2584 * @param node [i] The PRE tag node is specified.
2585 * @return The conversion result is returned.
2588 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child))
2590 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2591 Doc *doc = jxhtml->doc;
2595 if (IS_CSS_ON(jxhtml->entryp)) {
2596 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2604 * It is a handler who processes the UL tag.
2606 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2607 * destination is specified.
2608 * @param node [i] The UL tag node is specified.
2609 * @return The conversion result is returned.
2612 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
2614 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2615 Doc *doc = jxhtml->doc;
2617 char *attr_type = NULL;
2618 char *attr_style = NULL;
2619 /*--------------------------------------------------------------------------*/
2620 /* Get Attributes */
2621 /*--------------------------------------------------------------------------*/
2622 for (attr = qs_get_attr(doc,node);
2624 attr = qs_get_next_attr(doc,attr)) {
2625 char *name = qs_get_attr_name(doc,attr);
2626 char *value = qs_get_attr_value(doc,attr);
2627 if (STRCASEEQ('t','T',"type",name)) {
2628 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2632 else if (value && *value && STRCASEEQ('s','S',"style", name)) {
2636 if (IS_CSS_ON(jxhtml->entryp)) {
2637 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
2639 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
2640 css_property_t *cur;
2641 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
2642 if (STRCASEEQ('d','D',"disc",cur->value)) {
2643 attr_type = apr_pstrdup(doc->pool, "disc");
2645 else if (STRCASEEQ('c','C',"circle",cur->value)) {
2646 attr_type = apr_pstrdup(doc->pool, "circle");
2648 else if (STRCASEEQ('s','S',"square",cur->value)) {
2649 attr_type = apr_pstrdup(doc->pool, "square");
2657 W_L("list-style-type:");
2668 * It is a handler who processes the UL tag.
2670 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2671 * destination is specified.
2672 * @param node [i] The UL tag node is specified.
2673 * @return The conversion result is returned.
2676 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child))
2678 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2679 Doc *doc = jxhtml->doc;
2682 if (IS_CSS_ON(jxhtml->entryp)) {
2683 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
2690 * It is a handler who processes the HR tag.
2692 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2693 * destination is specified.
2694 * @param node [i] The HR tag node is specified.
2695 * @return The conversion result is returned.
2698 s_jxhtml_start_hr_tag(void *pdoc, Node *node)
2704 char *attr_align = NULL;
2705 char *attr_size = NULL;
2706 char *attr_width = NULL;
2707 char *attr_noshade = NULL;
2708 char *attr_style = NULL;
2709 char *attr_color = NULL;
2711 jxhtml = GET_JXHTML(pdoc);
2715 for (attr = qs_get_attr(doc,node);
2717 attr = qs_get_next_attr(doc,attr)) {
2718 char *name = qs_get_attr_name (doc,attr);
2719 char *value = qs_get_attr_value(doc,attr);
2723 if (strcasecmp(name, "align") == 0) {
2724 /*--------------------------------------------------------------------*/
2726 /*--------------------------------------------------------------------*/
2727 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2735 if (strcasecmp(name, "size") == 0) {
2736 /*--------------------------------------------------------------------*/
2738 /*--------------------------------------------------------------------*/
2739 if (value && *value) {
2743 else if (strcasecmp(name, "style") == 0) {
2744 if (value && *value) {
2752 if (strcasecmp(name, "width") == 0) {
2753 /*--------------------------------------------------------------------*/
2755 /*--------------------------------------------------------------------*/
2756 if (value && *value) {
2764 if (strcasecmp(name, "noshade") == 0) {
2765 /*--------------------------------------------------------------------*/
2767 /*--------------------------------------------------------------------*/
2768 attr_noshade = apr_pstrdup(doc->pool, "noshade");
2774 if (strcasecmp(name, "color") == 0 && value && *value) {
2775 /*--------------------------------------------------------------------*/
2777 /*--------------------------------------------------------------------*/
2786 if (IS_CSS_ON(jxhtml->entryp)) {
2787 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
2789 css_property_t *border_style_prop = chxj_css_get_property_value(doc, style, "border-style");
2790 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2791 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2792 css_property_t *cur;
2793 for (cur = border_style_prop->next; cur != border_style_prop; cur = cur->next) {
2794 if (STRCASEEQ('s','S',"solid",cur->value)) {
2795 attr_noshade = "noshade";
2798 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2799 char *tmp = apr_pstrdup(doc->pool, cur->value);
2800 char *tmpp = strstr(tmp, "px");
2802 attr_size = apr_pstrdup(doc->pool, tmp);
2805 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2806 char *tmp = apr_pstrdup(doc->pool, cur->value);
2807 char *tmpp = strstr(tmp, "px");
2809 attr_width = apr_pstrdup(doc->pool, tmp);
2812 tmpp = strstr(tmp, "%");
2814 attr_width = apr_pstrdup(doc->pool, tmp);
2826 if (attr_size || attr_width || attr_noshade) {
2831 if (!strstr(attr_size, "px")) {
2839 if (!strstr(attr_width, "px") && !strstr(attr_width, "%")) {
2845 W_L("border-style:solid;");
2861 * It is a handler who processes the HR tag.
2863 * @param jxhtml [i/o] The pointer to the JXHTML structure at the output
2864 * destination is specified.
2865 * @param node [i] The HR tag node is specified.
2866 * @return The conversion result is returned.
2869 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2871 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2877 * It is a handler who processes the IMG tag.
2879 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
2880 * destination is specified.
2881 * @param node [i] The IMG tag node is specified.
2882 * @return The conversion result is returned.
2885 s_jxhtml_start_img_tag(void *pdoc, Node *node)
2887 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2888 Doc *doc = jxhtml->doc;
2889 request_rec *r = doc->r;
2891 char *attr_src = NULL;
2892 char *attr_height = NULL;
2893 char *attr_width = NULL;
2894 char *attr_align = NULL;
2895 char *attr_alt = NULL;
2896 char *attr_style = NULL;
2897 #ifndef IMG_NOT_CONVERT_FILENAME
2898 device_table *spec = jxhtml->spec;
2901 /*--------------------------------------------------------------------------*/
2902 /* Get Attributes */
2903 /*--------------------------------------------------------------------------*/
2904 for (attr = qs_get_attr(doc,node);
2906 attr = qs_get_next_attr(doc,attr)) {
2907 char *name = qs_get_attr_name(doc,attr);
2908 char *value = qs_get_attr_value(doc,attr);
2909 if (STRCASEEQ('s','S',"src",name)) {
2910 /*----------------------------------------------------------------------*/
2912 /*----------------------------------------------------------------------*/
2913 #ifdef IMG_NOT_CONVERT_FILENAME
2914 value = chxj_encoding_parameter(r, value, 1);
2915 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
2916 value = chxj_add_cookie_no_update_parameter(r, value);
2919 value = chxj_img_conv(r, spec, value);
2920 value = chxj_encoding_parameter(r, value, 1);
2921 value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
2922 value = chxj_add_cookie_no_update_parameter(r, value);
2926 else if (STRCASEEQ('a','A',"align",name)) {
2927 /*----------------------------------------------------------------------*/
2929 /*----------------------------------------------------------------------*/
2931 if (STRCASEEQ('t','T',"top", value) ||
2932 STRCASEEQ('m','M',"middle",value) ||
2933 STRCASEEQ('b','B',"bottom",value) ||
2934 STRCASEEQ('l','L',"left", value) ||
2935 STRCASEEQ('r','R',"right", value)) {
2938 else if (STRCASEEQ('c','C',"center",value)) {
2939 attr_align = apr_pstrdup(doc->pool, "middle");
2943 else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2944 /*----------------------------------------------------------------------*/
2946 /*----------------------------------------------------------------------*/
2949 else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2950 /*----------------------------------------------------------------------*/
2952 /*----------------------------------------------------------------------*/
2953 attr_height = value;
2955 else if (STRCASEEQ('h','H',"hspace",name)) {
2956 /*----------------------------------------------------------------------*/
2958 /*----------------------------------------------------------------------*/
2961 else if (STRCASEEQ('v','V',"vspace",name)) {
2962 /*----------------------------------------------------------------------*/
2964 /*----------------------------------------------------------------------*/
2967 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2968 /*----------------------------------------------------------------------*/
2970 /*----------------------------------------------------------------------*/
2973 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
2974 /*----------------------------------------------------------------------*/
2976 /*----------------------------------------------------------------------*/
2981 if (IS_CSS_ON(jxhtml->entryp)) {
2982 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
2984 css_property_t *height_prop = chxj_css_get_property_value(doc, style, "height");
2985 css_property_t *width_prop = chxj_css_get_property_value(doc, style, "width");
2986 css_property_t *valign_prop = chxj_css_get_property_value(doc, style, "vertical-align");
2987 css_property_t *cur;
2988 for (cur = height_prop->next; cur != height_prop; cur = cur->next) {
2989 attr_height = apr_pstrdup(doc->pool, cur->value);
2991 for (cur = width_prop->next; cur != width_prop; cur = cur->next) {
2992 attr_width = apr_pstrdup(doc->pool, cur->value);
2994 for (cur = valign_prop->next; cur != valign_prop; cur = cur->next) {
2995 attr_align = apr_pstrdup(doc->pool, cur->value);
3035 * It is a handler who processes the IMG tag.
3037 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3038 * destination is specified.
3039 * @param node [i] The IMG tag node is specified.
3040 * @return The conversion result is returned.
3043 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child))
3045 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3051 * It is a handler who processes the SELECT tag.
3053 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3054 * destination is specified.
3055 * @param node [i] The SELECT tag node is specified.
3056 * @return The conversion result is returned.
3059 s_jxhtml_start_select_tag(void *pdoc, Node *node)
3061 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3062 Doc *doc = jxhtml->doc;
3066 char *multiple = NULL;
3067 char *attr_style = NULL;
3070 for (attr = qs_get_attr(doc,node);
3072 attr = qs_get_next_attr(doc,attr)) {
3073 char *nm = qs_get_attr_name(doc,attr);
3074 char *val = qs_get_attr_value(doc,attr);
3075 if (STRCASEEQ('s','S',"size",nm)) {
3076 /*----------------------------------------------------------------------*/
3077 /* CHTML 1.0 version 2.0 */
3078 /*----------------------------------------------------------------------*/
3079 size = apr_pstrdup(doc->buf.pool, val);
3081 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3082 /*----------------------------------------------------------------------*/
3083 /* CHTML 1.0 version 2.0 */
3084 /*----------------------------------------------------------------------*/
3085 attr_style = apr_pstrdup(doc->buf.pool, val);
3087 else if (STRCASEEQ('n','N',"name",nm)) {
3088 /*----------------------------------------------------------------------*/
3089 /* CHTML 1.0 version 2.0 */
3090 /*----------------------------------------------------------------------*/
3091 name = apr_pstrdup(doc->buf.pool, val);
3093 else if (STRCASEEQ('m','M',"multiple", nm)) {
3094 /*----------------------------------------------------------------------*/
3095 /* CHTML 1.0 version 2.0 */
3096 /*----------------------------------------------------------------------*/
3097 multiple = apr_pstrdup(doc->buf.pool, val);
3100 if (size && *size) {
3105 if (name && *name) {
3115 if (IS_CSS_ON(jxhtml->entryp)) {
3116 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3124 * It is a handler who processes the SELECT tag.
3126 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3127 * destination is specified.
3128 * @param node [i] The SELECT tag node is specified.
3129 * @return The conversion result is returned.
3132 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
3134 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3135 Doc *doc = jxhtml->doc;
3138 if (IS_CSS_ON(jxhtml->entryp)) {
3139 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3146 * It is a handler who processes the OPTION tag.
3148 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3149 * destination is specified.
3150 * @param node [i] The OPTION tag node is specified.
3151 * @return The conversion result is returned.
3154 s_jxhtml_start_option_tag(void *pdoc, Node *node)
3156 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3157 Doc *doc = jxhtml->doc;
3160 char *selected = NULL;
3162 char *attr_style = NULL;
3165 for (attr = qs_get_attr(doc,node);
3167 attr = qs_get_next_attr(doc,attr)) {
3168 char *nm = qs_get_attr_name(doc,attr);
3169 char *val = qs_get_attr_value(doc,attr);
3170 if (STRCASEEQ('s','S',"selected",nm)) {
3171 /*----------------------------------------------------------------------*/
3172 /* CHTML 1.0 version 2.0 */
3173 /*----------------------------------------------------------------------*/
3174 selected = apr_pstrdup(doc->buf.pool, val);
3176 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3177 /*----------------------------------------------------------------------*/
3178 /* CHTML 1.0 version 2.0 */
3179 /*----------------------------------------------------------------------*/
3180 attr_style = apr_pstrdup(doc->buf.pool, val);
3182 else if (STRCASEEQ('v','V',"value",nm)) {
3183 /*----------------------------------------------------------------------*/
3184 /* CHTML 1.0 version 2.0 */
3185 /*----------------------------------------------------------------------*/
3186 value = apr_pstrdup(doc->buf.pool, val);
3199 if (IS_CSS_ON(jxhtml->entryp)) {
3200 s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3208 * It is a handler who processes the OPTION tag.
3210 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3211 * destination is specified.
3212 * @param node [i] The OPTION tag node is specified.
3213 * @return The conversion result is returned.
3216 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
3218 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3219 Doc *doc = jxhtml->doc;
3222 if (IS_CSS_ON(jxhtml->entryp)) {
3223 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3231 * It is a handler who processes the DIV tag.
3233 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3234 * destination is specified.
3235 * @param node [i] The DIV tag node is specified.
3236 * @return The conversion result is returned.
3239 s_jxhtml_start_div_tag(void *pdoc, Node *node)
3245 char *attr_style = NULL;
3246 char *attr_align = NULL;
3247 char *attr_display = NULL;
3248 char *attr_decoration = NULL;
3249 char *attr_wap_marquee_style = NULL;
3250 char *attr_wap_marquee_dir = NULL;
3251 char *attr_wap_marquee_loop = NULL;
3252 char *attr_color = NULL;
3253 char *attr_bgcolor = NULL;
3254 char *attr_font_size = NULL;
3256 jxhtml = GET_JXHTML(pdoc);
3260 for (attr = qs_get_attr(doc,node);
3262 attr = qs_get_next_attr(doc,attr)) {
3263 char *nm = qs_get_attr_name(doc,attr);
3264 char *val = qs_get_attr_value(doc,attr);
3265 if (STRCASEEQ('a','A',"align",nm)) {
3266 /*----------------------------------------------------------------------*/
3267 /* CHTML 1.0 (W3C version 3.2) */
3268 /*----------------------------------------------------------------------*/
3269 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
3270 attr_align = apr_pstrdup(doc->buf.pool, val);
3273 else if (STRCASEEQ('s','S',"style",nm) && val && *val) {
3274 attr_style = apr_pstrdup(doc->buf.pool, val);
3278 if (IS_CSS_ON(jxhtml->entryp)) {
3279 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
3281 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
3282 css_property_t *text_decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
3283 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3284 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
3285 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
3286 css_property_t *background_color_prop = chxj_css_get_property_value(doc, style, "background-color");
3287 css_property_t *background_prop = chxj_css_get_property_value(doc, style, "background");
3289 css_property_t *cur;
3290 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
3291 if (strcasecmp("-wap-marquee", cur->value) == 0) {
3292 attr_display = apr_pstrdup(doc->pool, cur->value);
3295 for (cur = text_decoration_prop->next; cur != text_decoration_prop; cur = cur->next) {
3296 if (STRCASEEQ('b','B',"blink", cur->value)) {
3297 attr_decoration = apr_pstrdup(doc->pool, cur->value);
3300 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3301 attr_color = apr_pstrdup(doc->pool, cur->value);
3303 for (cur = background_color_prop->next; cur != background_color_prop; cur = cur->next) {
3304 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3305 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
3307 for (cur = background_prop->next; cur != background_prop; cur = cur->next) {
3308 char *ss = strchr(cur->value, '#');
3310 ss = strstr(cur->value, "rgb");
3313 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
3314 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
3317 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
3318 attr_align = apr_pstrdup(doc->pool, cur->value);
3320 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
3321 if ( STRCASEEQ('x','X',"xx-small",cur->value)
3322 || STRCASEEQ('x','X',"x-small",cur->value)
3323 || STRCASEEQ('s','S',"small",cur->value)
3324 || STRCASEEQ('m','M',"medium",cur->value)
3325 || STRCASEEQ('l','L',"large",cur->value)
3326 || STRCASEEQ('x','X',"x-large",cur->value)
3327 || STRCASEEQ('x','X',"xx-large",cur->value)) {
3328 attr_font_size = apr_pstrdup(doc->pool, cur->value);
3332 css_property_t *wap_marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
3333 css_property_t *wap_marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
3334 css_property_t *wap_marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
3335 for (cur = wap_marquee_style_prop->next; cur != wap_marquee_style_prop; cur = cur->next) {
3336 if (STRCASEEQ('s','S',"scroll", cur->value) || STRCASEEQ('s','S',"slide",cur->value) || STRCASEEQ('a','A',"alternate",cur->value)) {
3337 attr_wap_marquee_style = apr_pstrdup(doc->pool, cur->value);
3340 for (cur = wap_marquee_dir_prop->next; cur != wap_marquee_dir_prop; cur = cur->next) {
3341 if (STRCASEEQ('l','L',"ltr",cur->value)) {
3342 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
3344 else if (STRCASEEQ('r','R',"rtl",cur->value)) {
3345 attr_wap_marquee_dir = apr_pstrdup(doc->pool, cur->value);
3348 for (cur = wap_marquee_loop_prop->next; cur != wap_marquee_loop_prop; cur = cur->next) {
3349 attr_wap_marquee_loop = apr_pstrdup(doc->pool, cur->value);
3358 || attr_wap_marquee_style
3359 || attr_wap_marquee_dir
3360 || attr_wap_marquee_loop
3363 || attr_font_size) {
3375 if (attr_decoration) {
3376 W_L("text-decoration:");
3377 W_V(attr_decoration);
3380 if (attr_wap_marquee_style) {
3381 W_L("-wap-marquee-style:");
3382 W_V(attr_wap_marquee_style);
3385 if (attr_wap_marquee_dir) {
3386 W_L("-wap-marquee-dir:");
3387 W_V(attr_wap_marquee_dir);
3390 if (attr_wap_marquee_loop) {
3391 W_L("-wap-marquee-loop:");
3392 W_V(attr_wap_marquee_loop);
3401 W_L("background-color:");
3405 if (attr_font_size) {
3407 W_V(attr_font_size);
3418 * It is a handler who processes the DIV tag.
3420 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3421 * destination is specified.
3422 * @param node [i] The DIV tag node is specified.
3423 * @return The conversion result is returned.
3426 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
3432 jxhtml = GET_JXHTML(pdoc);
3437 if (IS_CSS_ON(jxhtml->entryp)) {
3438 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3445 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
3452 jxhtml = GET_JXHTML(pdoc);
3456 for (child = qs_get_child_node(doc, node);
3458 child = qs_get_next_node(doc, child)) {
3460 s_jxhtml_chxjif_tag(jxhtml, child);
3467 * It is a handler who processes the TEXTARE tag.
3469 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3470 * destination is specified.
3471 * @param node [i] The TEXTAREA tag node is specified.
3472 * @return The conversion result is returned.
3475 s_jxhtml_start_textarea_tag(void *pdoc, Node *node)
3481 char *attr_accesskey = NULL;
3482 char *attr_name = NULL;
3483 char *attr_rows = NULL;
3484 char *attr_cols = NULL;
3485 char *attr_istyle = NULL;
3486 char *attr_style = NULL;
3489 jxhtml = GET_JXHTML(pdoc);
3493 jxhtml->textarea_flag++;
3494 for (attr = qs_get_attr(doc,node);
3496 attr = qs_get_next_attr(doc,attr)) {
3497 char *name = qs_get_attr_name(doc,attr);
3498 char *value = qs_get_attr_value(doc,attr);
3499 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
3500 attr_accesskey = value;
3502 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
3503 attr_istyle = value;
3505 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
3508 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
3511 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
3514 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
3518 if (IS_CSS_ON(jxhtml->entryp)) {
3519 css_prop_list_t *style = s_jxhtml_nopush_and_get_now_style(pdoc, node, attr_style);
3521 css_property_t *wap_input_format = chxj_css_get_property_value(doc, style, "-wap-input-format");
3522 css_property_t *cur;
3523 for (cur = wap_input_format->next; cur != wap_input_format; cur = cur->next) {
3524 if (strcasestr(cur->value, "<ja:n>")) {
3527 else if (strcasestr(cur->value, "<ja:en>")) {
3530 else if (strcasestr(cur->value, "<ja:hk>")) {
3533 else if (strcasestr(cur->value, "<ja:h>")) {
3540 if (attr_accesskey) {
3541 W_L(" accesskey=\"");
3542 W_V(attr_accesskey);
3561 char *vv = qs_conv_istyle_to_format(doc->buf.pool, attr_istyle);
3563 W_L("-wap-input-format:"*");
3574 * It is a handler who processes the TEXTAREA tag.
3576 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3577 * destination is specified.
3578 * @param node [i] The TEXTAREA tag node is specified.
3579 * @return The conversion result is returned.
3582 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child))
3588 jxhtml = GET_JXHTML(pdoc);
3593 jxhtml->textarea_flag--;
3600 * It is a handler who processes the B tag.
3602 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3603 * destination is specified.
3604 * @param node [i] The B tag node is specified.
3605 * @return The conversion result is returned.
3608 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
3614 jxhtml = GET_JXHTML(pdoc);
3624 * It is a handler who processes the B tag.
3626 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3627 * destination is specified.
3628 * @param node [i] The B tag node is specified.
3629 * @return The conversion result is returned.
3632 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
3634 jxhtml_t* jxhtml = GET_JXHTML(pdoc);
3635 Doc* doc = jxhtml->doc;
3642 s_jxhtml_text_tag(void* pdoc, Node* child)
3653 apr_size_t z2h_input_len;
3655 jxhtml = GET_JXHTML(pdoc);
3659 textval = qs_get_node_value(doc,child);
3660 if (strlen(textval) == 0) {
3664 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
3665 memset(tmp, 0, qs_get_node_size(doc,child)+1);
3667 tdst = qs_alloc_zero_byte_string(doc->buf.pool);
3668 memset(one_byte, 0, sizeof(one_byte));
3671 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
3673 int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
3675 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
3680 if (is_sjis_kanji(textval[ii])) {
3681 one_byte[0] = textval[ii+0];
3682 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3683 one_byte[0] = textval[ii+1];
3684 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3688 if (jxhtml->pre_flag) {
3689 one_byte[0] = textval[ii+0];
3690 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3693 if (jxhtml->textarea_flag) {
3694 one_byte[0] = textval[ii+0];
3695 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3698 if (textval[ii] != '\r' && textval[ii] != '\n') {
3699 one_byte[0] = textval[ii+0];
3700 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
3704 z2h_input_len = strlen(tdst);
3705 tdst = chxj_conv_z2h(r, tdst, &z2h_input_len, jxhtml->entryp);
3713 * It is a handler who processes the BLOCKQUOTE tag.
3715 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3716 * destination is specified.
3717 * @param node [i] The BLOCKQUOTE tag node is specified.
3718 * @return The conversion result is returned.
3721 s_jxhtml_start_blockquote_tag(void *pdoc, Node *node)
3726 char *attr_style = NULL;
3727 char *attr_color = NULL;
3728 char *attr_size = NULL;
3730 jxhtml = GET_JXHTML(pdoc);
3732 for (attr = qs_get_attr(doc,node);
3734 attr = qs_get_next_attr(doc,attr)) {
3735 char *nm = qs_get_attr_name(doc,attr);
3736 char *val = qs_get_attr_value(doc,attr);
3737 if (val && STRCASEEQ('s','S',"style", nm)) {
3741 if (IS_CSS_ON(jxhtml->entryp)) {
3742 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3744 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3745 css_property_t *font_size_prop = chxj_css_get_property_value(doc, style, "font-size");
3746 css_property_t *cur;
3747 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3748 if (cur->value && *cur->value) {
3749 attr_color = apr_pstrdup(doc->pool, cur->value);
3752 for (cur = font_size_prop->next; cur != font_size_prop; cur = cur->next) {
3753 if (cur->value && *cur->value) {
3754 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
3755 attr_size = apr_pstrdup(doc->pool, cur->value);
3757 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
3758 attr_size = apr_pstrdup(doc->pool, cur->value);
3760 else if (STRCASEEQ('s','S',"small",cur->value)) {
3761 attr_size = apr_pstrdup(doc->pool, cur->value);
3763 else if (STRCASEEQ('m','M',"medium",cur->value)) {
3764 attr_size = apr_pstrdup(doc->pool, cur->value);
3766 else if (STRCASEEQ('l','L',"large",cur->value)) {
3767 attr_size = apr_pstrdup(doc->pool, cur->value);
3769 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
3770 attr_size = apr_pstrdup(doc->pool, cur->value);
3772 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
3773 attr_size = apr_pstrdup(doc->pool, cur->value);
3780 if (attr_color || attr_size) {
3783 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
3801 * It is a handler who processes the BLOCKQUOTE tag.
3803 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3804 * destination is specified.
3805 * @param node [i] The BLOCKQUOTE tag node is specified.
3806 * @return The conversion result is returned.
3809 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3811 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3812 Doc *doc = jxhtml->doc;
3813 W_L("</blockquote>");
3814 if (IS_CSS_ON(jxhtml->entryp)) {
3815 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3822 * It is a handler who processes the DIR tag.
3824 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3825 * destination is specified.
3826 * @param node [i] The DIR tag node is specified.
3827 * @return The conversion result is returned.
3830 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
3832 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3833 Doc *doc = jxhtml->doc;
3835 char *attr_style = NULL;
3836 char *attr_color = NULL;
3837 char *attr_type = NULL;
3838 char *attr_size = NULL;
3839 for (attr = qs_get_attr(doc,node);
3841 attr = qs_get_next_attr(doc,attr)) {
3842 char *name = qs_get_attr_name(doc,attr);
3843 char *value = qs_get_attr_value(doc,attr);
3844 if (STRCASEEQ('t','T',"type",name)) {
3845 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3849 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
3853 if (IS_CSS_ON(jxhtml->entryp)) {
3854 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3856 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3857 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
3858 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
3859 css_property_t *cur;
3860 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3861 if (cur->value && *cur->value) {
3862 attr_color = apr_pstrdup(doc->pool, cur->value);
3865 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
3866 if (cur->value && *cur->value) {
3867 attr_type = apr_pstrdup(doc->pool, cur->value);
3870 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
3871 if (cur->value && *cur->value) {
3872 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
3873 attr_size = apr_pstrdup(doc->pool, cur->value);
3875 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
3876 attr_size = apr_pstrdup(doc->pool, cur->value);
3878 else if (STRCASEEQ('s','S',"small",cur->value)) {
3879 attr_size = apr_pstrdup(doc->pool, cur->value);
3881 else if (STRCASEEQ('m','M',"medium",cur->value)) {
3882 attr_size = apr_pstrdup(doc->pool, cur->value);
3884 else if (STRCASEEQ('l','L',"large",cur->value)) {
3885 attr_size = apr_pstrdup(doc->pool, cur->value);
3887 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
3888 attr_size = apr_pstrdup(doc->pool, cur->value);
3890 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
3891 attr_size = apr_pstrdup(doc->pool, cur->value);
3898 if (attr_type || attr_color || attr_size) {
3901 W_L("list-style-type:");
3906 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
3924 * It is a handler who processes the DIR tag.
3926 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3927 * destination is specified.
3928 * @param node [i] The DIR tag node is specified.
3929 * @return The conversion result is returned.
3932 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
3934 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3935 Doc *doc = jxhtml->doc;
3937 if (IS_CSS_ON(jxhtml->entryp)) {
3938 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
3945 * It is a handler who processes the DL tag.
3947 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
3948 * destination is specified.
3949 * @param node [i] The DL tag node is specified.
3950 * @return The conversion result is returned.
3953 s_jxhtml_start_dl_tag(void *pdoc, Node *node)
3955 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3956 Doc *doc = jxhtml->doc;
3958 char *attr_style = NULL;
3959 char *attr_color = NULL;
3960 char *attr_size = NULL;
3961 for (attr = qs_get_attr(doc,node);
3963 attr = qs_get_next_attr(doc,attr)) {
3964 char *name = qs_get_attr_name(doc,attr);
3965 char *value = qs_get_attr_value(doc,attr);
3966 if (STRCASEEQ('s','S',"style", name) && value && *value) {
3970 if (IS_CSS_ON(jxhtml->entryp)) {
3971 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
3973 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
3974 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
3975 css_property_t *cur;
3976 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
3977 if (cur->value && *cur->value) {
3978 attr_color = apr_pstrdup(doc->pool, cur->value);
3981 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
3982 if (cur->value && *cur->value) {
3983 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
3984 attr_size = apr_pstrdup(doc->pool, cur->value);
3986 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
3987 attr_size = apr_pstrdup(doc->pool, cur->value);
3989 else if (STRCASEEQ('s','S',"small",cur->value)) {
3990 attr_size = apr_pstrdup(doc->pool, cur->value);
3992 else if (STRCASEEQ('m','M',"medium",cur->value)) {
3993 attr_size = apr_pstrdup(doc->pool, cur->value);
3995 else if (STRCASEEQ('l','L',"large",cur->value)) {
3996 attr_size = apr_pstrdup(doc->pool, cur->value);
3998 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
3999 attr_size = apr_pstrdup(doc->pool, cur->value);
4001 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4002 attr_size = apr_pstrdup(doc->pool, cur->value);
4009 if (attr_color || attr_size) {
4012 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4030 * It is a handler who processes the DL tag.
4032 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4033 * destination is specified.
4034 * @param node [i] The DL tag node is specified.
4035 * @return The conversion result is returned.
4038 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
4040 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4041 Doc *doc = jxhtml->doc;
4043 if (IS_CSS_ON(jxhtml->entryp)) {
4044 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4051 * It is a handler who processes the DT tag.
4053 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4054 * destination is specified.
4055 * @param node [i] The DT tag node is specified.
4056 * @return The conversion result is returned.
4059 s_jxhtml_start_dt_tag(void *pdoc, Node *node)
4061 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4062 Doc *doc = jxhtml->doc;
4064 char *attr_style = NULL;
4065 char *attr_color = NULL;
4066 char *attr_size = NULL;
4067 for (attr = qs_get_attr(doc,node);
4069 attr = qs_get_next_attr(doc,attr)) {
4070 char *name = qs_get_attr_name(doc,attr);
4071 char *value = qs_get_attr_value(doc,attr);
4072 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4076 if (IS_CSS_ON(jxhtml->entryp)) {
4077 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4079 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4080 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4081 css_property_t *cur;
4082 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4083 if (cur->value && *cur->value) {
4084 attr_color = apr_pstrdup(doc->pool, cur->value);
4087 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4088 if (cur->value && *cur->value) {
4089 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4090 attr_size = apr_pstrdup(doc->pool, cur->value);
4092 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4093 attr_size = apr_pstrdup(doc->pool, cur->value);
4095 else if (STRCASEEQ('s','S',"small",cur->value)) {
4096 attr_size = apr_pstrdup(doc->pool, cur->value);
4098 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4099 attr_size = apr_pstrdup(doc->pool, cur->value);
4101 else if (STRCASEEQ('l','L',"large",cur->value)) {
4102 attr_size = apr_pstrdup(doc->pool, cur->value);
4104 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4105 attr_size = apr_pstrdup(doc->pool, cur->value);
4107 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4108 attr_size = apr_pstrdup(doc->pool, cur->value);
4115 if (attr_color || attr_size) {
4118 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4136 * It is a handler who processes the DT tag.
4138 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4139 * destination is specified.
4140 * @param node [i] The DT tag node is specified.
4141 * @return The conversion result is returned.
4144 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
4146 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4147 Doc *doc = jxhtml->doc;
4149 if (IS_CSS_ON(jxhtml->entryp)) {
4150 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4157 * It is a handler who processes the DD tag.
4159 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4160 * destination is specified.
4161 * @param node [i] The DD tag node is specified.
4162 * @return The conversion result is returned.
4165 s_jxhtml_start_dd_tag(void *pdoc, Node *node)
4167 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4168 Doc *doc = jxhtml->doc;
4170 char *attr_style = NULL;
4171 char *attr_color = NULL;
4172 char *attr_size = NULL;
4173 for (attr = qs_get_attr(doc,node);
4175 attr = qs_get_next_attr(doc,attr)) {
4176 char *name = qs_get_attr_name(doc,attr);
4177 char *value = qs_get_attr_value(doc,attr);
4178 if (STRCASEEQ('s','S',"style", name) && value && *value) {
4182 if (IS_CSS_ON(jxhtml->entryp)) {
4183 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4185 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4186 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4187 css_property_t *cur;
4188 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4189 if (cur->value && *cur->value) {
4190 attr_color = apr_pstrdup(doc->pool, cur->value);
4193 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4194 if (cur->value && *cur->value) {
4195 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4196 attr_size = apr_pstrdup(doc->pool, cur->value);
4198 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4199 attr_size = apr_pstrdup(doc->pool, cur->value);
4201 else if (STRCASEEQ('s','S',"small",cur->value)) {
4202 attr_size = apr_pstrdup(doc->pool, cur->value);
4204 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4205 attr_size = apr_pstrdup(doc->pool, cur->value);
4207 else if (STRCASEEQ('l','L',"large",cur->value)) {
4208 attr_size = apr_pstrdup(doc->pool, cur->value);
4210 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4211 attr_size = apr_pstrdup(doc->pool, cur->value);
4213 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4214 attr_size = apr_pstrdup(doc->pool, cur->value);
4221 if (attr_color || attr_size) {
4224 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4242 * It is a handler who processes the DD tag.
4244 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4245 * destination is specified.
4246 * @param node [i] The DD tag node is specified.
4247 * @return The conversion result is returned.
4250 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
4252 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4253 Doc *doc = jxhtml->doc;
4255 if (IS_CSS_ON(jxhtml->entryp)) {
4256 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4263 * It is a handler who processes the H1 tag.
4265 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4266 * destination is specified.
4267 * @param node [i] The H1 tag node is specified.
4268 * @return The conversion result is returned.
4271 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
4277 char *attr_style = NULL;
4278 char *attr_align = NULL;
4280 jxhtml = GET_JXHTML(pdoc);
4284 for (attr = qs_get_attr(doc,node);
4286 attr = qs_get_next_attr(doc,attr)) {
4287 char *name = qs_get_attr_name(doc,attr);
4288 char *value = qs_get_attr_value(doc,attr);
4289 if (STRCASEEQ('a','A',"align", name)) {
4290 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4294 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4298 if (IS_CSS_ON(jxhtml->entryp)) {
4299 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4301 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4302 css_property_t *cur;
4303 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4304 if (STRCASEEQ('l','L',"left", cur->value)) {
4305 attr_align = apr_pstrdup(doc->pool, "left");
4307 else if (STRCASEEQ('c','C',"center",cur->value)) {
4308 attr_align = apr_pstrdup(doc->pool, "center");
4310 else if (STRCASEEQ('r','R',"right",cur->value)) {
4311 attr_align = apr_pstrdup(doc->pool, "right");
4318 W_L("font-size:xx-large;");
4331 * It is a handler who processes the H1 tag.
4333 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4334 * destination is specified.
4335 * @param node [i] The H1 tag node is specified.
4336 * @return The conversion result is returned.
4339 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child))
4345 jxhtml = GET_JXHTML(pdoc);
4350 if (IS_CSS_ON(jxhtml->entryp)) {
4351 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4359 * It is a handler who processes the H2 tag.
4361 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4362 * destination is specified.
4363 * @param node [i] The H1 tag node is specified.
4364 * @return The conversion result is returned.
4367 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
4373 char *attr_style = NULL;
4374 char *attr_align = NULL;
4376 jxhtml = GET_JXHTML(pdoc);
4380 for (attr = qs_get_attr(doc,node);
4382 attr = qs_get_next_attr(doc,attr)) {
4383 char *name = qs_get_attr_name(doc,attr);
4384 char *value = qs_get_attr_value(doc,attr);
4385 if (STRCASEEQ('a','A',"align", name)) {
4386 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4390 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4394 if (IS_CSS_ON(jxhtml->entryp)) {
4395 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4397 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4398 css_property_t *cur;
4399 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4400 if (STRCASEEQ('l','L',"left", cur->value)) {
4401 attr_align = apr_pstrdup(doc->pool, "left");
4403 else if (STRCASEEQ('c','C',"center",cur->value)) {
4404 attr_align = apr_pstrdup(doc->pool, "center");
4406 else if (STRCASEEQ('r','R',"right",cur->value)) {
4407 attr_align = apr_pstrdup(doc->pool, "right");
4414 W_L("font-size:x-large;");
4427 * It is a handler who processes the H2 tag.
4429 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4430 * destination is specified.
4431 * @param node [i] The H1 tag node is specified.
4432 * @return The conversion result is returned.
4435 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child))
4441 jxhtml = GET_JXHTML(pdoc);
4446 if (IS_CSS_ON(jxhtml->entryp)) {
4447 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4454 * It is a handler who processes the H3 tag.
4456 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4457 * destination is specified.
4458 * @param node [i] The H1 tag node is specified.
4459 * @return The conversion result is returned.
4462 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
4468 char *attr_style = NULL;
4469 char *attr_align = NULL;
4471 jxhtml = GET_JXHTML(pdoc);
4475 for (attr = qs_get_attr(doc,node);
4477 attr = qs_get_next_attr(doc,attr)) {
4478 char *name = qs_get_attr_name(doc,attr);
4479 char *value = qs_get_attr_value(doc,attr);
4480 if (STRCASEEQ('a','A',"align", name)) {
4481 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4485 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4489 if (IS_CSS_ON(jxhtml->entryp)) {
4490 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4492 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4493 css_property_t *cur;
4494 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4495 if (STRCASEEQ('l','L',"left", cur->value)) {
4496 attr_align = apr_pstrdup(doc->pool, "left");
4498 else if (STRCASEEQ('c','C',"center",cur->value)) {
4499 attr_align = apr_pstrdup(doc->pool, "center");
4501 else if (STRCASEEQ('r','R',"right",cur->value)) {
4502 attr_align = apr_pstrdup(doc->pool, "right");
4509 W_L("font-size:large;");
4522 * It is a handler who processes the H3 tag.
4524 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4525 * destination is specified.
4526 * @param node [i] The H1 tag node is specified.
4527 * @return The conversion result is returned.
4530 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child))
4536 jxhtml = GET_JXHTML(pdoc);
4541 if (IS_CSS_ON(jxhtml->entryp)) {
4542 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4549 * It is a handler who processes the H4 tag.
4551 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4552 * destination is specified.
4553 * @param node [i] The H1 tag node is specified.
4554 * @return The conversion result is returned.
4557 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
4563 char *attr_style = NULL;
4564 char *attr_align = NULL;
4566 jxhtml = GET_JXHTML(pdoc);
4570 for (attr = qs_get_attr(doc,node);
4572 attr = qs_get_next_attr(doc,attr)) {
4573 char *name = qs_get_attr_name(doc,attr);
4574 char *value = qs_get_attr_value(doc,attr);
4575 if (STRCASEEQ('a','A',"align", name)) {
4576 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4580 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4584 if (IS_CSS_ON(jxhtml->entryp)) {
4585 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4587 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4588 css_property_t *cur;
4589 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4590 if (STRCASEEQ('l','L',"left", cur->value)) {
4591 attr_align = apr_pstrdup(doc->pool, "left");
4593 else if (STRCASEEQ('c','C',"center",cur->value)) {
4594 attr_align = apr_pstrdup(doc->pool, "center");
4596 else if (STRCASEEQ('r','R',"right",cur->value)) {
4597 attr_align = apr_pstrdup(doc->pool, "right");
4604 W_L("font-size:small;");
4617 * It is a handler who processes the H4 tag.
4619 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4620 * destination is specified.
4621 * @param node [i] The H1 tag node is specified.
4622 * @return The conversion result is returned.
4625 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child))
4631 jxhtml = GET_JXHTML(pdoc);
4636 if (IS_CSS_ON(jxhtml->entryp)) {
4637 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4645 * It is a handler who processes the H5 tag.
4647 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4648 * destination is specified.
4649 * @param node [i] The H1 tag node is specified.
4650 * @return The conversion result is returned.
4653 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
4659 char *attr_style = NULL;
4660 char *attr_align = NULL;
4662 jxhtml = GET_JXHTML(pdoc);
4666 for (attr = qs_get_attr(doc,node);
4668 attr = qs_get_next_attr(doc,attr)) {
4669 char *name = qs_get_attr_name(doc,attr);
4670 char *value = qs_get_attr_value(doc,attr);
4671 if (STRCASEEQ('a','A',"align", name)) {
4672 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4676 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4680 if (IS_CSS_ON(jxhtml->entryp)) {
4681 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4683 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4684 css_property_t *cur;
4685 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4686 if (STRCASEEQ('l','L',"left", cur->value)) {
4687 attr_align = apr_pstrdup(doc->pool, "left");
4689 else if (STRCASEEQ('c','C',"center",cur->value)) {
4690 attr_align = apr_pstrdup(doc->pool, "center");
4692 else if (STRCASEEQ('r','R',"right",cur->value)) {
4693 attr_align = apr_pstrdup(doc->pool, "right");
4700 W_L("font-size:x-small;");
4713 * It is a handler who processes the H5 tag.
4715 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4716 * destination is specified.
4717 * @param node [i] The H1 tag node is specified.
4718 * @return The conversion result is returned.
4721 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child))
4727 jxhtml = GET_JXHTML(pdoc);
4732 if (IS_CSS_ON(jxhtml->entryp)) {
4733 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4741 * It is a handler who processes the H6 tag.
4743 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4744 * destination is specified.
4745 * @param node [i] The H1 tag node is specified.
4746 * @return The conversion result is returned.
4749 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
4755 char *attr_style = NULL;
4756 char *attr_align = NULL;
4758 jxhtml = GET_JXHTML(pdoc);
4762 for (attr = qs_get_attr(doc,node);
4764 attr = qs_get_next_attr(doc,attr)) {
4765 char *name = qs_get_attr_name(doc,attr);
4766 char *value = qs_get_attr_value(doc,attr);
4767 if (STRCASEEQ('a','A',"align", name)) {
4768 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
4772 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
4776 if (IS_CSS_ON(jxhtml->entryp)) {
4777 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4779 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "text-align");
4780 css_property_t *cur;
4781 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4782 if (STRCASEEQ('l','L',"left", cur->value)) {
4783 attr_align = apr_pstrdup(doc->pool, "left");
4785 else if (STRCASEEQ('c','C',"center",cur->value)) {
4786 attr_align = apr_pstrdup(doc->pool, "center");
4788 else if (STRCASEEQ('r','R',"right",cur->value)) {
4789 attr_align = apr_pstrdup(doc->pool, "right");
4796 W_L("font-size:xx-small;");
4809 * It is a handler who processes the H6 tag.
4811 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4812 * destination is specified.
4813 * @param node [i] The H1 tag node is specified.
4814 * @return The conversion result is returned.
4817 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child))
4823 jxhtml = GET_JXHTML(pdoc);
4828 if (IS_CSS_ON(jxhtml->entryp)) {
4829 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4837 * It is a handler who processes the MENU tag.
4839 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4840 * destination is specified.
4841 * @param node [i] The MENU tag node is specified.
4842 * @return The conversion result is returned.
4845 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
4847 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4848 Doc *doc = jxhtml->doc;
4850 char *attr_style = NULL;
4851 char *attr_color = NULL;
4852 char *attr_type = NULL;
4853 char *attr_size = NULL;
4854 for (attr = qs_get_attr(doc,node);
4856 attr = qs_get_next_attr(doc,attr)) {
4857 char *name = qs_get_attr_name(doc,attr);
4858 char *value = qs_get_attr_value(doc,attr);
4859 if (STRCASEEQ('t','T',"type",name)) {
4860 if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
4864 else if (STRCASEEQ('s','S',"style", name) && value && *value) {
4868 if (IS_CSS_ON(jxhtml->entryp)) {
4869 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
4871 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
4872 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
4873 css_property_t *list_style_type_prop = chxj_css_get_property_value(doc, style, "list-style-type");
4874 css_property_t *cur;
4875 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
4876 if (cur->value && *cur->value) {
4877 attr_color = apr_pstrdup(doc->pool, cur->value);
4880 for (cur = list_style_type_prop->next; cur != list_style_type_prop; cur = cur->next) {
4881 if (cur->value && *cur->value) {
4882 attr_type = apr_pstrdup(doc->pool, cur->value);
4885 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
4886 if (cur->value && *cur->value) {
4887 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
4888 attr_size = apr_pstrdup(doc->pool, cur->value);
4890 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
4891 attr_size = apr_pstrdup(doc->pool, cur->value);
4893 else if (STRCASEEQ('s','S',"small",cur->value)) {
4894 attr_size = apr_pstrdup(doc->pool, cur->value);
4896 else if (STRCASEEQ('m','M',"medium",cur->value)) {
4897 attr_size = apr_pstrdup(doc->pool, cur->value);
4899 else if (STRCASEEQ('l','L',"large",cur->value)) {
4900 attr_size = apr_pstrdup(doc->pool, cur->value);
4902 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
4903 attr_size = apr_pstrdup(doc->pool, cur->value);
4905 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
4906 attr_size = apr_pstrdup(doc->pool, cur->value);
4913 if (attr_type || attr_color || attr_size) {
4916 W_L("list-style-type:");
4921 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
4939 * It is a handler who processes the MENU tag.
4941 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4942 * destination is specified.
4943 * @param node [i] The MENU tag node is specified.
4944 * @return The conversion result is returned.
4947 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
4949 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
4950 Doc *doc = jxhtml->doc;
4952 if (IS_CSS_ON(jxhtml->entryp)) {
4953 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
4960 * It is a handler who processes the PLAINTEXT tag.
4962 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
4963 * destination is specified.
4964 * @param node [i] The PLAINTEXT tag node is specified.
4965 * @return The conversion result is returned.
4968 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
4973 jxhtml = GET_JXHTML(pdoc);
4976 s_jxhtml_start_plaintext_tag_inner(pdoc,node);
4981 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
4986 jxhtml = GET_JXHTML(pdoc);
4988 for (child = qs_get_child_node(doc, node);
4990 child = qs_get_next_node(doc, child)) {
4992 s_jxhtml_start_plaintext_tag_inner(pdoc, child);
4999 * It is a handler who processes the PLAINTEXT tag.
5001 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5002 * destination is specified.
5003 * @param node [i] The PLAINTEXT tag node is specified.
5004 * @return The conversion result is returned.
5007 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
5009 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5015 * It is a handler who processes the BLINK tag.
5017 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5018 * destination is specified.
5019 * @param node [i] The BLINK tag node is specified.
5020 * @return The conversion result is returned.
5023 s_jxhtml_start_blink_tag(void *pdoc, Node *node)
5025 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5026 Doc *doc = jxhtml->doc;
5028 char *attr_style = NULL;
5029 char *attr_color = NULL;
5030 char *attr_size = NULL;
5031 for (attr = qs_get_attr(doc,node);
5033 attr = qs_get_next_attr(doc,attr)) {
5034 char *name = qs_get_attr_name(doc,attr);
5035 char *value = qs_get_attr_value(doc,attr);
5036 if (STRCASEEQ('s','S',"style", name) && value && *value) {
5040 if (IS_CSS_ON(jxhtml->entryp)) {
5041 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5043 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5044 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5045 css_property_t *cur;
5046 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5047 if (cur->value && *cur->value) {
5048 attr_color = apr_pstrdup(doc->pool, cur->value);
5051 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5052 if (cur->value && *cur->value) {
5053 if (STRCASEEQ('x','X',"xx-small",cur->value)) {
5054 attr_size = apr_pstrdup(doc->pool, cur->value);
5056 else if (STRCASEEQ('x','X',"x-small",cur->value)) {
5057 attr_size = apr_pstrdup(doc->pool, cur->value);
5059 else if (STRCASEEQ('s','S',"small",cur->value)) {
5060 attr_size = apr_pstrdup(doc->pool, cur->value);
5062 else if (STRCASEEQ('m','M',"medium",cur->value)) {
5063 attr_size = apr_pstrdup(doc->pool, cur->value);
5065 else if (STRCASEEQ('l','L',"large",cur->value)) {
5066 attr_size = apr_pstrdup(doc->pool, cur->value);
5068 else if (STRCASEEQ('x','X',"x-large",cur->value)) {
5069 attr_size = apr_pstrdup(doc->pool, cur->value);
5071 else if (STRCASEEQ('x','X',"xx-large",cur->value)) {
5072 attr_size = apr_pstrdup(doc->pool, cur->value);
5079 if (attr_color || attr_size) {
5082 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5100 * It is a handler who processes the BLINK tag.
5102 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5103 * destination is specified.
5104 * @param node [i] The BLINK tag node is specified.
5105 * @return The conversion result is returned.
5108 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
5110 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5111 Doc *doc = jxhtml->doc;
5113 if (IS_CSS_ON(jxhtml->entryp)) {
5114 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5121 * It is a handler who processes the MARQUEE tag.
5123 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5124 * destination is specified.
5125 * @param node [i] The MARQUEE tag node is specified.
5126 * @return The conversion result is returned.
5129 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
5131 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5132 Doc *doc = jxhtml->doc;
5134 char *attr_direction = NULL;
5135 char *attr_style = NULL;
5136 char *attr_color = NULL;
5137 char *attr_size = NULL;
5138 char *attr_bgcolor = NULL;
5139 /*--------------------------------------------------------------------------*/
5140 /* Get Attributes */
5141 /*--------------------------------------------------------------------------*/
5142 for (attr = qs_get_attr(doc,node);
5144 attr = qs_get_next_attr(doc,attr)) {
5145 char *name = qs_get_attr_name(doc,attr);
5146 char *value = qs_get_attr_value(doc,attr);
5147 if (STRCASEEQ('d','D',"direction", name)) {
5149 if (STRCASEEQ('l','L',"left",value)) {
5150 attr_direction = "rtl";
5152 else if (STRCASEEQ('r','R',"right",value)) {
5153 attr_direction = "ltr";
5157 else if (STRCASEEQ('b','B',"behavior",name)) {
5160 else if (STRCASEEQ('l','L',"loop",name)) {
5163 else if (STRCASEEQ('b','B',"bgcolor",name)) {
5164 if (value && *value) {
5165 attr_bgcolor = value;
5168 else if (STRCASEEQ('s','S',"style",name) && value && *value) {
5172 if (IS_CSS_ON(jxhtml->entryp)) {
5173 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5175 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5176 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5177 css_property_t *bgcolor_prop = chxj_css_get_property_value(doc, style, "background-color");
5178 css_property_t *direction_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
5179 css_property_t *cur;
5180 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5181 if (cur->value && *cur->value) {
5182 attr_color = apr_pstrdup(doc->pool, cur->value);
5185 for (cur = bgcolor_prop->next; cur != bgcolor_prop; cur = cur->next) {
5186 if (cur->value && *cur->value) {
5187 attr_bgcolor = apr_pstrdup(doc->pool, cur->value);
5190 for (cur = direction_prop->next; cur != direction_prop; cur = cur->next) {
5191 if (cur->value && *cur->value) {
5192 attr_direction = apr_pstrdup(doc->pool, cur->value);
5195 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5196 if (cur->value && *cur->value) {
5197 if ( STRCASEEQ('x','X',"xx-small",cur->value)
5198 || STRCASEEQ('x','X',"x-small", cur->value)
5199 || STRCASEEQ('s','S',"small", cur->value)
5200 || STRCASEEQ('m','M',"medium", cur->value)
5201 || STRCASEEQ('l','L',"large", cur->value)
5202 || STRCASEEQ('x','X',"x-large", cur->value)
5203 || STRCASEEQ('x','X',"xx-large",cur->value)) {
5204 attr_size = apr_pstrdup(doc->pool, cur->value);
5211 if (attr_color || attr_size || attr_direction || attr_bgcolor) {
5213 if (attr_direction) {
5214 W_L("-wap-marquee-dir:");
5215 W_V(attr_direction);
5219 attr_bgcolor = chxj_css_rgb_func_to_value(doc->pool, attr_bgcolor);
5220 W_L("background-color:");
5225 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5244 * It is a handler who processes the MARQUEE tag.
5246 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5247 * destination is specified.
5248 * @param node [i] The MARQUEE tag node is specified.
5249 * @return The conversion result is returned.
5252 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(node))
5254 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5255 Doc *doc = jxhtml->doc;
5257 if (IS_CSS_ON(jxhtml->entryp)) {
5258 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5265 * It is handler who processes the New Line Code.
5268 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
5270 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5271 if (jxhtml->start_html_flag) {
5272 Doc *doc = jxhtml->doc;
5280 * It is a handler who processes the LINK tag.
5282 * @param pdoc [i/o] The pointer to the JXHTML structure at the output
5283 * destination is specified.
5284 * @param node [i] The LINK tag node is specified.
5285 * @return The conversion result is returned.
5288 s_jxhtml_link_tag(void *pdoc, Node *node)
5297 jxhtml = GET_JXHTML(pdoc);
5300 if (! IS_CSS_ON(jxhtml->entryp)) {
5304 for (attr = qs_get_attr(doc,node);
5306 attr = qs_get_next_attr(doc,attr)) {
5307 char *name = qs_get_attr_name(doc,attr);
5308 char *value = qs_get_attr_value(doc,attr);
5309 if (STRCASEEQ('r','R',"rel", name)) {
5310 if (value && *value && STRCASEEQ('s','S',"stylesheet", value)) {
5314 else if (STRCASEEQ('h','H',"href", name)) {
5315 if (value && *value) {
5319 else if (STRCASEEQ('t','T',"type", name)) {
5320 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
5326 if (rel && href && type) {
5327 DBG(doc->r, "start load CSS. url:[%s]", href);
5328 jxhtml->style = chxj_css_parse_from_uri(doc->r, doc->pool, jxhtml->style, href);
5329 DBG(doc->r, "end load CSS. url:[%s]", href);
5336 static css_prop_list_t *
5337 s_jxhtml_push_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
5339 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5340 Doc *doc = jxhtml->doc;
5341 css_prop_list_t *last_css = NULL;
5342 if (IS_CSS_ON(jxhtml->entryp)) {
5343 css_prop_list_t *dup_css;
5344 css_selector_t *selector;
5346 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
5347 dup_css = chxj_dup_css_prop_list(doc, last_css);
5348 selector = chxj_css_find_selector(doc, jxhtml->style, node);
5350 chxj_css_prop_list_merge_property(doc, dup_css, selector);
5352 chxj_css_push_prop_list(jxhtml->css_prop_stack, dup_css);
5353 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
5355 if (style_attr_value) {
5356 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));
5358 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
5366 static css_prop_list_t *
5367 s_jxhtml_nopush_and_get_now_style(void *pdoc, Node *node, const char *style_attr_value)
5369 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5370 Doc *doc = jxhtml->doc;
5371 css_prop_list_t *last_css = NULL;
5372 if (IS_CSS_ON(jxhtml->entryp)) {
5373 css_prop_list_t *dup_css;
5374 css_selector_t *selector;
5376 last_css = chxj_css_get_last_prop_list(jxhtml->css_prop_stack);
5377 dup_css = chxj_dup_css_prop_list(doc, last_css);
5378 selector = chxj_css_find_selector(doc, jxhtml->style, node);
5380 chxj_css_prop_list_merge_property(doc, dup_css, selector);
5384 if (style_attr_value) {
5385 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));
5387 chxj_css_prop_list_merge_property(doc, last_css, ssheet->selector_head.next);
5396 * It is a handler who processes the SPAN tag.
5398 * @param pdoc [i/o] The pointer to the JHTML structure at the output
5399 * destination is specified.
5400 * @param node [i] The SPAN tag node is specified.
5401 * @return The conversion result is returned.
5404 s_jxhtml_start_span_tag(void *pdoc, Node *node)
5409 char *attr_style = NULL;
5410 char *attr_color = NULL;
5411 char *attr_size = NULL;
5412 char *attr_align = NULL;
5413 char *attr_blink = NULL;
5414 char *attr_marquee = NULL;
5415 char *attr_marquee_dir = NULL;
5416 char *attr_marquee_style = NULL;
5417 char *attr_marquee_loop = NULL;
5419 jxhtml = GET_JXHTML(pdoc);
5422 for (attr = qs_get_attr(doc,node);
5424 attr = qs_get_next_attr(doc,attr)) {
5425 char *nm = qs_get_attr_name(doc,attr);
5426 char *val = qs_get_attr_value(doc,attr);
5427 if (val && STRCASEEQ('s','S',"style", nm)) {
5431 if (IS_CSS_ON(jxhtml->entryp)) {
5432 css_prop_list_t *style = s_jxhtml_push_and_get_now_style(pdoc, node, attr_style);
5434 css_property_t *color_prop = chxj_css_get_property_value(doc, style, "color");
5435 css_property_t *size_prop = chxj_css_get_property_value(doc, style, "font-size");
5436 css_property_t *text_align_prop = chxj_css_get_property_value(doc, style, "text-align");
5437 css_property_t *decoration_prop = chxj_css_get_property_value(doc, style, "text-decoration");
5438 css_property_t *display_prop = chxj_css_get_property_value(doc, style, "display");
5439 css_property_t *marquee_dir_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-dir");
5440 css_property_t *marquee_style_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-style");
5441 css_property_t *marquee_loop_prop = chxj_css_get_property_value(doc, style, "-wap-marquee-loop");
5442 css_property_t *cur;
5443 for (cur = color_prop->next; cur != color_prop; cur = cur->next) {
5444 attr_color = apr_pstrdup(doc->pool, cur->value);
5446 for (cur = size_prop->next; cur != size_prop; cur = cur->next) {
5447 if (cur->value && *cur->value) {
5448 if ( STRCASEEQ('x','X',"xx-small",cur->value)
5449 || STRCASEEQ('x','X',"x-small", cur->value)
5450 || STRCASEEQ('s','S',"small", cur->value)
5451 || STRCASEEQ('m','M',"medium", cur->value)
5452 || STRCASEEQ('l','L',"large", cur->value)
5453 || STRCASEEQ('x','X',"x-large", cur->value)
5454 || STRCASEEQ('x','X',"xx-large",cur->value)) {
5455 attr_size = apr_pstrdup(doc->pool, cur->value);
5459 for (cur = decoration_prop->next; cur != decoration_prop; cur = cur->next) {
5460 if (cur->value && STRCASEEQ('b','B',"blink",cur->value)) {
5461 attr_blink = apr_pstrdup(doc->pool, cur->value);
5464 for (cur = display_prop->next; cur != display_prop; cur = cur->next) {
5465 if (cur->value && strcasecmp("-wap-marquee",cur->value) == 0) {
5466 attr_marquee = apr_pstrdup(doc->pool, cur->value);
5469 for (cur = marquee_dir_prop->next; cur != marquee_dir_prop; cur = cur->next) {
5470 if (cur->value && *cur->value) {
5471 if ( STRCASEEQ('l','L',"ltr",cur->value)
5472 || STRCASEEQ('r','R',"rtl",cur->value)) {
5473 attr_marquee_dir = apr_pstrdup(doc->pool, cur->value);
5477 for (cur = marquee_style_prop->next; cur != marquee_style_prop; cur = cur->next) {
5478 if (cur->value && *cur->value) {
5479 if ( STRCASEEQ('s','S',"scroll",cur->value)
5480 || STRCASEEQ('s','S',"slide",cur->value)
5481 || STRCASEEQ('a','A',"alternate",cur->value)) {
5482 attr_marquee_style = apr_pstrdup(doc->pool, cur->value);
5486 for (cur = marquee_loop_prop->next; cur != marquee_loop_prop; cur = cur->next) {
5487 if (cur->value && *cur->value) {
5488 attr_marquee_loop = apr_pstrdup(doc->pool, cur->value);
5491 for (cur = text_align_prop->next; cur != text_align_prop; cur = cur->next) {
5492 if (STRCASEEQ('l','L',"left", cur->value)) {
5493 attr_align = apr_pstrdup(doc->pool, "left");
5495 else if (STRCASEEQ('c','C',"center",cur->value)) {
5496 attr_align = apr_pstrdup(doc->pool, "center");
5498 else if (STRCASEEQ('r','R',"right",cur->value)) {
5499 attr_align = apr_pstrdup(doc->pool, "right");
5506 if (attr_color || attr_size || attr_align || attr_blink || attr_marquee) {
5509 attr_color = chxj_css_rgb_func_to_value(doc->pool, attr_color);
5525 W_L("text-decoration:");
5530 W_L("display:-wap-marquee;");
5531 if (attr_marquee_dir) {
5532 W_L("-wap-marquee-dir:");
5533 W_V(attr_marquee_dir);
5536 if (attr_marquee_style) {
5537 W_L("-wap-marquee-style:");
5538 W_V(attr_marquee_style);
5541 if (attr_marquee_loop) {
5542 W_L("-wap-marquee-loop:");
5543 W_V(attr_marquee_loop);
5555 * It is a handler who processes the SPAN tag.
5557 * @param pdoc [i/o] The pointer to the JHTML structure at the output
5558 * destination is specified.
5559 * @param node [i] The SPAN tag node is specified.
5560 * @return The conversion result is returned.
5563 s_jxhtml_end_span_tag(void *pdoc, Node *UNUSED(node))
5565 jxhtml_t *jxhtml = GET_JXHTML(pdoc);
5566 Doc *doc = jxhtml->doc;
5569 if (IS_CSS_ON(jxhtml->entryp)) {
5570 chxj_css_pop_prop_list(jxhtml->css_prop_stack);
5577 * It is a handler who processes the STYLE tag.
5579 * @param pdoc [i/o] The pointer to the SoftBank XHTML structure at the output
5580 * destination is specified.
5581 * @param node [i] The STYLE tag node is specified.
5582 * @return The conversion result is returned.
5585 s_jxhtml_style_tag(void *pdoc, Node *node)
5592 jxhtml = GET_JXHTML(pdoc);
5595 if (! IS_CSS_ON(jxhtml->entryp)) {
5599 for (attr = qs_get_attr(doc,node);
5601 attr = qs_get_next_attr(doc,attr)) {
5602 char *name = qs_get_attr_name(doc,attr);
5603 char *value = qs_get_attr_value(doc,attr);
5604 if (STRCASEEQ('t','T',"type", name)) {
5605 if (value && *value && STRCASEEQ('t','T',"text/css",value)) {
5611 Node *child = qs_get_child_node(doc, node);
5612 if (type && child) {
5613 char *name = qs_get_node_name(doc, child);
5614 if (STRCASEEQ('t','T',"text", name)) {
5615 char *value = qs_get_node_value(doc, child);
5616 DBG(doc->r, "start load CSS. buf:[%s]", value);
5617 jxhtml->style = chxj_css_parse_style_value(doc, jxhtml->style, value);
5618 DBG(doc->r, "end load CSS. value:[%s]", value);