2 * Copyright (C) 2005-2008 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.
18 #include "chxj_chtml30.h"
19 #include "chxj_hdml.h"
20 #include "chxj_str_util.h"
21 #include "chxj_dump.h"
22 #include "chxj_img_conv.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
26 #define GET_CHTML30(X) ((chtml30_t*)(X))
29 #define W_L(X) do { chtml30->out = BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, (X)); } while(0)
30 #define W_V(X) do { chtml30->out = (X) ? BUFFERED_WRITE_VALUE(chtml30->out, &doc->buf, (X)) \
31 : BUFFERED_WRITE_LITERAL(chtml30->out, &doc->buf, ""); } while(0)
32 extern tag_handler chtml20_handler[];
34 static char *s_chtml30_start_html_tag (void *pdoc, Node *node);
35 static char *s_chtml30_end_html_tag (void *pdoc, Node *node);
36 static char *s_chtml30_start_meta_tag (void *pdoc, Node *node);
37 static char *s_chtml30_end_meta_tag (void *pdoc, Node *node);
38 static char *s_chtml30_start_textarea_tag (void *pdoc, Node *node);
39 static char *s_chtml30_end_textarea_tag (void *pdoc, Node *node);
40 static char *s_chtml30_start_p_tag (void *pdoc, Node *node);
41 static char *s_chtml30_end_p_tag (void *pdoc, Node *node);
42 static char *s_chtml30_start_pre_tag (void *pdoc, Node *node);
43 static char *s_chtml30_end_pre_tag (void *pdoc, Node *node);
44 static char *s_chtml30_start_h1_tag (void *pdoc, Node *node);
45 static char *s_chtml30_end_h1_tag (void *pdoc, Node *node);
46 static char *s_chtml30_start_h2_tag (void *pdoc, Node *node);
47 static char *s_chtml30_end_h2_tag (void *pdoc, Node *node);
48 static char *s_chtml30_start_h3_tag (void *pdoc, Node *node);
49 static char *s_chtml30_end_h3_tag (void *pdoc, Node *node);
50 static char *s_chtml30_start_h4_tag (void *pdoc, Node *node);
51 static char *s_chtml30_end_h4_tag (void *pdoc, Node *node);
52 static char *s_chtml30_start_h5_tag (void *pdoc, Node *node);
53 static char *s_chtml30_end_h5_tag (void *pdoc, Node *node);
54 static char *s_chtml30_start_h6_tag (void *pdoc, Node *node);
55 static char *s_chtml30_end_h6_tag (void *pdoc, Node *node);
56 static char *s_chtml30_start_ul_tag (void *pdoc, Node *node);
57 static char *s_chtml30_end_ul_tag (void *pdoc, Node *node);
58 static char *s_chtml30_start_ol_tag (void *pdoc, Node *node);
59 static char *s_chtml30_end_ol_tag (void *pdoc, Node *node);
60 static char *s_chtml30_start_li_tag (void *pdoc, Node *node);
61 static char *s_chtml30_end_li_tag (void *pdoc, Node *node);
62 static char *s_chtml30_start_head_tag (void *pdoc, Node *node);
63 static char *s_chtml30_end_head_tag (void *pdoc, Node *node);
64 static char *s_chtml30_start_title_tag (void *pdoc, Node *node);
65 static char *s_chtml30_end_title_tag (void *pdoc, Node *node);
66 static char *s_chtml30_start_base_tag (void *pdoc, Node *node);
67 static char *s_chtml30_end_base_tag (void *pdoc, Node *node);
68 static char *s_chtml30_start_body_tag (void *pdoc, Node *node);
69 static char *s_chtml30_end_body_tag (void *pdoc, Node *node);
70 static char *s_chtml30_start_a_tag (void *pdoc, Node *node);
71 static char *s_chtml30_end_a_tag (void *pdoc, Node *node);
72 static char *s_chtml30_start_br_tag (void *pdoc, Node *node);
73 static char *s_chtml30_end_br_tag (void *pdoc, Node *node);
74 static char *s_chtml30_start_tr_tag (void *pdoc, Node *node);
75 static char *s_chtml30_end_tr_tag (void *pdoc, Node *node);
76 static char *s_chtml30_start_font_tag (void *pdoc, Node *node);
77 static char *s_chtml30_end_font_tag (void *pdoc, Node *node);
78 static char *s_chtml30_start_form_tag (void *pdoc, Node *node);
79 static char *s_chtml30_end_form_tag (void *pdoc, Node *node);
80 static char *s_chtml30_start_input_tag (void *pdoc, Node *node);
81 static char *s_chtml30_end_input_tag (void *pdoc, Node *node);
82 static char *s_chtml30_start_center_tag (void *pdoc, Node *node);
83 static char *s_chtml30_end_center_tag (void *pdoc, Node *node);
84 static char *s_chtml30_start_hr_tag (void *pdoc, Node *node);
85 static char *s_chtml30_end_hr_tag (void *pdoc, Node *node);
86 static char *s_chtml30_start_img_tag (void *pdoc, Node *node);
87 static char *s_chtml30_end_img_tag (void *pdoc, Node *node);
88 static char *s_chtml30_start_select_tag (void *pdoc, Node *node);
89 static char *s_chtml30_end_select_tag (void *pdoc, Node *node);
90 static char *s_chtml30_start_option_tag (void *pdoc, Node *node);
91 static char *s_chtml30_end_option_tag (void *pdoc, Node *node);
92 static char *s_chtml30_start_div_tag (void *pdoc, Node *node);
93 static char *s_chtml30_end_div_tag (void *pdoc, Node *node);
94 static char *s_chtml30_chxjif_tag (void *pdoc, Node *node);
95 static char *s_chtml30_text_tag (void *pdoc, Node *node);
96 static char *s_chtml30_start_blockquote_tag(void *pdoc, Node *node);
97 static char *s_chtml30_end_blockquote_tag (void *pdoc, Node *node);
98 static char *s_chtml30_start_dir_tag(void *pdoc, Node *node);
99 static char *s_chtml30_end_dir_tag (void *pdoc, Node *node);
100 static char *s_chtml30_start_dl_tag(void *pdoc, Node *node);
101 static char *s_chtml30_end_dl_tag (void *pdoc, Node *node);
102 static char *s_chtml30_start_dt_tag(void *pdoc, Node *node);
103 static char *s_chtml30_end_dt_tag (void *pdoc, Node *node);
104 static char *s_chtml30_start_dd_tag(void *pdoc, Node *node);
105 static char *s_chtml30_end_dd_tag (void *pdoc, Node *node);
106 static char *s_chtml30_start_marquee_tag(void *pdoc, Node *node);
107 static char *s_chtml30_end_marquee_tag (void *pdoc, Node *node);
108 static char *s_chtml30_start_blink_tag (void *pdoc, Node *node);
109 static char *s_chtml30_end_blink_tag (void *pdoc, Node *node);
110 static char *s_chtml30_start_menu_tag (void *pdoc, Node *node);
111 static char *s_chtml30_end_menu_tag (void *pdoc, Node *node);
112 static char *s_chtml30_start_plaintext_tag (void *pdoc, Node *node);
113 static char *s_chtml30_start_plaintext_tag_inner (void *pdoc, Node *node);
114 static char *s_chtml30_end_plaintext_tag (void *pdoc, Node *node);
116 static void s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
118 static int s_chtml30_search_emoji(chtml30_t *chtml, char *txt, char **rslt);
121 tag_handler chtml30_handler[] = {
124 s_chtml30_start_html_tag,
125 s_chtml30_end_html_tag,
129 s_chtml30_start_meta_tag,
130 s_chtml30_end_meta_tag,
134 s_chtml30_start_textarea_tag,
135 s_chtml30_end_textarea_tag,
139 s_chtml30_start_p_tag,
144 s_chtml30_start_pre_tag,
145 s_chtml30_end_pre_tag,
149 s_chtml30_start_ul_tag,
150 s_chtml30_end_ul_tag,
154 s_chtml30_start_li_tag,
155 s_chtml30_end_li_tag,
159 s_chtml30_start_ol_tag,
160 s_chtml30_end_ol_tag,
164 s_chtml30_start_h1_tag,
165 s_chtml30_end_h1_tag,
169 s_chtml30_start_h2_tag,
170 s_chtml30_end_h2_tag,
174 s_chtml30_start_h3_tag,
175 s_chtml30_end_h3_tag,
179 s_chtml30_start_h4_tag,
180 s_chtml30_end_h4_tag,
184 s_chtml30_start_h5_tag,
185 s_chtml30_end_h5_tag,
189 s_chtml30_start_h6_tag,
190 s_chtml30_end_h6_tag,
194 s_chtml30_start_head_tag,
195 s_chtml30_end_head_tag,
199 s_chtml30_start_title_tag,
200 s_chtml30_end_title_tag,
204 s_chtml30_start_base_tag,
205 s_chtml30_end_base_tag,
209 s_chtml30_start_body_tag,
210 s_chtml30_end_body_tag,
214 s_chtml30_start_a_tag,
219 s_chtml30_start_br_tag,
220 s_chtml30_end_br_tag,
229 s_chtml30_start_tr_tag,
230 s_chtml30_end_tr_tag,
244 s_chtml30_start_font_tag,
245 s_chtml30_end_font_tag,
249 s_chtml30_start_form_tag,
250 s_chtml30_end_form_tag,
254 s_chtml30_start_input_tag,
255 s_chtml30_end_input_tag,
259 s_chtml30_start_center_tag,
260 s_chtml30_end_center_tag,
264 s_chtml30_start_hr_tag,
265 s_chtml30_end_hr_tag,
269 s_chtml30_start_img_tag,
270 s_chtml30_end_img_tag,
274 s_chtml30_start_select_tag,
275 s_chtml30_end_select_tag,
279 s_chtml30_start_option_tag,
280 s_chtml30_end_option_tag,
284 s_chtml30_start_div_tag,
285 s_chtml30_end_div_tag,
289 s_chtml30_chxjif_tag,
334 s_chtml30_start_dt_tag,
335 s_chtml30_end_dt_tag,
349 s_chtml30_start_blockquote_tag,
350 s_chtml30_end_blockquote_tag,
354 s_chtml30_start_dir_tag,
355 s_chtml30_end_dir_tag,
359 s_chtml30_start_dl_tag,
360 s_chtml30_end_dl_tag,
364 s_chtml30_start_dd_tag,
365 s_chtml30_end_dd_tag,
369 s_chtml30_start_menu_tag,
370 s_chtml30_end_menu_tag,
374 s_chtml30_start_plaintext_tag,
375 s_chtml30_end_plaintext_tag,
379 s_chtml30_start_blink_tag,
380 s_chtml30_end_blink_tag,
384 s_chtml30_start_marquee_tag,
385 s_chtml30_end_marquee_tag,
391 * converts from CHTML5.0 to CHTML3.0.
393 * @param r [i] Requet_rec is appointed.
394 * @param spec [i] The result of the device specification processing which
395 * was done in advance is appointed.
396 * @param src [i] The character string before the converting is appointed.
397 * @return The character string after the converting is returned.
400 chxj_exchange_chtml30(
406 chxjconvrule_entry* entryp,
415 DBG(r, "start chxj_exchange_chtml30()");
417 /*--------------------------------------------------------------------------*/
419 /*--------------------------------------------------------------------------*/
421 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
423 DBG(r,"i found qrcode xml");
424 DBG(r, "end chxj_exchange_chtml30()");
427 DBG(r,"not found qrcode xml");
429 /*--------------------------------------------------------------------------*/
430 /* The CHTML structure is initialized. */
431 /*--------------------------------------------------------------------------*/
432 s_init_chtml30(&chtml30, &doc, r, spec);
434 chtml30.entryp = entryp;
435 chtml30.cookie = cookie;
437 chxj_set_content_type(r, "text/html; charset=Windows-31J");
439 /*--------------------------------------------------------------------------*/
440 /* The character string of the input is analyzed. */
441 /*--------------------------------------------------------------------------*/
442 qs_init_malloc(&doc);
443 qs_init_root_node(&doc);
445 ss = apr_pcalloc(r->pool, srclen + 1);
446 memset(ss, 0, srclen + 1);
447 memcpy(ss, src, srclen);
450 chxj_dump_out("[src] CHTML -> CHTML3.0", ss, srclen);
452 chxj_buffered_write_init(r->pool, &doc.buf);
454 qs_parse_string(&doc,ss, strlen(ss));
456 /*--------------------------------------------------------------------------*/
457 /* It converts it from CHTML to CHTML. */
458 /*--------------------------------------------------------------------------*/
459 chxj_node_exchange(spec,r,(void*)&chtml30, &doc, qs_get_root(&doc), 0);
460 chtml30.out = chxj_buffered_write_flush(chtml30.out, &doc.buf);
461 dst = apr_pstrdup(r->pool, chtml30.out);
462 chxj_buffered_write_terminate(&doc.buf);
464 qs_all_free(&doc,QX_LOGMARK);
467 dst = apr_pstrdup(r->pool,ss);
469 if (strlen(dst) == 0) {
470 dst = apr_psprintf(r->pool, "\n");
473 *dstlen = strlen(dst);
476 chxj_dump_out("[src] CHTML -> CHTML3.0", dst, *dstlen);
479 DBG(r, "end chxj_exchange_chtml30()");
485 * The CHTML structure is initialized.
487 * @param chtml30 [i/o] The pointer to the HDML structure that wants to be
488 * initialized is specified.
489 * @param doc [i] The Doc structure that should be set to the initialized
490 * HDML structure is specified.
491 * @param r [i] To use POOL, the pointer to request_rec is specified.
492 * @param spec [i] The pointer to the device_table
495 s_init_chtml30(chtml30_t* chtml30, Doc* doc, request_rec* r, device_table* spec)
497 memset(doc, 0, sizeof(Doc));
498 memset(chtml30, 0, sizeof(chtml30_t));
502 chtml30->spec = spec;
503 chtml30->out = qs_alloc_zero_byte_string(r);
504 chtml30->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
505 chtml30->doc->parse_mode = PARSE_MODE_CHTML;
510 * Corresponding EMOJI to a current character-code is retrieved.
511 * The substitution character string is stored in the rslt pointer if agreeing.
513 * @param chtml30 [i] The pointer to the CHTML structure is specified.
514 * @param txt [i] The character string to want to examine whether it is
515 * EMOJI is specified.
516 * @param rslt [o] The pointer to the pointer that stores the result is
518 * @return When corresponding EMOJI exists, it returns it excluding 0.
521 s_chtml30_search_emoji(chtml30_t* chtml30, char* txt, char** rslt)
528 spec = chtml30->spec;
534 DBG(r,"spec is NULL");
536 for (ee = chtml30->conf->emoji;
540 if (ee->imode == NULL) {
541 DBG(r, "emoji->imode is NULL");
545 if (ee->imode->string != NULL
546 && strlen(ee->imode->string) > 0
547 && strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
549 if (spec == NULL || spec->emoji_type == NULL) {
550 *rslt = apr_palloc(r->pool, 3);
551 (*rslt)[0] = ee->imode->hex1byte & 0xff;
552 (*rslt)[1] = ee->imode->hex2byte & 0xff;
554 return strlen(ee->imode->string);
566 * It is a handler who processes the HTML tag.
568 * @param pdoc [i/o] The pointer to the CHTML structure at the output
569 * destination is specified.
570 * @param node [i] The HTML tag node is specified.
571 * @return The conversion result is returned.
574 s_chtml30_start_html_tag(void* pdoc, Node* UNUSED(node))
580 chtml30 = GET_CHTML30(pdoc);
584 /*--------------------------------------------------------------------------*/
586 /*--------------------------------------------------------------------------*/
593 * It is a handler who processes the HTML tag.
595 * @param pdoc [i/o] The pointer to the CHTML structure at the output
596 * destination is specified.
597 * @param node [i] The HTML tag node is specified.
598 * @return The conversion result is returned.
601 s_chtml30_end_html_tag(void* pdoc, Node* UNUSED(child))
607 chtml30 = GET_CHTML30(pdoc);
617 * It is a handler who processes the META tag.
619 * @param pdoc [i/o] The pointer to the CHTML structure at the output
620 * destination is specified.
621 * @param node [i] The META tag node is specified.
622 * @return The conversion result is returned.
625 s_chtml30_start_meta_tag(void* pdoc, Node* node)
631 int content_type_flag;
634 chtml30 = GET_CHTML30(pdoc);
638 content_type_flag = 0;
643 /*--------------------------------------------------------------------------*/
645 /*--------------------------------------------------------------------------*/
646 for (attr = qs_get_attr(doc,node);
648 attr = qs_get_next_attr(doc,attr)) {
653 name = qs_get_attr_name(doc,attr);
654 value = qs_get_attr_value(doc,attr);
659 if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
660 /*----------------------------------------------------------------------*/
662 /*----------------------------------------------------------------------*/
663 W_L(" http-equiv=\"");
666 if (STRCASEEQ('c','C',"content-type", value))
667 content_type_flag = 1;
669 if (STRCASEEQ('r','R',"refresh", value))
676 if (strcasecmp(name, "content") == 0 && value && *value) {
677 if (content_type_flag) {
680 W_L("=\"text/html; charset=Windows-31J\"");
688 buf = apr_pstrdup(r->pool, value);
690 url = strchr(buf, ';');
692 sec = apr_pstrdup(r->pool, buf);
695 url = chxj_encoding_parameter(r, url);
696 url = chxj_add_cookie_parameter(r, url, chtml30->cookie);
728 * It is a handler who processes the META tag.
730 * @param pdoc [i/o] The pointer to the CHTML structure at the output
731 * destination is specified.
732 * @param node [i] The META tag node is specified.
733 * @return The conversion result is returned.
736 s_chtml30_end_meta_tag(void* pdoc, Node* UNUSED(child))
740 chtml30 = GET_CHTML30(pdoc);
747 * It is a handler who processes the HEAD tag.
749 * @param pdoc [i/o] The pointer to the CHTML structure at the output
750 * destination is specified.
751 * @param node [i] The HEAD tag node is specified.
752 * @return The conversion result is returned.
755 s_chtml30_start_head_tag(void* pdoc, Node* UNUSED(node))
761 chtml30 = GET_CHTML30(pdoc);
772 * It is a handler who processes the HEAD tag.
774 * @param pdoc [i/o] The pointer to the CHTML structure at the output
775 * destination is specified.
776 * @param node [i] The HEAD tag node is specified.
777 * @return The conversion result is returned.
780 s_chtml30_end_head_tag(void *pdoc, Node *UNUSED(node))
786 chtml30 = GET_CHTML30(pdoc);
797 * It is a handler who processes the TITLE tag.
799 * @param pdoc [i/o] The pointer to the CHTML structure at the output
800 * destination is specified.
801 * @param node [i] The TITLE tag node is specified.
802 * @return The conversion result is returned.
805 s_chtml30_start_title_tag(void* pdoc, Node* UNUSED(node))
811 chtml30 = GET_CHTML30(pdoc);
822 * It is a handler who processes the TITLE tag.
824 * @param pdoc [i/o] The pointer to the CHTML structure at the output
825 * destination is specified.
826 * @param node [i] The TITLE tag node is specified.
827 * @return The conversion result is returned.
830 s_chtml30_end_title_tag(void* pdoc, Node* UNUSED(child))
836 chtml30 = GET_CHTML30(pdoc);
847 * It is a handler who processes the BASE tag.
849 * @param pdoc [i/o] The pointer to the CHTML structure at the output
850 * destination is specified.
851 * @param node [i] The BASE tag node is specified.
852 * @return The conversion result is returned.
855 s_chtml30_start_base_tag(void *pdoc, Node *node)
862 chtml30 = GET_CHTML30(pdoc);
867 /*--------------------------------------------------------------------------*/
869 /*--------------------------------------------------------------------------*/
870 for (attr = qs_get_attr(doc,node);
872 attr = qs_get_next_attr(doc,attr)) {
873 char *name = qs_get_attr_name(doc,attr);
874 char *value = qs_get_attr_value(doc,attr);
875 if (STRCASEEQ('h','H',"href", name)) {
887 * It is a handler who processes the BASE tag.
889 * @param pdoc [i/o] The pointer to the CHTML structure at the output
890 * destination is specified.
891 * @param node [i] The BASE tag node is specified.
892 * @return The conversion result is returned.
895 s_chtml30_end_base_tag(void* pdoc, Node* UNUSED(child))
899 chtml30 = GET_CHTML30(pdoc);
906 * It is a handler who processes the BODY tag.
908 * @param pdoc [i/o] The pointer to the CHTML structure at the output
909 * destination is specified.
910 * @param node [i] The BODY tag node is specified.
911 * @return The conversion result is returned.
914 s_chtml30_start_body_tag(void *pdoc, Node *node)
921 chtml30 = GET_CHTML30(pdoc);
927 /*--------------------------------------------------------------------------*/
929 /*--------------------------------------------------------------------------*/
930 for (attr = qs_get_attr(doc,node);
932 attr = qs_get_next_attr(doc,attr)) {
933 char *name = qs_get_attr_name(doc,attr);
934 char *value = qs_get_attr_value(doc,attr);
935 if (STRCASEEQ('b','B', "bgcolor", name) && value && *value) {
936 /*----------------------------------------------------------------------*/
938 /*----------------------------------------------------------------------*/
943 else if (STRCASEEQ('t','T', "text", name) && value && *value) {
944 /*----------------------------------------------------------------------*/
946 /*----------------------------------------------------------------------*/
951 else if (STRCASEEQ('l','L',"link", name) && value && *value) {
952 /*----------------------------------------------------------------------*/
954 /*----------------------------------------------------------------------*/
959 else if (STRCASEEQ('a','A',"alink", name)) {
960 /*----------------------------------------------------------------------*/
962 /*----------------------------------------------------------------------*/
965 else if (STRCASEEQ('v','V',"vlink", name)) {
966 /*----------------------------------------------------------------------*/
968 /*----------------------------------------------------------------------*/
978 * It is a handler who processes the BODY tag.
980 * @param pdoc [i/o] The pointer to the CHTML structure at the output
981 * destination is specified.
982 * @param node [i] The BODY tag node is specified.
983 * @return The conversion result is returned.
986 s_chtml30_end_body_tag(void *pdoc, Node *UNUSED(child))
992 chtml30 = GET_CHTML30(pdoc);
1003 * It is a handler who processes the A tag.
1005 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1006 * destination is specified.
1007 * @param node [i] The A tag node is specified.
1008 * @return The conversion result is returned.
1011 s_chtml30_start_a_tag(void* pdoc, Node* node)
1018 chtml30 = GET_CHTML30(pdoc);
1024 /*--------------------------------------------------------------------------*/
1025 /* Get Attributes */
1026 /*--------------------------------------------------------------------------*/
1027 for (attr = qs_get_attr(doc,node);
1029 attr = qs_get_next_attr(doc,attr)) {
1034 name = qs_get_attr_name(doc,attr);
1035 value = qs_get_attr_value(doc,attr);
1037 if (STRCASEEQ('n','N',"name", name)) {
1038 /*----------------------------------------------------------------------*/
1040 /*----------------------------------------------------------------------*/
1045 else if (STRCASEEQ('h','H',"href", name)) {
1046 /*----------------------------------------------------------------------*/
1048 /*----------------------------------------------------------------------*/
1049 value = chxj_encoding_parameter(r, value);
1050 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1055 else if (STRCASEEQ('a','A',"accesskey", name)) {
1056 /*----------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------*/
1059 W_L(" accesskey=\"");
1063 else if (STRCASEEQ('c','C',"cti", name)) {
1064 /*----------------------------------------------------------------------*/
1066 /*----------------------------------------------------------------------*/
1071 else if (STRCASEEQ('i','I',"ijam", name)) {
1072 /*----------------------------------------------------------------------*/
1074 /*----------------------------------------------------------------------*/
1077 else if (STRCASEEQ('u','U',"utn", name)) {
1078 /*----------------------------------------------------------------------*/
1080 /* It is special only for CHTML. */
1081 /*----------------------------------------------------------------------*/
1084 else if (STRCASEEQ('t','T',"telbook", name)) {
1085 /*----------------------------------------------------------------------*/
1087 /*----------------------------------------------------------------------*/
1090 else if (STRCASEEQ('k','K',"kana", name)) {
1091 /*----------------------------------------------------------------------*/
1093 /*----------------------------------------------------------------------*/
1096 else if (STRCASEEQ('e','E',"email", name)) {
1097 /*----------------------------------------------------------------------*/
1099 /*----------------------------------------------------------------------*/
1102 else if (STRCASEEQ('i','I',"ista", name)) {
1103 /*----------------------------------------------------------------------*/
1105 /*----------------------------------------------------------------------*/
1108 else if (STRCASEEQ('i','I',"ilet", name)) {
1109 /*----------------------------------------------------------------------*/
1111 /*----------------------------------------------------------------------*/
1114 else if (STRCASEEQ('i','I',"iswf", name)) {
1115 /*----------------------------------------------------------------------*/
1117 /*----------------------------------------------------------------------*/
1120 else if (STRCASEEQ('i','I',"irst", name)) {
1121 /*----------------------------------------------------------------------*/
1123 /*----------------------------------------------------------------------*/
1130 return chtml30->out;
1135 * It is a handler who processes the A tag.
1137 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1138 * destination is specified.
1139 * @param node [i] The A tag node is specified.
1140 * @return The conversion result is returned.
1143 s_chtml30_end_a_tag(void* pdoc, Node* UNUSED(child))
1149 chtml30 = GET_CHTML30(pdoc);
1155 return chtml30->out;
1160 * It is a handler who processes the BR tag.
1162 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1163 * destination is specified.
1164 * @param node [i] The BR tag node is specified.
1165 * @return The conversion result is returned.
1168 s_chtml30_start_br_tag(void *pdoc, Node *node)
1175 chtml30 = GET_CHTML30(pdoc);
1179 /*--------------------------------------------------------------------------*/
1180 /* Get Attributes */
1181 /*--------------------------------------------------------------------------*/
1182 for (attr = qs_get_attr(doc,node);
1184 attr = qs_get_next_attr(doc,attr)) {
1188 name = qs_get_attr_name(doc,attr);
1189 value = qs_get_attr_value(doc,attr);
1191 if (STRCASEEQ('c','C',"clear",name)) {
1192 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1200 return chtml30->out;
1205 * It is a handler who processes the BR tag.
1207 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1208 * destination is specified.
1209 * @param node [i] The BR tag node is specified.
1210 * @return The conversion result is returned.
1213 s_chtml30_end_br_tag(void *pdoc, Node *UNUSED(child))
1215 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1216 return chtml30->out;
1221 * It is a handler who processes the TR tag.
1223 * @param chtml30 [i/o] The pointer to the CHTML structure at the output
1224 * destination is specified.
1225 * @param node [i] The TR tag node is specified.
1226 * @return The conversion result is returned.
1229 s_chtml30_start_tr_tag(void* pdoc, Node* UNUSED(node))
1233 chtml30 = GET_CHTML30(pdoc);
1235 return chtml30->out;
1240 * It is a handler who processes the TR tag.
1242 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1243 * destination is specified.
1244 * @param node [i] The TR tag node is specified.
1245 * @return The conversion result is returned.
1248 s_chtml30_end_tr_tag(void* pdoc, Node* UNUSED(child))
1254 chtml30 = GET_CHTML30(pdoc);
1260 return chtml30->out;
1265 * It is a handler who processes the FONT tag.
1267 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1268 * destination is specified.
1269 * @param node [i] The FONT tag node is specified.
1270 * @return The conversion result is returned.
1273 s_chtml30_start_font_tag(void *pdoc, Node *node)
1280 chtml30 = GET_CHTML30(pdoc);
1286 /*--------------------------------------------------------------------------*/
1287 /* Get Attributes */
1288 /*--------------------------------------------------------------------------*/
1289 for (attr = qs_get_attr(doc,node);
1291 attr = qs_get_next_attr(doc,attr)) {
1292 char *name = qs_get_attr_name(doc,attr);
1293 char *value = qs_get_attr_value(doc,attr);
1294 if (STRCASEEQ('c','C',"color", name) && value && *value) {
1299 else if (STRCASEEQ('s','S',"size", name)) {
1300 /*----------------------------------------------------------------------*/
1302 /*----------------------------------------------------------------------*/
1309 return chtml30->out;
1314 * It is a handler who processes the FONT tag.
1316 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1317 * destination is specified.
1318 * @param node [i] The FONT tag node is specified.
1319 * @return The conversion result is returned.
1322 s_chtml30_end_font_tag(void *pdoc, Node *UNUSED(child))
1328 chtml30 = GET_CHTML30(pdoc);
1334 return chtml30->out;
1339 * It is a handler who processes the FORM tag.
1341 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1342 * destination is specified.
1343 * @param node [i] The FORM tag node is specified.
1344 * @return The conversion result is returned.
1347 s_chtml30_start_form_tag(void *pdoc, Node *node)
1354 chtml30 = GET_CHTML30(pdoc);
1359 /*--------------------------------------------------------------------------*/
1360 /* Get Attributes */
1361 /*--------------------------------------------------------------------------*/
1362 for (attr = qs_get_attr(doc,node);
1364 attr = qs_get_next_attr(doc,attr)) {
1365 char *name = qs_get_attr_name(doc,attr);
1366 char *value = qs_get_attr_value(doc,attr);
1367 if (STRCASEEQ('a','A',"action", name)) {
1368 /*----------------------------------------------------------------------*/
1370 /*----------------------------------------------------------------------*/
1371 value = chxj_encoding_parameter(r, value);
1372 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1377 else if (STRCASEEQ('m','M',"method", name)) {
1378 /*----------------------------------------------------------------------*/
1380 /*----------------------------------------------------------------------*/
1385 else if (STRCASEEQ('u','U',"utn", name)) {
1386 /*----------------------------------------------------------------------*/
1388 /* It is special only for CHTML. */
1389 /*----------------------------------------------------------------------*/
1394 return chtml30->out;
1399 * It is a handler who processes the FORM tag.
1401 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1402 * destination is specified.
1403 * @param node [i] The FORM tag node is specified.
1404 * @return The conversion result is returned.
1407 s_chtml30_end_form_tag(void* pdoc, Node* UNUSED(child))
1413 chtml30 = GET_CHTML30(pdoc);
1419 return chtml30->out;
1424 * It is a handler who processes the INPUT tag.
1426 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1427 * destination is specified.
1428 * @param node [i] The INPUT tag node is specified.
1429 * @return The conversion result is returned.
1432 s_chtml30_start_input_tag(void *pdoc, Node *node)
1437 char *max_length = NULL;
1441 char *istyle = NULL;
1443 char *checked = NULL;
1444 char *accesskey = NULL;
1446 chtml30 = GET_CHTML30(pdoc);
1450 /*--------------------------------------------------------------------------*/
1451 /* Get Attributes */
1452 /*--------------------------------------------------------------------------*/
1453 type = qs_get_type_attr(doc, node, r);
1454 name = qs_get_name_attr(doc, node, r);
1455 value = qs_get_value_attr(doc,node,r);
1456 istyle = qs_get_istyle_attr(doc,node,r);
1457 max_length = qs_get_maxlength_attr(doc,node,r);
1458 checked = qs_get_checked_attr(doc,node,r);
1459 accesskey = qs_get_accesskey_attr(doc, node, r);
1460 size = qs_get_size_attr(doc, node, r);
1463 type = qs_trim_string(doc->buf.pool, type);
1464 if (type && (STRCASEEQ('t','T',"text", type) ||
1465 STRCASEEQ('p','P',"password",type) ||
1466 STRCASEEQ('c','C',"checkbox",type) ||
1467 STRCASEEQ('r','R',"radio", type) ||
1468 STRCASEEQ('h','H',"hidden", type) ||
1469 STRCASEEQ('s','S',"submit", type) ||
1470 STRCASEEQ('r','R',"reset", type))) {
1476 if (size && *size) {
1481 if (name && *name) {
1486 if (value && *value) {
1491 if (accesskey && *accesskey) {
1492 W_L(" accesskey=\"");
1497 /*------------------------------------------------------------------------*/
1499 /*------------------------------------------------------------------------*/
1500 if (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4') {
1507 /*--------------------------------------------------------------------------*/
1508 /* The figure is default for the password. */
1509 /*--------------------------------------------------------------------------*/
1510 if (max_length && *max_length) {
1511 if (chxj_chk_numeric(max_length) != 0) {
1512 max_length = apr_psprintf(r->pool, "0");
1514 if (istyle != NULL && *istyle == '1') {
1515 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length) * 2);
1519 char *vv = apr_psprintf(doc->buf.pool, " maxlength=\"%d\"", chxj_atoi(max_length));
1527 return chtml30->out;
1532 * It is a handler who processes the INPUT tag.
1534 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1535 * destination is specified.
1536 * @param node [i] The INPUT tag node is specified.
1537 * @return The conversion result is returned.
1540 s_chtml30_end_input_tag(void* pdoc, Node* UNUSED(child))
1544 chtml30 = GET_CHTML30(pdoc);
1546 return chtml30->out;
1551 * It is a handler who processes the CENTER tag.
1553 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1554 * destination is specified.
1555 * @param node [i] The CENTER tag node is specified.
1556 * @return The conversion result is returned.
1559 s_chtml30_start_center_tag(void* pdoc, Node* UNUSED(node))
1565 chtml30 = GET_CHTML30(pdoc);
1571 return chtml30->out;
1576 * It is a handler who processes the CENTER tag.
1578 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1579 * destination is specified.
1580 * @param node [i] The CENTER tag node is specified.
1581 * @return The conversion result is returned.
1584 s_chtml30_end_center_tag(void* pdoc, Node* UNUSED(child))
1590 chtml30 = GET_CHTML30(pdoc);
1596 return chtml30->out;
1601 * It is a handler who processes the HR tag.
1603 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1604 * destination is specified.
1605 * @param node [i] The HR tag node is specified.
1606 * @return The conversion result is returned.
1609 s_chtml30_start_hr_tag(void* pdoc, Node* node)
1616 chtml30 = GET_CHTML30(pdoc);
1622 for (attr = qs_get_attr(doc,node);
1624 attr = qs_get_next_attr(doc,attr)) {
1625 char* name = qs_get_attr_name(doc,attr);
1626 char* value = qs_get_attr_value(doc,attr);
1628 if (STRCASEEQ('a','A',"align", name)) {
1629 /*----------------------------------------------------------------------*/
1631 /*----------------------------------------------------------------------*/
1632 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
1638 else if (STRCASEEQ('s','S',"size", name)) {
1639 /*----------------------------------------------------------------------*/
1641 /*----------------------------------------------------------------------*/
1642 if (value && *value) {
1648 else if (STRCASEEQ('w','W',"width", name)) {
1649 /*----------------------------------------------------------------------*/
1651 /*----------------------------------------------------------------------*/
1652 if (value && *value) {
1658 else if (STRCASEEQ('n','N',"noshade", name)) {
1659 /*----------------------------------------------------------------------*/
1661 /*----------------------------------------------------------------------*/
1664 else if (STRCASEEQ('c','C',"color", name)) {
1665 /*----------------------------------------------------------------------*/
1667 /*----------------------------------------------------------------------*/
1674 return chtml30->out;
1679 * It is a handler who processes the HR tag.
1681 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1682 * destination is specified.
1683 * @param node [i] The HR tag node is specified.
1684 * @return The conversion result is returned.
1687 s_chtml30_end_hr_tag(void* pdoc, Node* UNUSED(child))
1691 chtml30 = GET_CHTML30(pdoc);
1693 return chtml30->out;
1698 * It is a handler who processes the IMG tag.
1700 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1701 * destination is specified.
1702 * @param node [i] The IMG tag node is specified.
1703 * @return The conversion result is returned.
1706 s_chtml30_start_img_tag(void *pdoc, Node *node)
1708 #ifndef IMG_NOT_CONVERT_FILENAME
1716 chtml30 = GET_CHTML30(pdoc);
1719 #ifndef IMG_NOT_CONVERT_FILENAME
1720 spec = chtml30->spec;
1724 /*--------------------------------------------------------------------------*/
1725 /* Get Attributes */
1726 /*--------------------------------------------------------------------------*/
1727 for (attr = qs_get_attr(doc,node);
1729 attr = qs_get_next_attr(doc,attr)) {
1730 char* name = qs_get_attr_name(doc,attr);
1731 char* value = qs_get_attr_value(doc,attr);
1733 if (STRCASEEQ('s','S',"src", name)) {
1734 /*----------------------------------------------------------------------*/
1736 /*----------------------------------------------------------------------*/
1737 #ifdef IMG_NOT_CONVERT_FILENAME
1738 value = chxj_encoding_parameter(r, value);
1739 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1741 value = apr_psprintf(r->pool,
1744 (strchr(value, '?')) ? '&' : '?',
1745 CHXJ_COOKIE_NOUPDATE_PARAM);
1752 value = chxj_img_conv(r,spec,value);
1753 value = chxj_encoding_parameter(r, value);
1754 value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
1756 value = apr_psprintf(r->pool,
1759 (strchr(value, '?')) ? '&' : '?',
1760 CHXJ_COOKIE_NOUPDATE_PARAM);
1767 else if (STRCASEEQ('a','A',"align", name)) {
1768 /*----------------------------------------------------------------------*/
1770 /*----------------------------------------------------------------------*/
1771 if (value && (STRCASEEQ('t','T',"top", value) ||
1772 STRCASEEQ('m','M',"middle",value) ||
1773 STRCASEEQ('b','B',"bottom",value) ||
1774 STRCASEEQ('l','L',"left", value) ||
1775 STRCASEEQ('r','R',"right", value))) {
1781 else if (STRCASEEQ('w','W',"width", name) && value && *value) {
1782 /*----------------------------------------------------------------------*/
1784 /*----------------------------------------------------------------------*/
1789 else if (STRCASEEQ('h','H', "height", name) && value && *value) {
1790 /*----------------------------------------------------------------------*/
1792 /*----------------------------------------------------------------------*/
1797 else if (STRCASEEQ('h','H',"hspace", name) && value && *value) {
1798 /*----------------------------------------------------------------------*/
1800 /*----------------------------------------------------------------------*/
1805 else if (STRCASEEQ('v','V',"vspace", name) && value && *value) {
1806 /*----------------------------------------------------------------------*/
1808 /*----------------------------------------------------------------------*/
1813 else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
1814 /*----------------------------------------------------------------------*/
1816 /*----------------------------------------------------------------------*/
1821 else if (STRCASEEQ('a','A',"align", name) && value && *value) {
1822 /*----------------------------------------------------------------------*/
1824 /*----------------------------------------------------------------------*/
1831 return chtml30->out;
1836 * It is a handler who processes the IMG tag.
1838 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1839 * destination is specified.
1840 * @param node [i] The IMG tag node is specified.
1841 * @return The conversion result is returned.
1844 s_chtml30_end_img_tag(void* pdoc, Node* UNUSED(child))
1848 chtml30 = GET_CHTML30(pdoc);
1850 return chtml30->out;
1855 * It is a handler who processes the SELECT tag.
1857 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1858 * destination is specified.
1859 * @param node [i] The SELECT tag node is specified.
1860 * @return The conversion result is returned.
1863 s_chtml30_start_select_tag(void* pdoc, Node* child)
1865 chtml30_t *chtml30 = GET_CHTML30(pdoc);
1866 Doc *doc = chtml30->doc;
1869 char *multiple = NULL;
1874 for (attr = qs_get_attr(doc,child);
1876 attr = qs_get_next_attr(doc,attr)) {
1877 char *nm = qs_get_attr_name(doc,attr);
1878 char *val = qs_get_attr_value(doc,attr);
1879 if (STRCASEEQ('s','S',"size", nm)) {
1880 /*----------------------------------------------------------------------*/
1881 /* CHTML 1.0 version 2.0 */
1882 /*----------------------------------------------------------------------*/
1883 size = apr_pstrdup(doc->buf.pool, val);
1885 else if (STRCASEEQ('n','N',"name", nm)) {
1886 /*----------------------------------------------------------------------*/
1887 /* CHTML 1.0 version 2.0 */
1888 /*----------------------------------------------------------------------*/
1889 name = apr_pstrdup(doc->buf.pool, val);
1891 else if (STRCASEEQ('m','M',"multiple", nm)) {
1892 /*----------------------------------------------------------------------*/
1893 /* CHTML 1.0 version 2.0 */
1894 /*----------------------------------------------------------------------*/
1895 multiple = apr_pstrdup(doc->buf.pool, val);
1898 if (size && *size) {
1903 if (name && *name) {
1912 return chtml30->out;
1917 * It is a handler who processes the SELECT tag.
1919 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1920 * destination is specified.
1921 * @param node [i] The SELECT tag node is specified.
1922 * @return The conversion result is returned.
1925 s_chtml30_end_select_tag(void* pdoc, Node* UNUSED(child))
1931 chtml30 = GET_CHTML30(pdoc);
1935 return chtml30->out;
1940 * It is a handler who processes the OPTION tag.
1942 * @param pdoc [i/o] The pointer to the CHTML structure at the output
1943 * destination is specified.
1944 * @param node [i] The OPTION tag node is specified.
1945 * @return The conversion result is returned.
1948 s_chtml30_start_option_tag(void *pdoc, Node *child)
1957 chtml30 = GET_CHTML30(pdoc);
1964 for (attr = qs_get_attr(doc,child);
1966 attr = qs_get_next_attr(doc,attr)) {
1967 char *nm = qs_get_attr_name(doc,attr);
1968 char *val = qs_get_attr_value(doc,attr);
1969 if (STRCASEEQ('s','S',"selected", nm)) {
1970 /*----------------------------------------------------------------------*/
1971 /* CHTML 1.0 version 2.0 */
1972 /*----------------------------------------------------------------------*/
1973 selected = apr_pstrdup(doc->buf.pool, val);
1975 else if (STRCASEEQ('v','V',"value", nm)) {
1976 /*----------------------------------------------------------------------*/
1977 /* CHTML 1.0 version 2.0 */
1978 /*----------------------------------------------------------------------*/
1979 value = apr_pstrdup(doc->buf.pool, val);
1982 if (value && *value) {
1992 return chtml30->out;
1997 * It is a handler who processes the OPTION tag.
1999 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2000 * destination is specified.
2001 * @param node [i] The OPTION tag node is specified.
2002 * @return The conversion result is returned.
2005 s_chtml30_end_option_tag(void* pdoc, Node* UNUSED(child))
2009 chtml30 = GET_CHTML30(pdoc);
2013 return chtml30->out;
2018 * It is a handler who processes the DIV tag.
2020 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2021 * destination is specified.
2022 * @param node [i] The DIV tag node is specified.
2023 * @return The conversion result is returned.
2026 s_chtml30_start_div_tag(void *pdoc, Node *child)
2034 chtml30 = GET_CHTML30(pdoc);
2041 for (attr = qs_get_attr(doc,child);
2043 attr = qs_get_next_attr(doc,attr)) {
2044 char* nm = qs_get_attr_name(doc,attr);
2045 char* val = qs_get_attr_value(doc,attr);
2047 if (STRCASEEQ('a','A',"align", nm)) {
2048 /*----------------------------------------------------------------------*/
2049 /* CHTML 1.0 (W3C version 3.2) */
2050 /*----------------------------------------------------------------------*/
2051 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2052 align = apr_pstrdup(doc->buf.pool, val);
2065 return chtml30->out;
2070 * It is a handler who processes the DIV tag.
2072 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2073 * destination is specified.
2074 * @param node [i] The DIV tag node is specified.
2075 * @return The conversion result is returned.
2078 s_chtml30_end_div_tag(void* pdoc, Node* UNUSED(node))
2084 chtml30 = GET_CHTML30(pdoc);
2090 return chtml30->out;
2095 * It is a handler who processes the UL tag.
2097 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2098 * destination is specified.
2099 * @param node [i] The UL tag node is specified.
2100 * @return The conversion result is returned.
2103 s_chtml30_start_ul_tag(void* pdoc, Node* UNUSED(node))
2109 chtml30 = GET_CHTML30(pdoc);
2115 return chtml30->out;
2120 * It is a handler who processes the UL tag.
2122 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2123 * destination is specified.
2124 * @param node [i] The UL tag node is specified.
2125 * @return The conversion result is returned.
2128 s_chtml30_end_ul_tag(void *pdoc, Node *UNUSED(child))
2134 chtml30 = GET_CHTML30(pdoc);
2140 return chtml30->out;
2145 * It is a handler who processes the PRE tag.
2147 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2148 * destination is specified.
2149 * @param node [i] The PRE tag node is specified.
2150 * @return The conversion result is returned.
2153 s_chtml30_start_pre_tag(void *pdoc, Node *UNUSED(node))
2159 chtml30 = GET_CHTML30(pdoc);
2163 chtml30->pre_flag++;
2166 return chtml30->out;
2171 * It is a handler who processes the PRE tag.
2173 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2174 * destination is specified.
2175 * @param node [i] The PRE tag node is specified.
2176 * @return The conversion result is returned.
2179 s_chtml30_end_pre_tag(void *pdoc, Node *UNUSED(child))
2185 chtml30 = GET_CHTML30(pdoc);
2190 chtml30->pre_flag--;
2192 return chtml30->out;
2197 * It is a handler who processes the P tag.
2199 * @param pdoc [i/o] The pointer to the XHTML structure at the output
2200 * destination is specified.
2201 * @param node [i] The P tag node is specified.
2202 * @return The conversion result is returned.
2205 s_chtml30_start_p_tag(void *pdoc, Node *node)
2213 chtml30 = GET_CHTML30(pdoc);
2218 for (attr = qs_get_attr(doc,node);
2220 attr = qs_get_next_attr(doc,attr)) {
2221 char *nm = qs_get_attr_name(doc,attr);
2222 char *val = qs_get_attr_value(doc,attr);
2223 if (STRCASEEQ('a','A',"align", nm)) {
2224 /*----------------------------------------------------------------------*/
2225 /* CHTML 1.0 (W3C version 3.2) */
2226 /*----------------------------------------------------------------------*/
2227 if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2228 align = apr_pstrdup(doc->buf.pool, val);
2240 return chtml30->out;
2245 * It is a handler who processes the P tag.
2247 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2248 * destination is specified.
2249 * @param node [i] The P tag node is specified.
2250 * @return The conversion result is returned.
2253 s_chtml30_end_p_tag(void* pdoc, Node* UNUSED(child))
2259 chtml30 = GET_CHTML30(pdoc);
2265 return chtml30->out;
2270 * It is a handler who processes the OL tag.
2272 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2273 * destination is specified.
2274 * @param node [i] The OL tag node is specified.
2275 * @return The conversion result is returned.
2278 s_chtml30_start_ol_tag(void *pdoc, Node *node)
2285 chtml30 = GET_CHTML30(pdoc);
2290 /*--------------------------------------------------------------------------*/
2291 /* Get Attributes */
2292 /*--------------------------------------------------------------------------*/
2293 for (attr = qs_get_attr(doc,node);
2295 attr = qs_get_next_attr(doc,attr)) {
2296 char *name = qs_get_attr_name(doc,attr);
2297 char *value = qs_get_attr_value(doc,attr);
2298 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2303 else if (STRCASEEQ('s','S',"start",name) && value && *value) {
2311 return chtml30->out;
2316 * It is a handler who processes the OL tag.
2318 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2319 * destination is specified.
2320 * @param node [i] The OL tag node is specified.
2321 * @return The conversion result is returned.
2324 s_chtml30_end_ol_tag(void *pdoc, Node *UNUSED(node))
2330 chtml30 = GET_CHTML30(pdoc);
2336 return chtml30->out;
2341 * It is a handler who processes the LI tag.
2343 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2344 * destination is specified.
2345 * @param node [i] The LI tag node is specified.
2346 * @return The conversion result is returned.
2349 s_chtml30_start_li_tag(void *pdoc, Node *node)
2356 chtml30 = GET_CHTML30(pdoc);
2361 /*--------------------------------------------------------------------------*/
2362 /* Get Attributes */
2363 /*--------------------------------------------------------------------------*/
2364 for (attr = qs_get_attr(doc,node);
2366 attr = qs_get_next_attr(doc,attr)) {
2367 char *name = qs_get_attr_name(doc,attr);
2368 char *value = qs_get_attr_value(doc,attr);
2369 if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
2374 else if (STRCASEEQ('v','V',"value", name) && value && *value) {
2382 return chtml30->out;
2387 * It is a handler who processes the LI tag.
2389 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2390 * destination is specified.
2391 * @param node [i] The LI tag node is specified.
2392 * @return The conversion result is returned.
2395 s_chtml30_end_li_tag(void *pdoc, Node *UNUSED(child))
2397 chtml30_t *chtml30 = GET_CHTML30(pdoc);
2398 return chtml30->out;
2403 * It is a handler who processes the H1 tag.
2405 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2406 * destination is specified.
2407 * @param node [i] The H1 tag node is specified.
2408 * @return The conversion result is returned.
2411 s_chtml30_start_h1_tag(void *pdoc, Node *node)
2418 chtml30 = GET_CHTML30(pdoc);
2423 for (attr = qs_get_attr(doc,node);
2425 attr = qs_get_next_attr(doc,attr)) {
2426 char *name = qs_get_attr_name(doc,attr);
2427 char *value = qs_get_attr_value(doc,attr);
2428 if (STRCASEEQ('a','A',"align", name)) {
2429 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2439 return chtml30->out;
2444 * It is a handler who processes the H1 tag.
2446 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2447 * destination is specified.
2448 * @param node [i] The H1 tag node is specified.
2449 * @return The conversion result is returned.
2452 s_chtml30_end_h1_tag(void *pdoc, Node *UNUSED(child))
2458 chtml30 = GET_CHTML30(pdoc);
2464 return chtml30->out;
2469 * It is a handler who processes the H2 tag.
2471 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2472 * destination is specified.
2473 * @param node [i] The H2 tag node is specified.
2474 * @return The conversion result is returned.
2477 s_chtml30_start_h2_tag(void *pdoc, Node *node)
2484 chtml30 = GET_CHTML30(pdoc);
2489 for (attr = qs_get_attr(doc,node);
2491 attr = qs_get_next_attr(doc,attr)) {
2494 name = qs_get_attr_name(doc,attr);
2495 value = qs_get_attr_value(doc,attr);
2496 if (STRCASEEQ('a','A',"align", name)) {
2497 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2506 return chtml30->out;
2511 * It is a handler who processes the H2 tag.
2513 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2514 * destination is specified.
2515 * @param node [i] The H2 tag node is specified.
2516 * @return The conversion result is returned.
2519 s_chtml30_end_h2_tag(void *pdoc, Node *UNUSED(child))
2525 chtml30 = GET_CHTML30(pdoc);
2531 return chtml30->out;
2536 * It is a handler who processes the H3 tag.
2538 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2539 * destination is specified.
2540 * @param node [i] The H3 tag node is specified.
2541 * @return The conversion result is returned.
2544 s_chtml30_start_h3_tag(void *pdoc, Node *node)
2551 chtml30 = GET_CHTML30(pdoc);
2556 for (attr = qs_get_attr(doc,node);
2558 attr = qs_get_next_attr(doc,attr)) {
2561 name = qs_get_attr_name(doc,attr);
2562 value = qs_get_attr_value(doc,attr);
2563 if (STRCASEEQ('a','A',"align", name)) {
2564 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2574 return chtml30->out;
2579 * It is a handler who processes the H3 tag.
2581 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2582 * destination is specified.
2583 * @param node [i] The H3 tag node is specified.
2584 * @return The conversion result is returned.
2587 s_chtml30_end_h3_tag(void *pdoc, Node *UNUSED(child))
2593 chtml30 = GET_CHTML30(pdoc);
2599 return chtml30->out;
2604 * It is a handler who processes the H4 tag.
2606 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2607 * destination is specified.
2608 * @param node [i] The H4 tag node is specified.
2609 * @return The conversion result is returned.
2612 s_chtml30_start_h4_tag(void *pdoc, Node *node)
2619 chtml30 = GET_CHTML30(pdoc);
2624 for (attr = qs_get_attr(doc,node);
2626 attr = qs_get_next_attr(doc,attr)) {
2629 name = qs_get_attr_name(doc,attr);
2630 value = qs_get_attr_value(doc,attr);
2631 if (STRCASEEQ('a','A',"align", name)) {
2632 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2641 return chtml30->out;
2646 * It is a handler who processes the H4 tag.
2648 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2649 * destination is specified.
2650 * @param node [i] The H4 tag node is specified.
2651 * @return The conversion result is returned.
2654 s_chtml30_end_h4_tag(void *pdoc, Node *UNUSED(child))
2660 chtml30 = GET_CHTML30(pdoc);
2666 return chtml30->out;
2671 * It is a handler who processes the H5 tag.
2673 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2674 * destination is specified.
2675 * @param node [i] The H5 tag node is specified.
2676 * @return The conversion result is returned.
2679 s_chtml30_start_h5_tag(void *pdoc, Node *node)
2686 chtml30 = GET_CHTML30(pdoc);
2691 for (attr = qs_get_attr(doc,node);
2693 attr = qs_get_next_attr(doc,attr)) {
2696 name = qs_get_attr_name(doc,attr);
2697 value = qs_get_attr_value(doc,attr);
2698 if (STRCASEEQ('a','A',"align", name)) {
2699 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2708 return chtml30->out;
2713 * It is a handler who processes the H5 tag.
2715 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2716 * destination is specified.
2717 * @param node [i] The H5 tag node is specified.
2718 * @return The conversion result is returned.
2721 s_chtml30_end_h5_tag(void* pdoc, Node* UNUSED(child))
2727 chtml30 = GET_CHTML30(pdoc);
2733 return chtml30->out;
2738 * It is a handler who processes the H6 tag.
2740 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2741 * destination is specified.
2742 * @param node [i] The H6 tag node is specified.
2743 * @return The conversion result is returned.
2746 s_chtml30_start_h6_tag(void *pdoc, Node *node)
2753 chtml30 = GET_CHTML30(pdoc);
2758 for (attr = qs_get_attr(doc,node);
2760 attr = qs_get_next_attr(doc,attr)) {
2763 name = qs_get_attr_name(doc,attr);
2764 value = qs_get_attr_value(doc,attr);
2765 if (STRCASEEQ('a','A',"align", name)) {
2766 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2775 return chtml30->out;
2780 * It is a handler who processes the H6 tag.
2782 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2783 * destination is specified.
2784 * @param node [i] The H6 tag node is specified.
2785 * @return The conversion result is returned.
2788 s_chtml30_end_h6_tag(void* pdoc, Node* UNUSED(child))
2794 chtml30 = GET_CHTML30(pdoc);
2800 return chtml30->out;
2805 * It is a handler who processes the TEXTARE tag.
2807 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2808 * destination is specified.
2809 * @param node [i] The TEXTAREA tag node is specified.
2810 * @return The conversion result is returned.
2813 s_chtml30_start_textarea_tag(void *pdoc, Node *node)
2820 chtml30 = GET_CHTML30(pdoc);
2824 chtml30->textarea_flag++;
2827 for (attr = qs_get_attr(doc,node);
2829 attr = qs_get_next_attr(doc,attr)) {
2830 char *name = qs_get_attr_name(doc,attr);
2831 char *value = qs_get_attr_value(doc,attr);
2832 if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2833 W_L(" accesskey=\"");
2837 else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2842 else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2847 else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2852 else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2861 return chtml30->out;
2866 * It is a handler who processes the TEXTAREA tag.
2868 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2869 * destination is specified.
2870 * @param node [i] The TEXTAREA tag node is specified.
2871 * @return The conversion result is returned.
2874 s_chtml30_end_textarea_tag(void* pdoc, Node* UNUSED(child))
2880 chtml30 = GET_CHTML30(pdoc);
2885 chtml30->textarea_flag--;
2887 return chtml30->out;
2892 s_chtml30_chxjif_tag(void* pdoc, Node* node)
2899 chtml30 = GET_CHTML30(pdoc);
2903 for (child = qs_get_child_node(doc, node);
2905 child = qs_get_next_node(doc, child)) {
2907 s_chtml30_chxjif_tag(chtml30, child);
2914 s_chtml30_text_tag(void *pdoc, Node *child)
2927 chtml30 = GET_CHTML30(pdoc);
2931 textval = qs_get_node_value(doc,child);
2932 if (strlen(textval) == 0) {
2933 return chtml30->out;
2936 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2937 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2939 tdst = qs_alloc_zero_byte_string(r);
2940 memset(one_byte, 0, sizeof(one_byte));
2943 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2945 int rtn = s_chtml30_search_emoji(chtml30, &textval[ii], &out);
2947 tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2952 if (is_sjis_kanji(textval[ii])) {
2953 one_byte[0] = textval[ii+0];
2954 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2955 one_byte[0] = textval[ii+1];
2956 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2959 else if (chtml30->pre_flag) {
2960 one_byte[0] = textval[ii+0];
2961 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2963 else if (chtml30->textarea_flag) {
2964 one_byte[0] = textval[ii+0];
2965 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2967 else if (textval[ii] != '\r' && textval[ii] != '\n') {
2968 one_byte[0] = textval[ii+0];
2969 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2974 return chtml30->out;
2979 * It is a handler who processes the BLOCKQUOTE tag.
2981 * @param pdoc [i/o] The pointer to the CHTML structure at the output
2982 * destination is specified.
2983 * @param node [i] The BLOCKQUOTE tag node is specified.
2984 * @return The conversion result is returned.
2987 s_chtml30_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2991 chtml30 = GET_CHTML30(pdoc);
2993 W_L("<blockquote>");
2994 return chtml30->out;
2999 * It is a handler who processes the BLOCKQUOTE tag.
3001 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3002 * destination is specified.
3003 * @param node [i] The BLOCKQUOTE tag node is specified.
3004 * @return The conversion result is returned.
3007 s_chtml30_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
3012 chtml30 = GET_CHTML30(pdoc);
3014 W_L("</blockquote>");
3015 return chtml30->out;
3020 * It is a handler who processes the DIR tag.
3022 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3023 * destination is specified.
3024 * @param node [i] The DIR tag node is specified.
3025 * @return The conversion result is returned.
3028 s_chtml30_start_dir_tag(void *pdoc, Node *UNUSED(child))
3030 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3031 Doc *doc = chtml30->doc;
3033 return chtml30->out;
3038 * It is a handler who processes the DIR tag.
3040 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3041 * destination is specified.
3042 * @param node [i] The DIR tag node is specified.
3043 * @return The conversion result is returned.
3046 s_chtml30_end_dir_tag(void *pdoc, Node *UNUSED(child))
3048 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3049 Doc *doc = chtml30->doc;
3051 return chtml30->out;
3056 * It is a handler who processes the DL tag.
3058 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3059 * destination is specified.
3060 * @param node [i] The DL tag node is specified.
3061 * @return The conversion result is returned.
3064 s_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
3066 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3067 Doc *doc = chtml30->doc;
3069 return chtml30->out;
3074 * It is a handler who processes the DL tag.
3076 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3077 * destination is specified.
3078 * @param node [i] The DL tag node is specified.
3079 * @return The conversion result is returned.
3082 s_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
3084 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3085 Doc *doc = chtml30->doc;
3087 return chtml30->out;
3092 * It is a handler who processes the DT tag.
3094 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3095 * destination is specified.
3096 * @param node [i] The DT tag node is specified.
3097 * @return The conversion result is returned.
3100 s_chtml30_start_dt_tag(void *pdoc, Node *UNUSED(child))
3104 chtml30 = GET_CHTML30(pdoc);
3107 return chtml30->out;
3112 * It is a handler who processes the DT tag.
3114 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3115 * destination is specified.
3116 * @param node [i] The DT tag node is specified.
3117 * @return The conversion result is returned.
3120 s_chtml30_end_dt_tag(void *pdoc, Node *UNUSED(child))
3123 chtml30 = GET_CHTML30(pdoc);
3124 return chtml30->out;
3129 * It is a handler who processes the DD tag.
3131 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3132 * destination is specified.
3133 * @param node [i] The DD tag node is specified.
3134 * @return The conversion result is returned.
3137 s_chtml30_start_dd_tag(void *pdoc, Node *UNUSED(child))
3139 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3140 Doc *doc = chtml30->doc;
3142 return chtml30->out;
3147 * It is a handler who processes the DD tag.
3149 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3150 * destination is specified.
3151 * @param node [i] The DD tag node is specified.
3152 * @return The conversion result is returned.
3155 s_chtml30_end_dd_tag(void *pdoc, Node *UNUSED(child))
3157 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3158 return chtml30->out;
3163 * It is a handler who processes the MARQUEE tag.
3165 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3166 * destination is specified.
3167 * @param node [i] The MARQUEE tag node is specified.
3168 * @return The conversion result is returned.
3171 s_chtml30_start_marquee_tag(void *pdoc, Node *node)
3173 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3174 Doc *doc = chtml30->doc;
3177 /*--------------------------------------------------------------------------*/
3178 /* Get Attributes */
3179 /*--------------------------------------------------------------------------*/
3180 for (attr = qs_get_attr(doc,node);
3182 attr = qs_get_next_attr(doc,attr)) {
3183 char *name = qs_get_attr_name(doc,attr);
3184 char *value = qs_get_attr_value(doc,attr);
3185 if (STRCASEEQ('d','D',"direction", name)) {
3186 if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3187 W_L(" direction=\"");
3192 else if (STRCASEEQ('b','B',"behavior",name)) {
3193 if (value && (STRCASEEQ('s','S',"scroll",value) || STRCASEEQ('s','S',"slide",value) || STRCASEEQ('a','A',"alternate",value))) {
3194 W_L(" behavior=\"");
3199 else if (STRCASEEQ('l','L',"loop",name)) {
3200 if (value && *value) {
3208 return chtml30->out;
3213 * It is a handler who processes the MARQUEE tag.
3215 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3216 * destination is specified.
3217 * @param node [i] The MARQUEE tag node is specified.
3218 * @return The conversion result is returned.
3221 s_chtml30_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3223 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3224 Doc *doc = chtml30->doc;
3226 return chtml30->out;
3231 * It is a handler who processes the BLINK tag.
3233 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3234 * destination is specified.
3235 * @param node [i] The BLINK tag node is specified.
3236 * @return The conversion result is returned.
3239 s_chtml30_start_blink_tag(void *pdoc, Node *UNUSED(child))
3241 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3242 Doc *doc = chtml30->doc;
3244 return chtml30->out;
3249 * It is a handler who processes the BLINK tag.
3251 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3252 * destination is specified.
3253 * @param node [i] The BLINK tag node is specified.
3254 * @return The conversion result is returned.
3257 s_chtml30_end_blink_tag(void *pdoc, Node *UNUSED(child))
3259 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3260 Doc *doc = chtml30->doc;
3262 return chtml30->out;
3267 * It is a handler who processes the MENU tag.
3269 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3270 * destination is specified.
3271 * @param node [i] The MENU tag node is specified.
3272 * @return The conversion result is returned.
3275 s_chtml30_start_menu_tag(void *pdoc, Node *UNUSED(child))
3279 chtml30 = GET_CHTML30(pdoc);
3282 return chtml30->out;
3287 * It is a handler who processes the MENU tag.
3289 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3290 * destination is specified.
3291 * @param node [i] The MENU tag node is specified.
3292 * @return The conversion result is returned.
3295 s_chtml30_end_menu_tag(void *pdoc, Node *UNUSED(child))
3297 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3298 Doc *doc = chtml30->doc;
3300 return chtml30->out;
3305 * It is a handler who processes the PLAINTEXT tag.
3307 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3308 * destination is specified.
3309 * @param node [i] The PLAINTEXT tag node is specified.
3310 * @return The conversion result is returned.
3313 s_chtml30_start_plaintext_tag(void *pdoc, Node *node)
3318 chtml30 = GET_CHTML30(pdoc);
3321 s_chtml30_start_plaintext_tag_inner(pdoc,node);
3322 return chtml30->out;
3326 s_chtml30_start_plaintext_tag_inner(void *pdoc, Node *node)
3331 chtml30 = GET_CHTML30(pdoc);
3333 for (child = qs_get_child_node(doc, node);
3335 child = qs_get_next_node(doc, child)) {
3337 s_chtml30_start_plaintext_tag_inner(pdoc, child);
3339 return chtml30->out;
3344 * It is a handler who processes the PLAINTEXT tag.
3346 * @param pdoc [i/o] The pointer to the CHTML structure at the output
3347 * destination is specified.
3348 * @param node [i] The PLAINTEXT tag node is specified.
3349 * @return The conversion result is returned.
3352 s_chtml30_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3354 chtml30_t *chtml30 = GET_CHTML30(pdoc);
3355 return chtml30->out;