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.
17 #include "chxj_hdml.h"
18 #include "chxj_tag_util.h"
19 #include "chxj_str_util.h"
21 #include "chxj_img_conv.h"
22 #include "chxj_dump.h"
23 #include "chxj_qr_code.h"
24 #include "chxj_encoding.h"
26 #define CHECK_BOX_PREFIX "_chxj_c_"
27 #define RADIO_BUTTON_PREFIX "_chxj_r_"
28 #define SUBMIT_BUTTON_PREFIX "_chxj_s_"
30 #define GET_HDML(X) ((hdml_t *)(X))
32 static void s_init_hdml (hdml_t *hdml, Doc *doc, request_rec *r, device_table *spec);
35 static char *s_hdml_start_html_tag (void *pdoc, Node *node);
36 static char *s_hdml_end_html_tag (void *pdoc, Node *node);
37 static char *s_hdml_start_meta_tag (void *pdoc, Node *node);
38 static char *s_hdml_end_meta_tag (void *pdoc, Node *node);
39 static char *s_hdml_start_li_tag (void *pdoc, Node *node);
40 static char *s_hdml_end_li_tag (void *pdoc, Node *node);
41 static char *s_hdml_start_head_tag (void *pdoc, Node *node);
42 static char *s_hdml_end_head_tag (void *pdoc, Node *node);
43 static char *s_hdml_start_title_tag (void *pdoc, Node *node);
44 static char *s_hdml_end_title_tag (void *pdoc, Node *node);
45 static char *s_hdml_start_base_tag (void *pdoc, Node *node);
46 static char *s_hdml_end_base_tag (void *pdoc, Node *node);
47 static char *s_hdml_start_body_tag (void *pdoc, Node *node);
48 static char *s_hdml_end_body_tag (void *pdoc, Node *node);
49 static char *s_hdml_start_a_tag (void *pdoc, Node *node);
50 static char *s_hdml_end_a_tag (void *pdoc, Node *node);
51 static char *s_hdml_start_br_tag (void *pdoc, Node *node);
52 static char *s_hdml_end_br_tag (void *pdoc, Node *node);
53 static char *s_hdml_start_tr_tag (void *pdoc, Node *node);
54 static char *s_hdml_end_tr_tag (void *pdoc, Node *node);
55 static char *s_hdml_start_font_tag (void *pdoc, Node *node);
56 static char *s_hdml_end_font_tag (void *pdoc, Node *node);
57 static char *s_hdml_start_form_tag (void *pdoc, Node *node);
58 static char *s_hdml_end_form_tag (void *pdoc, Node *node);
59 static char *s_hdml_start_input_tag (void *pdoc, Node *node);
60 static char *s_hdml_end_input_tag (void *pdoc, Node *node);
61 static char *s_hdml_start_select_tag (void *pdoc, Node *node);
62 static char *s_hdml_end_select_tag (void *pdoc, Node *node);
63 static char *s_hdml_start_option_tag (void *pdoc, Node *node);
64 static char *s_hdml_end_option_tag (void *pdoc, Node *node);
65 static char *s_hdml_start_center_tag (void *pdoc, Node *node);
66 static char *s_hdml_end_center_tag (void *pdoc, Node *node);
67 static char *s_hdml_start_hr_tag (void *pdoc, Node *node);
68 static char *s_hdml_end_hr_tag (void *pdoc, Node *node);
69 static char *s_hdml_start_img_tag (void *pdoc, Node *node);
70 static char *s_hdml_end_img_tag (void *pdoc, Node *node);
71 static char *s_hdml_start_div_tag (void *pdoc, Node *node);
72 static char *s_hdml_end_div_tag (void *pdoc, Node *node);
74 static char *s_get_form_no (request_rec *r, hdml_t *hdml);
76 static void s_hdml_count_radio_tag (hdml_t *hdml, Node *node) ;
78 static void s_hdml_do_input_text_tag (hdml_t *hdml, Node *tag);
79 static void s_hdml_do_input_password_tag(hdml_t *hdml, Node *tag);
80 static void s_hdml_do_input_submit_tag (hdml_t *hdml, Node *tag);
81 static void s_hdml_do_input_hidden_tag (hdml_t *hdml, Node *tag);
82 static void s_hdml_do_input_radio_tag (hdml_t *hdml, Node *tag);
83 static void s_hdml_do_input_checkbox_tag(hdml_t *hdml, Node *tag);
84 static void s_hdml_tag_output_upper_half(hdml_t *hdml, Node *node);
86 static hdml_t *s_output_to_hdml_out (hdml_t *hdml, char *s);
87 static hdml_t *s_output_to_hdml_card (hdml_t *hdml, char *s);
88 static void s_output_to_postdata (hdml_t *hdml, char *s);
89 static void s_output_to_init_vars (hdml_t *hdml, char *s);
90 static char *s_hdml_chxjif_tag (void *pdoc, Node *node);
91 static char *s_hdml_text_tag (void *pdoc, Node *node);
94 tag_handler hdml_handler[] = {
97 s_hdml_start_html_tag,
102 s_hdml_start_meta_tag,
167 s_hdml_start_head_tag,
172 s_hdml_start_title_tag,
173 s_hdml_end_title_tag,
177 s_hdml_start_base_tag,
182 s_hdml_start_body_tag,
217 s_hdml_start_font_tag,
222 s_hdml_start_form_tag,
227 s_hdml_start_input_tag,
228 s_hdml_end_input_tag,
232 s_hdml_start_center_tag,
233 s_hdml_end_center_tag,
242 s_hdml_start_img_tag,
247 s_hdml_start_select_tag,
248 s_hdml_end_select_tag,
252 s_hdml_start_option_tag,
253 s_hdml_end_option_tag,
257 s_hdml_start_div_tag,
323 * converts from CHTML to hdml.
325 * @param r [i] Requet_rec is appointed.
326 * @param spec [i] The result of the device specification processing which
327 * was done in advance is appointed.
328 * @param src [i] The character string before the converting is appointed.
329 * @return The character string after the converting is returned.
338 chxjconvrule_entry *entryp,
339 cookie_t *UNUSED(cookie)
350 /*--------------------------------------------------------------------------*/
352 /*--------------------------------------------------------------------------*/
354 dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
356 DBG(r,"i found qrcode xml");
359 DBG(r,"not found qrcode xml");
361 /*--------------------------------------------------------------------------*/
362 /* initialize hdml structure */
363 /*--------------------------------------------------------------------------*/
364 s_init_hdml(&hdml,&doc,r, spec);
366 hdml.entryp = entryp;
368 ap_set_content_type(r, "text/x-hdml; charset=Shift_JIS");
369 /*--------------------------------------------------------------------------*/
371 /*--------------------------------------------------------------------------*/
373 chxj_dump_out("[src] CHTML->HDML", src, srclen);
376 /*--------------------------------------------------------------------------*/
377 /* It is examined whether there is a location header. It ends without doing */
378 /* anything when is. */
379 /*--------------------------------------------------------------------------*/
380 buf = (char *)apr_table_get(r->headers_out, (const char *)"Location");
382 /*------------------------------------------------------------------------*/
383 /* The Location header generates tag in an initial HDML machine for the */
384 /* uncorrespon dence. */
385 /*------------------------------------------------------------------------*/
386 DBG1(r, "Location is not null[Location:%s]", buf);
387 s_output_to_hdml_out(&hdml,
388 "<HDML VERSION=3.0 MARKABLE=TRUE PUBLIC=TRUE>\n"
389 "<NODISPLAY MARKABLE=TRUE PUBLIC=TRUE TITLE=\" \">\n"
390 "<ACTION TYPE=ACCEPT TASK=GO DEST=\""
392 s_output_to_hdml_out(&hdml, buf);
393 s_output_to_hdml_out(&hdml,
398 dst = apr_pstrdup(r->pool, hdml.out);
401 /*------------------------------------------------------------------------*/
402 /* Here, the parsing of the received character string is done */
403 /*------------------------------------------------------------------------*/
404 // char *ss = apr_pstrdup(r->pool, src);
405 char *ss = apr_palloc(r->pool, srclen + 1);
406 memset(ss, 0, srclen + 1);
407 memcpy(ss, src, srclen);
409 DBG1(r, "input strlen(src)=[%d]\n", (int)srclen);
410 DBG1(r, "[[[[%s]]]\n", src);
412 qs_init_malloc(&doc);
413 qs_init_root_node(&doc);
415 qs_parse_string(&doc, ss, srclen);
417 /*------------------------------------------------------------------------*/
418 /* The number of radiobuttons is counted. */
419 /*------------------------------------------------------------------------*/
420 s_hdml_count_radio_tag(&hdml, qs_get_root(&doc));
422 chxj_node_exchange(spec,r,(void*)&hdml, &doc, qs_get_root(&doc), 0);
425 DBG1(r,"tmp=[%s]", dst);
426 qs_all_free(&doc,QX_LOGMARK);
429 /*--------------------------------------------------------------------------*/
431 /*--------------------------------------------------------------------------*/
433 chxj_dump_out("[dst] CHTML->HDML", hdml.out, hdml.out_len);
436 /*--------------------------------------------------------------------------*/
437 /* When there is no processing result, former character string is copied */
438 /* and it returns it. */
439 /*--------------------------------------------------------------------------*/
442 return apr_pstrdup(r->pool,src);
445 *dstlen = hdml.out_len;
447 /*--------------------------------------------------------------------------*/
448 /* Null is set at the end of the character string to make sure. */
449 /*--------------------------------------------------------------------------*/
450 dst[hdml.out_len] = 0;
457 * The HDML structure is initialized.
459 * @param hdml [i/o] The pointer to the HDML structure that wants to be
460 * initialized is specified.
461 * @param doc [i] The Doc structure that should be set to the initialized
462 * HDML structure is specified.
463 * @param r [i] To use POOL, the pointer to request_rec is specified.
464 * @param spec [i] The pointer to the device_table
467 s_init_hdml(hdml_t *hdml, Doc *doc, request_rec *r, device_table *spec)
472 /*--------------------------------------------------------------------------*/
473 /* init hdml structure value */
474 /*--------------------------------------------------------------------------*/
475 memset(hdml, 0, sizeof(hdml_t));
477 hdml->card = qs_alloc_zero_byte_string(r);
479 hdml->conf = ap_get_module_config(r->per_dir_config, &chxj_module);
480 hdml->doc->parse_mode = PARSE_MODE_CHTML;
482 for (ii=0; ii<MAX_FORM_COUNT; ii++) {
483 hdml->var_cnt[ii] = 0;
484 hdml->postdata[ii] = qs_alloc_zero_byte_string(r);
487 for (ii=0; ii<MAX_RADIO_COUNT; ii++) {
488 for (jj=0; jj<MAX_RADIO_VALUE_COUNT; jj++)
489 hdml->radio_value_list[ii][jj] = NULL;
491 hdml->radio_name_list[ii] = NULL;
492 hdml->radio_out_cnt[ii] = 0;
493 hdml->radio_checked_value[ii] = NULL;
496 for (ii=0; ii<MAX_SUBMIT_BUTTON_COUNT; ii++)
497 hdml->submit_button[ii] = NULL;
499 hdml->init_vars = qs_alloc_zero_byte_string(r);
503 hdml->form_cnt = apr_time_now();
504 hdml->out = qs_alloc_zero_byte_string(r);
509 * It is a handler who processes the HTML tag.
511 * @param pdoc [i/o] The pointer to the HDML structure at the output
512 * destination is specified.
513 * @param node [i] The HTML tag node is specified.
514 * @return The conversion result is returned.
517 s_hdml_start_html_tag(void *pdoc, Node *UNUSED(node))
521 hdml = GET_HDML(pdoc);
523 s_output_to_hdml_out(hdml,
524 "<HDML VERSION=3.0 TTL=0 MARKABLE=TRUE>\n"
525 "<NODISPLAY NAME=D0>\n"
526 "<ACTION TYPE=ACCEPT TASK=GOSUB DEST=#D1 NEXT=#D2 CLEAR=TRUE>\n"
531 hdml->hdml_br_flag = 0;
538 * It is a handler who processes the HTML tag.
540 * @param pdoc [i/o] The pointer to the HDML structure at the output
541 * destination is specified.
542 * @param node [i] The HTML tag node is specified.
543 * @return The conversion result is returned.
546 s_hdml_end_html_tag(void *pdoc, Node *UNUSED(child))
550 hdml = GET_HDML(pdoc);
552 s_output_to_hdml_card(hdml,
553 "<NODISPLAY NAME=D1>\n"
554 "<ACTION TYPE=ACCEPT TASK=RETURN VARS=\""
557 if (strlen(hdml->init_vars))
558 s_output_to_hdml_card(hdml, hdml->init_vars );
560 s_output_to_hdml_card(hdml, "_chxj_dmy=" );
562 s_output_to_hdml_card(hdml,
567 s_output_to_hdml_out(hdml, hdml->card );
568 s_output_to_hdml_out(hdml, "</HDML>\n");
570 hdml->hdml_end_flag = 1;
577 * It is a handler who processes the META tag.
579 * @param pdoc [i/o] The pointer to the HDML structure at the output
580 * destination is specified.
581 * @param node [i] The META tag node is specified.
582 * @return The conversion result is returned.
585 s_hdml_start_meta_tag(void *pdoc, Node *UNUSED(node))
589 hdml = GET_HDML(pdoc);
591 hdml->hdml_br_flag = 0;
600 * It is a handler who processes the META tag.
602 * @param pdoc [i/o] The pointer to the HDML structure at the output
603 * destination is specified.
604 * @param node [i] The META tag node is specified.
605 * @return The conversion result is returned.
608 s_hdml_end_meta_tag(void *pdoc, Node *UNUSED(child))
612 hdml = GET_HDML(pdoc);
619 * It is a handler who processes the HEAD tag.
621 * @param pdoc [i/o] The pointer to the HDML structure at the output
622 * destination is specified.
623 * @param node [i] The HEAD tag node is specified.
624 * @return The conversion result is returned.
627 s_hdml_start_head_tag(void *pdoc, Node *UNUSED(node))
631 hdml = GET_HDML(pdoc);
635 hdml->hdml_br_flag = 0;
642 * It is a handler who processes the HEAD tag.
644 * @param pdoc [i/o] The pointer to the HDML structure at the output
645 * destination is specified.
646 * @param node [i] The HEAD tag node is specified.
647 * @return The conversion result is returned.
650 s_hdml_end_head_tag(void *pdoc, Node *UNUSED(child))
654 hdml = GET_HDML(pdoc);
662 * It is a handler who processes the TITLE tag.
664 * @param pdoc [i/o] The pointer to the HDML structure at the output
665 * destination is specified.
666 * @param node [i] The TITLE tag node is specified.
667 * @return The conversion result is returned.
670 s_hdml_start_title_tag(void *pdoc, Node *UNUSED(node))
674 hdml = GET_HDML(pdoc);
676 s_output_to_hdml_out(hdml, "<DISPLAY NAME=D2 TITLE=\"");
678 hdml->found_title = 1;
679 hdml->hdml_br_flag = 0;
686 * It is a handler who processes the TITLE tag.
688 * @param pdoc [i/o] The pointer to the HDML structure at the output
689 * destination is specified.
690 * @param node [i] The TITLE tag node is specified.
691 * @return The conversion result is returned.
694 s_hdml_end_title_tag(void *pdoc, Node *UNUSED(child))
698 hdml = GET_HDML(pdoc);
700 s_output_to_hdml_out(hdml, "\">\n");
707 * It is a handler who processes the BASE tag.
709 * @param pdoc [i/o] The pointer to the HDML structure at the output
710 * destination is specified.
711 * @param node [i] The BASE tag node is specified.
712 * @return The conversion result is returned.
715 s_hdml_start_base_tag(void *pdoc, Node *UNUSED(node))
719 hdml = GET_HDML(pdoc);
721 hdml->hdml_br_flag = 0;
728 * It is a handler who processes the BASE tag.
730 * @param pdoc [i/o] The pointer to the HDML structure at the output
731 * destination is specified.
732 * @param node [i] The BASE tag node is specified.
733 * @return The conversion result is returned.
736 s_hdml_end_base_tag(void *pdoc, Node *UNUSED(child))
740 hdml = GET_HDML(pdoc);
747 * It is a handler who processes the BODY tag.
749 * @param pdoc [i/o] The pointer to the HDML structure at the output
750 * destination is specified.
751 * @param node [i] The BODY tag node is specified.
752 * @return The conversion result is returned.
755 s_hdml_start_body_tag(void *pdoc, Node *node)
761 hdml = GET_HDML(pdoc);
765 if (hdml->found_title == 0)
766 s_output_to_hdml_out(hdml, "<DISPLAY NAME=D2 TITLE=\"NO TITLE\">\n");
768 s_output_to_hdml_out(hdml, "<ACTION TYPE=ACCEPT TASK=NOOP LABEL=\" \"");
770 /*--------------------------------*/
772 /*--------------------------------*/
773 for (attr = qs_get_attr(doc,node);
775 attr = qs_get_next_attr(doc,attr)) {
779 name = qs_get_attr_name(doc,attr);
781 if ((*name == 'b' || *name == 'B') && strcasecmp(name, "bgcolor") == 0) {
785 if ((*name == 't' || *name == 'T') && strcasecmp(name, "text") == 0) {
789 if ((*name == 'l' || *name == 'L') && strcasecmp(name, "link") == 0) {
793 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "alink") == 0) {
797 if ((*name == 'v' || *name == 'V') && strcasecmp(name, "vlink") == 0) {
802 s_output_to_hdml_out(hdml, ">\n");
804 hdml->hdml_br_flag = 0;
811 * It is a handler who processes the BODY tag.
813 * @param pdoc [i/o] The pointer to the HDML structure at the output
814 * destination is specified.
815 * @param node [i] The BODY tag node is specified.
816 * @return The conversion result is returned.
819 s_hdml_end_body_tag(void *pdoc, Node *UNUSED(child))
823 hdml = GET_HDML(pdoc);
825 s_output_to_hdml_out(hdml, "\n</DISPLAY>\n");
832 * It is a handler who processes the A tag.
834 * @param pdoc [i/o] The pointer to the HDML structure at the output
835 * destination is specified.
836 * @param node [i] The A tag node is specified.
837 * @return The conversion result is returned.
840 s_hdml_start_a_tag(void *pdoc, Node *node)
846 hdml = GET_HDML(pdoc);
849 s_hdml_tag_output_upper_half(hdml,node);
851 s_output_to_hdml_out(hdml, "<A");
854 /*------------------------------------*/
856 /*------------------------------------*/
857 for (attr = qs_get_attr(doc,node);
859 attr = qs_get_next_attr(doc,attr)) {
864 name = qs_get_attr_name(doc,attr);
865 value = qs_get_attr_value(doc,attr);
867 if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
871 if ((*name == 'h' || *name == 'H') && strcasecmp(name, "href") == 0) {
872 if ((*value == 'm' || *value == 'M')
873 && strncasecmp(value, "mailto:", 7) == 0) {
874 value = chxj_encoding_parameter(hdml->doc->r, value);
875 s_output_to_hdml_out(hdml, " TASK=GO DEST=\"" );
876 s_output_to_hdml_out(hdml, value );
877 s_output_to_hdml_out(hdml, "\" " );
880 if ((*value == 't' || *value == 'T')
881 && strncasecmp(value, "tel:", 4) == 0) {
883 s_output_to_hdml_out(hdml, " TASK=CALL NUMBER=\"");
884 s_output_to_hdml_out(hdml, &value[4] );
885 s_output_to_hdml_out(hdml, "\" " );
888 s_output_to_hdml_out(hdml, " TASK=GO DEST=\"" );
889 s_output_to_hdml_out(hdml, value );
890 s_output_to_hdml_out(hdml, "\"" );
894 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "accesskey") == 0) {
895 if (strcasecmp(value, "0") != 0) {
896 s_output_to_hdml_out(hdml, " ACCESSKEY=" );
897 s_output_to_hdml_out(hdml, value );
898 s_output_to_hdml_out(hdml, "" );
902 if ((*name == 'c' || *name == 'C') && strcasecmp(name, "cti") == 0) {
906 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "ijam") == 0) {
910 if ((*name == 'u' || *name == 'U') && strcasecmp(name, "utn") == 0) {
914 if ((*name == 't' || *name == 'T') && strcasecmp(name, "telbook") == 0) {
918 if ((*name == 'k' || *name == 'K') && strcasecmp(name, "kana") == 0) {
922 if ((*name == 'e' || *name == 'E') && strcasecmp(name, "email") == 0) {
926 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "ista") == 0) {
930 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "ilet") == 0) {
934 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "iswf") == 0) {
938 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "irst") == 0) {
942 s_output_to_hdml_out(hdml, ">" );
944 hdml->hdml_a_flag = 1;
946 hdml->hdml_br_flag = 0;
953 * It is a handler who processes the A tag.
955 * @param pdoc [i/o] The pointer to the HDML structure at the output
956 * destination is specified.
957 * @param node [i] The A tag node is specified.
958 * @return The conversion result is returned.
961 s_hdml_end_a_tag(void *pdoc, Node *UNUSED(child))
965 hdml = GET_HDML(pdoc);
967 s_output_to_hdml_out(hdml, "</A>\n");
969 hdml->hdml_a_flag = 0;
976 * It is a handler who processes the BR tag.
978 * @param pdoc [i/o] The pointer to the HDML structure at the output
979 * destination is specified.
980 * @param node [i] The BR tag node is specified.
981 * @return The conversion result is returned.
984 s_hdml_start_br_tag(void *pdoc, Node *UNUSED(node))
988 hdml = GET_HDML(pdoc);
990 if (hdml->in_center > 0)
993 if (hdml->div_in_center > 0)
994 hdml->div_in_center = 0;
996 s_output_to_hdml_out(hdml, "<BR>\n");
998 hdml->hdml_br_flag = 1;
1005 * It is a handler who processes the BR tag.
1007 * @param pdoc [i/o] The pointer to the HDML structure at the output
1008 * destination is specified.
1009 * @param node [i] The BR tag node is specified.
1010 * @return The conversion result is returned.
1013 s_hdml_end_br_tag(void *pdoc, Node *UNUSED(child))
1017 hdml = GET_HDML(pdoc);
1024 * It is a handler who processes the TR tag.
1026 * @param pdoc [i/o] The pointer to the HDML structure at the output
1027 * destination is specified.
1028 * @param node [i] The TR tag node is specified.
1029 * @return The conversion result is returned.
1032 s_hdml_start_tr_tag(void *pdoc, Node *UNUSED(node))
1036 hdml = GET_HDML(pdoc);
1038 if (hdml->in_center > 0)
1039 hdml->in_center = 0;
1041 if (hdml->div_in_center > 0)
1042 hdml->div_in_center = 0;
1044 s_output_to_hdml_out(hdml, "<BR>\n");
1046 hdml->hdml_br_flag = 1;
1053 * It is a handler who processes the TR tag.
1055 * @param pdoc [i/o] The pointer to the HDML structure at the output
1056 * destination is specified.
1057 * @param node [i] The TR tag node is specified.
1058 * @return The conversion result is returned.
1061 s_hdml_end_tr_tag(void *pdoc, Node *UNUSED(child))
1065 hdml = GET_HDML(pdoc);
1072 * It is a handler who processes the FONT tag.
1074 * @param pdoc [i/o] The pointer to the HDML structure at the output
1075 * destination is specified.
1076 * @param node [i] The FONT tag node is specified.
1077 * @return The conversion result is returned.
1080 s_hdml_start_font_tag(void *pdoc, Node *UNUSED(node))
1084 hdml = GET_HDML(pdoc);
1091 * It is a handler who processes the FONT tag.
1093 * @param pdoc [i/o] The pointer to the HDML structure at the output
1094 * destination is specified.
1095 * @param node [i] The FONT tag node is specified.
1096 * @return The conversion result is returned.
1099 s_hdml_end_font_tag(void *pdoc, Node *UNUSED(child))
1103 hdml = GET_HDML(pdoc);
1110 * It is a handler who processes the FORM tag.
1112 * @param pdoc [i/o] The pointer to the HDML structure at the output
1113 * destination is specified.
1114 * @param node [i] The FORM tag node is specified.
1115 * @return The conversion result is returned.
1118 s_hdml_start_form_tag(void *pdoc, Node *node)
1126 hdml = GET_HDML(pdoc);
1131 hdml->form_tmp = apr_psprintf(r->pool,
1132 "<NODISPLAY NAME=F%d>\n",
1133 hdml->pure_form_cnt);
1134 hdml->form_tmp = apr_pstrcat(r->pool,
1136 "<ACTION TYPE=ACCEPT TASK=GO METHOD=POST DEST=\"",
1138 /* Get Attributes */
1139 for (attr = qs_get_attr(doc,node);
1141 attr = qs_get_next_attr(doc,attr)) {
1146 name = qs_get_attr_name(doc,attr);
1147 value = qs_get_attr_value(doc,attr);
1149 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "action") == 0) {
1150 value = chxj_encoding_parameter(hdml->doc->r, value);
1151 act = apr_psprintf(r->pool, "%s", value);
1157 hdml->form_tmp = apr_pstrcat(r->pool,
1162 hdml->form_tmp = apr_pstrcat(r->pool,
1166 hdml->form_tmp = apr_pstrcat(r->pool,
1171 hdml->hdml_br_flag = 0;
1178 * handler of the form end tag.
1180 * @param pdoc [i/o] The pointer to the HDML structure at the output
1181 * destination is specified.
1182 * @param child [i] unused.
1183 * @return The HDML output result after it edits it is returned.
1186 s_hdml_end_form_tag(void *pdoc, Node *UNUSED(child))
1191 hdml = GET_HDML(pdoc);
1194 s_output_to_postdata(hdml, "_chxj_dmy=");
1196 hdml->form_tmp = apr_pstrcat(r->pool,
1198 hdml->postdata[hdml->pure_form_cnt],
1201 hdml->form_tmp = apr_pstrcat(r->pool,
1203 "\" CLEAR=TRUE >\n",
1205 hdml->form_tmp = apr_pstrcat(r->pool,
1210 s_output_to_hdml_card(hdml, hdml->form_tmp);
1212 hdml->form_tmp = NULL;
1213 hdml->pure_form_cnt++;
1220 * It is a handler that takes charge of the processing of the input tag.
1222 * @param pdoc [i/o] The pointer to the HDML structure at the output
1223 * destination is specified.
1224 * @param node [i] The tag node to be processed is specified.
1227 s_hdml_start_input_tag(void *pdoc, Node *node)
1233 hdml = GET_HDML(pdoc);
1236 /*--------------------------------------------------------------------------*/
1237 /* The attribute of the input tag is acquired. */
1238 /*--------------------------------------------------------------------------*/
1239 for (attr = qs_get_attr(doc,node);
1241 attr = qs_get_next_attr(doc,attr)) {
1246 name = qs_get_attr_name(doc,attr);
1247 value = qs_get_attr_value(doc,attr);
1249 if ((*name == 't'|| *name == 'T') && strcasecmp(name, "type") == 0) {
1250 if ((*value == 't' || *value == 'T') && strcasecmp(value, "text") == 0) {
1251 /*--------------------------------------------------------------------*/
1252 /* "input type ='text'" tag is processed. */
1253 /*--------------------------------------------------------------------*/
1254 s_hdml_do_input_text_tag(hdml, node);
1257 if ((*value == 'p' || *value == 'P') && strcasecmp(value, "password") == 0) {
1258 /*--------------------------------------------------------------------*/
1259 /* "input type='password'" tag is processed. */
1260 /*--------------------------------------------------------------------*/
1261 s_hdml_do_input_password_tag(hdml, node);
1264 if ((*value == 's' || *value == 'S') && strcasecmp(value, "submit") == 0) {
1265 /*--------------------------------------------------------------------*/
1266 /* "input type='submit'" tag is processed. */
1267 /*--------------------------------------------------------------------*/
1268 s_hdml_do_input_submit_tag(hdml, node);
1271 if ((*value == 'h' || *value == 'H') && strcasecmp(value, "hidden") == 0) {
1272 /*--------------------------------------------------------------------*/
1273 /* "input type='hidden'" tag is processed. */
1274 /*--------------------------------------------------------------------*/
1275 s_hdml_do_input_hidden_tag(hdml, node);
1278 if ((*value == 'r' || *value == 'R') && strcasecmp(value, "radio") == 0) {
1279 /*--------------------------------------------------------------------*/
1280 /* "input type='radio'" tag is processed. */
1281 /*--------------------------------------------------------------------*/
1282 s_hdml_do_input_radio_tag(hdml, node);
1285 if ((*value == 'c' || *value == 'C') && strcasecmp(value, "checkbox") == 0) {
1286 /*--------------------------------------------------------------------*/
1287 /* "input type='checkbox'" tag is processed. */
1288 /*--------------------------------------------------------------------*/
1289 s_hdml_do_input_checkbox_tag(hdml, node);
1293 if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
1297 if ((*name == 'v' || *name == 'V') && strcasecmp(name, "value") == 0) {
1301 if ((*name == 's' || *name == 'S') && strcasecmp(name, "size") == 0) {
1305 if ((*name == 'm' || *name == 'M') && strcasecmp(name, "maxlength") == 0) {
1309 if ((*name == 'c' || *name == 'C') && strcasecmp(name, "checked") == 0) {
1313 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "accesskey") == 0) {
1317 if ((*name == 'i' || *name == 'I') && strcasecmp(name, "istyle") == 0) {
1322 hdml->hdml_br_flag = 0;
1329 * The substitution processing of tag "input type = text" is done.
1331 * @param hdml [i/o] The pointer to the HDML structure at the output
1332 * destination is specified.
1333 * @param tag [i] The tag node of input type=text is specified.
1336 s_hdml_do_input_text_tag(hdml_t *hdml, Node *tag)
1350 s_hdml_tag_output_upper_half(hdml, tag);
1353 s_output_to_hdml_out(hdml,
1354 apr_psprintf(r->pool,
1355 "<A TASK=GOSUB LABEL=\x93\xfc\x97\xcd DEST=#D%d "
1356 "VARS=\"V=$%s%02d\" RECEIVE=%s%02d>",
1358 s_get_form_no(r, hdml),
1359 hdml->var_cnt[hdml->pure_form_cnt],
1360 s_get_form_no(r, hdml),
1361 hdml->var_cnt[hdml->pure_form_cnt]
1364 s_output_to_hdml_out(hdml,
1365 apr_psprintf(r->pool,
1367 s_get_form_no(r, hdml),
1368 hdml->var_cnt[hdml->pure_form_cnt]));
1370 /*--------------------------------------------------------------------------*/
1371 /* ENTRY CARD is output here. */
1372 /*--------------------------------------------------------------------------*/
1373 s_output_to_hdml_card(hdml, "<ENTRY NAME=" );
1374 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, "D%d ", hdml->card_cnt));
1375 s_output_to_hdml_card(hdml, " KEY=V DEFAULT=$V " );
1381 nm = qs_get_name_attr(doc, tag, r);
1383 nm = qs_alloc_zero_byte_string(r);
1386 s_output_to_postdata(hdml,
1387 apr_psprintf(r->pool,
1390 s_get_form_no(r, hdml),
1391 hdml->var_cnt[hdml->pure_form_cnt]));
1393 mlen = qs_get_maxlength_attr (doc, tag, r);
1394 is = qs_get_istyle_attr (doc, tag, r);
1395 val = qs_get_value_attr (doc, tag, r);
1397 fmt = qs_conv_istyle_to_format(r, is);
1398 DBG(r,"qs_conv_istyle_to_format end");
1402 for (ii=0; ii<strlen(mlen); ii++) {
1403 if (mlen[ii] < '0' || mlen[ii] > '9') {
1404 mlen = apr_psprintf(r->pool, "0");
1408 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, " FORMAT=%d%s", atoi(mlen), fmt));
1411 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, " FORMAT=*%s", fmt) );
1414 s_output_to_hdml_card(hdml,
1415 " MARKABLE=FALSE>\n"
1416 "<ACTION TYPE=ACCEPT TASK=RETURN RETVALS=$V>\n"
1420 s_output_to_init_vars(hdml,
1421 apr_psprintf(r->pool,
1423 s_get_form_no(r, hdml),
1424 hdml->var_cnt[hdml->pure_form_cnt],
1425 ap_escape_uri(r->pool,val)));
1427 s_output_to_init_vars(hdml,
1428 apr_psprintf(r->pool,
1430 s_get_form_no(r, hdml),
1431 hdml->var_cnt[hdml->pure_form_cnt]));
1433 hdml->var_cnt[hdml->pure_form_cnt]++;
1438 * The substitution processing of tag "input type = password" is done.
1440 * @param hdml [i/o] The pointer to the HDML structure at the output
1441 * destination is specified.
1442 * @param tag [i] The tag node of input type=password is specified.
1445 s_hdml_do_input_password_tag(hdml_t *hdml, Node *tag)
1458 s_hdml_tag_output_upper_half(hdml, tag);
1461 s_output_to_hdml_out(hdml, "<A TASK=GOSUB LABEL=\"\x93\xfc\x97\xcd\" DEST=");
1462 s_output_to_hdml_out(hdml, apr_psprintf(r->pool, "#D%d ", hdml->card_cnt));
1463 s_output_to_hdml_out(hdml,
1464 apr_psprintf(r->pool,
1465 "VARS=\"V=$%s%02d\" ",
1466 s_get_form_no(r, hdml),
1467 hdml->var_cnt[hdml->pure_form_cnt]));
1469 s_output_to_hdml_out(hdml,
1470 apr_psprintf(r->pool, "RECEIVE=%s%02d>" ,
1471 s_get_form_no(r, hdml),
1472 hdml->var_cnt[hdml->pure_form_cnt]));
1473 s_output_to_hdml_out(hdml,
1474 apr_psprintf(r->pool, "[$%s%02d]</A>\n" ,
1475 s_get_form_no(r, hdml),
1476 hdml->var_cnt[hdml->pure_form_cnt]));
1478 s_output_to_hdml_card(hdml, "<ENTRY NAME=" );
1479 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, "D%d ", hdml->card_cnt));
1480 s_output_to_hdml_card(hdml, " KEY=V DEFAULT=$V " );
1487 nm = qs_get_name_attr(doc, tag, r);
1489 nm = qs_alloc_zero_byte_string(r);
1491 s_output_to_postdata(hdml,
1492 apr_psprintf(r->pool,
1495 s_get_form_no(r, hdml),
1496 hdml->var_cnt[hdml->pure_form_cnt]));
1498 mlen = qs_get_maxlength_attr (doc, tag, r);
1499 val = qs_get_value_attr (doc, tag, r);
1500 /*--------------------------------------------------------------------------*/
1501 /* Default is a figure input. */
1502 /*--------------------------------------------------------------------------*/
1503 fmt = apr_psprintf(r->pool, "N");
1505 if (chxj_chk_numeric(mlen) != 0)
1506 mlen = apr_psprintf(r->pool, "0");
1507 s_output_to_hdml_card(hdml,
1508 apr_psprintf(r->pool, " FORMAT=%d%s", chxj_atoi(mlen), fmt));
1511 s_output_to_hdml_card(hdml,
1512 apr_psprintf(r->pool, " FORMAT=*%s", fmt) );
1514 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, " NOECHO=TRUE "));
1516 s_output_to_hdml_card(hdml,
1517 " MARKABLE=FALSE>\n"
1518 "<ACTION TYPE=ACCEPT TASK=RETURN RETVALS=$V>\n"
1522 s_output_to_init_vars(hdml,
1523 apr_psprintf(r->pool, "%s%02d=%s",
1524 s_get_form_no(r, hdml),
1525 hdml->var_cnt[hdml->pure_form_cnt],
1526 ap_escape_uri(r->pool,val)));
1528 s_output_to_init_vars(hdml,
1529 apr_psprintf(r->pool, "%s%02d=",
1530 s_get_form_no(r, hdml),
1531 hdml->var_cnt[hdml->pure_form_cnt]));
1533 hdml->var_cnt[hdml->pure_form_cnt]++;
1537 * The substitution processing of tag "input type = submit" is done.
1539 * @param hdml [i/o] The pointer to the HDML structure at the output
1540 * destination is specified.
1541 * @param tag [i] The tag node of input type=submit is specified.
1544 s_hdml_do_input_submit_tag(hdml_t *hdml, Node *tag)
1546 Doc *doc = hdml->doc;
1547 request_rec *r = doc->r;
1551 s_hdml_tag_output_upper_half(hdml, tag);
1553 s_output_to_hdml_out(hdml,
1554 apr_psprintf(r->pool,
1555 "<A TASK=GO LABEL=OK DEST=#F%d ",
1556 hdml->pure_form_cnt));
1558 /*--------------------------------------------------------------------------*/
1559 /* get name and value attribute */
1560 /*--------------------------------------------------------------------------*/
1561 nm = qs_get_name_attr (doc, tag, r);
1562 val = qs_get_value_attr (doc, tag, r);
1565 s_output_to_hdml_out(hdml,
1566 apr_psprintf(r->pool, "VARS=\"%s=%s\" ",
1568 ap_escape_uri(r->pool,val)));
1569 if (strstr(hdml->postdata[hdml->pure_form_cnt], nm) == NULL) {
1570 s_output_to_postdata(hdml,
1571 apr_psprintf(r->pool,"%s%s=$%s",
1572 SUBMIT_BUTTON_PREFIX, nm, nm));
1575 s_output_to_hdml_out(hdml, ">" );
1576 s_output_to_hdml_out(hdml, val);
1577 s_output_to_hdml_out(hdml, "</A>\n" );
1582 * The substitution processing of tag "input type = hidden" is done.
1584 * @param hdml [i/o] The pointer to the HDML structure at the output
1585 * destination is specified.
1586 * @param tag [i] The tag node of input type=hidden is specified.
1589 s_hdml_do_input_hidden_tag(hdml_t *hdml, Node *tag)
1591 Doc *doc = hdml->doc;
1592 request_rec *r = doc->r;
1596 /*--------------------------------------------------------------------------*/
1597 /* get name and value attribute */
1598 /*--------------------------------------------------------------------------*/
1599 nm = qs_get_name_attr (doc, tag, r);
1600 val = qs_get_value_attr (doc, tag, r);
1603 s_output_to_postdata(hdml,
1604 apr_psprintf(r->pool,
1607 ap_escape_uri(r->pool, val)));
1612 * The substitution processing of tag "input type = radio" is done.
1614 * @param hdml [i/o] The pointer to the HDML structure at the output
1615 * destination is specified.
1616 * @param tag [i] The tag node of input type=radio is specified.
1619 s_hdml_do_input_radio_tag(hdml_t *hdml, Node *tag)
1621 Doc *doc = hdml->doc;
1622 request_rec *r = doc->r;
1630 s_hdml_tag_output_upper_half(hdml, tag);
1632 /*--------------------------------------------------------------------------*/
1633 /* get name and value attribute */
1634 /*--------------------------------------------------------------------------*/
1635 nm = qs_get_name_attr (doc, tag, r);
1636 val = qs_get_value_attr (doc, tag, r);
1638 /*--------------------------------------------------------------------------*/
1639 /* The same name is searched out from the list made beforehand. */
1640 /*--------------------------------------------------------------------------*/
1641 for (ii=0; ii<MAX_RADIO_COUNT; ii++) {
1642 if (! hdml->radio_name_list[ii]) {
1644 DBG1(r, "Oops... radio list is null[%d]", ii);
1645 /*----------------------------------------------------------------------*/
1646 /* Processing is ended because it doesn't happen off the fly. */
1647 /*----------------------------------------------------------------------*/
1651 if (strcasecmp(hdml->radio_name_list[ii], nm) == 0)
1654 if (ii == MAX_RADIO_COUNT) {
1656 DBG(r,"Oops... The same name was not in the list. ");
1657 /*------------------------------------------------------------------------*/
1658 /* Processing is ended because it doesn't happen off the fly. */
1659 /*------------------------------------------------------------------------*/
1663 s_output_to_hdml_out(hdml,
1664 apr_psprintf(r->pool,
1666 "LABEL=\"\x93\xfc\x97\xcd\" "
1667 "DEST=#R%d VARS=\"VAL=%s\" "
1673 if (hdml->radio_out_cnt[ii] == 0) {
1674 s_output_to_hdml_card(hdml,
1675 apr_psprintf(r->pool,
1676 "<NODISPLAY NAME=R%d>\n",
1678 s_output_to_hdml_card(hdml,
1679 apr_psprintf(r->pool,
1681 "TYPE=ACCEPT TASK=RETURN RETVALS=\"$VAL;"));
1684 kk = hdml->radio_out_cnt[ii];
1685 for (jj=0; jj<MAX_RADIO_VALUE_COUNT; jj++)
1686 if (! hdml->radio_value_list[ii][jj])
1691 for (jj=0; jj<r_cnt; jj++) {
1692 if (! hdml->radio_value_list[ii][jj])
1696 s_output_to_hdml_out(hdml, apr_psprintf(r->pool, ";"));
1697 if (hdml->radio_out_cnt[ii] == 0)
1698 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, ";"));
1701 s_output_to_hdml_out(hdml, apr_psprintf(r->pool, "%s_%02d", nm, kk));
1702 if (hdml->radio_out_cnt[ii] == 0) {
1704 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, "X"));
1706 s_output_to_hdml_card(hdml, apr_psprintf(r->pool, "_"));
1713 s_output_to_hdml_out(hdml,
1714 apr_psprintf(r->pool, "\" >$%s_%02d</A>",
1716 hdml->radio_out_cnt[ii]));
1717 if (! hdml->radio_out_cnt[ii]) {
1718 s_output_to_hdml_card(hdml, "\">\n" );
1719 s_output_to_hdml_card(hdml, "</NODISPLAY>\n");
1721 s_output_to_postdata(hdml, apr_psprintf(r->pool, "%s%s=$%s", RADIO_BUTTON_PREFIX, nm, nm));
1723 for (jj=0; jj<r_cnt; jj++) {
1724 if (hdml->radio_value_list[ii][jj] && hdml->radio_checked_value[ii]) {
1725 if (strcasecmp(hdml->radio_value_list[ii][jj],
1726 hdml->radio_checked_value[ii]) == 0) {
1727 s_output_to_init_vars(hdml,
1728 apr_psprintf(r->pool,
1734 s_output_to_init_vars(hdml,
1735 apr_psprintf(r->pool,
1742 s_output_to_init_vars(hdml,
1743 apr_psprintf(r->pool,
1750 if (hdml->radio_checked_value[ii]) {
1751 DBG1(r,"radio button is checked. checked value is [%s]",
1752 hdml->radio_checked_value[ii]);
1753 s_output_to_init_vars(hdml,
1754 apr_psprintf(r->pool,
1757 hdml->radio_checked_value[ii]));
1760 DBG(r,"radio button is not checked. checked value is []");
1761 s_output_to_init_vars(hdml,
1762 apr_psprintf(r->pool,
1767 hdml->radio_out_cnt[ii]++;
1772 * The substitution processing of tag "input type = checkbox" is done.
1774 * @param hdml [i/o] The pointer to the HDML structure at the output
1775 * destination is specified.
1776 * @param tag [i] The tag node of input type=checkbox is specified.
1779 s_hdml_do_input_checkbox_tag(hdml_t *hdml, Node *tag)
1781 Doc *doc = hdml->doc;
1782 request_rec *r = doc->r;
1787 /*--------------------------------------------------------------------------*/
1788 /* It is posted to the one without the checked attribute. */
1789 /* However, they were able to be removed with INPUT FILTER. */
1790 /*--------------------------------------------------------------------------*/
1791 if (! hdml->has_checkbox) {
1792 hdml->has_checkbox++;
1793 s_output_to_hdml_card(hdml,
1794 "<NODISPLAY NAME=\"_chk\">\n"
1795 "<ACTION TYPE=\"ACCEPT\" TASK=\"RETURN\" "
1796 "RETVALS=\"_uchk;$V;X\" >\n"
1798 "<NODISPLAY NAME=\"_uchk\">\n"
1799 "<ACTION TYPE=\"ACCEPT\" TASK=\"RETURN\" "
1800 "RETVALS=\"_chk;;_\" >\n"
1803 DBG(r, "wrote checkbox hdml card.");
1806 /*--------------------------------------------------------------------------*/
1807 /* It is examined whether it is CHECKED. */
1808 /*--------------------------------------------------------------------------*/
1809 chk = qs_is_checked_checkbox_attr(doc, tag, r);
1811 /*--------------------------------------------------------------------------*/
1812 /* The value of the name attribute and the value attribute is acquired */
1814 /*--------------------------------------------------------------------------*/
1815 val = qs_get_value_attr(doc, tag, r);
1816 nm = qs_get_name_attr(doc, tag, r);
1819 val = qs_alloc_zero_byte_string(r);
1822 nm = qs_alloc_zero_byte_string(r);
1824 s_output_to_hdml_out(hdml, apr_psprintf(r->pool,
1825 "<A TASK=GOSUB LABEL=\"a\xaf\xb8\" "
1826 "DEST=\"#$%s%02d\" "
1828 "RECEIVE=\"%s%02d;%s%02d;%s%02d\">"
1830 s_get_form_no(r, hdml),
1831 hdml->var_cnt[hdml->pure_form_cnt] + 0,
1833 s_get_form_no(r, hdml),
1834 hdml->var_cnt[hdml->pure_form_cnt] + 0,
1835 s_get_form_no(r, hdml),
1836 hdml->var_cnt[hdml->pure_form_cnt] + 1,
1837 s_get_form_no(r, hdml),
1838 hdml->var_cnt[hdml->pure_form_cnt] + 2,
1839 s_get_form_no(r, hdml),
1840 hdml->var_cnt[hdml->pure_form_cnt] + 2));
1842 s_output_to_init_vars(hdml,
1843 apr_psprintf(r->pool,
1844 "%s%02d=_uchk&%s%02d=%s&%s%02d=X",
1845 s_get_form_no(r, hdml),
1846 hdml->var_cnt[hdml->pure_form_cnt] + 0,
1847 s_get_form_no(r, hdml),
1848 hdml->var_cnt[hdml->pure_form_cnt] + 1,
1849 ap_escape_uri(r->pool,val),
1850 s_get_form_no(r, hdml),
1851 hdml->var_cnt[hdml->pure_form_cnt] + 2
1855 s_output_to_init_vars(hdml,
1856 apr_psprintf(r->pool,
1857 "%s%02d=_chk&%s%02d=&%s%02d=_",
1858 s_get_form_no(r, hdml),
1859 hdml->var_cnt[hdml->pure_form_cnt] + 0,
1860 s_get_form_no(r, hdml),
1861 hdml->var_cnt[hdml->pure_form_cnt] + 1,
1862 s_get_form_no(r, hdml),
1863 hdml->var_cnt[hdml->pure_form_cnt] + 2
1867 s_output_to_postdata(hdml,
1868 apr_psprintf(r->pool, "%s%s=$%s%02d",
1871 s_get_form_no(r, hdml),
1872 hdml->var_cnt[hdml->pure_form_cnt] + 1));
1874 hdml->var_cnt[hdml->pure_form_cnt] += 3;
1879 * The ISTYLE attribute is converted into the HDML form.
1881 * @param r [i] To use POOL, the pointer to request_rec is specified.
1882 * @param is [i] The value of the ISTYLE attribute is specified.
1883 * @return The ISTYLE attribute converted into the HDML form is returned.
1886 qs_conv_istyle_to_format(request_rec *r, char *is)
1895 fmt = apr_psprintf(r->pool, "M");
1898 fmt = apr_psprintf(r->pool, "M");
1901 fmt = apr_psprintf(r->pool, "m");
1904 fmt = apr_psprintf(r->pool, "N");
1915 * It is a handler who processes the INPUT tag.
1917 * @param pdoc [i/o] The pointer to the HDML structure at the output
1918 * destination is specified.
1919 * @param node [i] The INPUT tag node is specified.
1920 * @return The conversion result is returned.
1923 s_hdml_end_input_tag(void *pdoc, Node *UNUSED(child))
1927 hdml = GET_HDML(pdoc);
1934 * It is a handler who processes the CENTER tag.
1936 * @param pdoc [i/o] The pointer to the HDML structure at the output
1937 * destination is specified.
1938 * @param node [i] The CENTER tag node is specified.
1939 * @return The conversion result is returned.
1942 s_hdml_start_center_tag(void *pdoc, Node *UNUSED(node))
1946 hdml = GET_HDML(pdoc);
1951 if (hdml->hdml_br_flag == 0)
1952 hdml = s_output_to_hdml_out(hdml, "<BR>\n");
1954 hdml = s_output_to_hdml_out(hdml, "<CENTER>");
1961 * It is a handler who processes the CENTER tag.
1963 * @param pdoc [i/o] The pointer to the HDML structure at the output
1964 * destination is specified.
1965 * @param node [i] The CENTER tag node is specified.
1966 * @return The conversion result is returned.
1969 s_hdml_end_center_tag(void *pdoc, Node *UNUSED(child))
1973 hdml = GET_HDML(pdoc);
1976 hdml->in_center = 0;
1978 hdml = s_output_to_hdml_out(hdml, "<BR>\n");
1979 hdml->hdml_br_flag = 1;
1986 * It is a handler who processes the HR tag.
1988 * @param pdoc [i/o] The pointer to the HDML structure at the output
1989 * destination is specified.
1990 * @param node [i] The HR tag node is specified.
1991 * @return The conversion result is returned.
1994 s_hdml_start_hr_tag(void *pdoc, Node *UNUSED(node))
1998 hdml = GET_HDML(pdoc);
2000 if (hdml->hdml_br_flag == 0) {
2001 s_output_to_hdml_out(hdml, "<BR>\n");
2002 if (hdml->in_center)
2005 if (hdml->div_in_center)
2006 hdml->div_in_center--;
2009 s_output_to_hdml_out(hdml, "<CENTER>\x81\x7c\x81\x7c\x81\x7c\x81\x7c\x81\x7c\x81\x7c\x81\x7c\x81\x7c\x81\x7c<BR>\n");
2011 hdml->hdml_br_flag = 1;
2018 * It is a handler who processes the HR tag.
2020 * @param pdoc [i/o] The pointer to the HDML structure at the output
2021 * destination is specified.
2022 * @param node [i] The HR tag node is specified.
2023 * @return The conversion result is returned.
2026 s_hdml_end_hr_tag(void *pdoc, Node *UNUSED(child))
2030 hdml = GET_HDML(pdoc);
2037 * It is a handler who processes the LI tag.
2039 * @param pdoc [i/o] The pointer to the HDML structure at the output
2040 * destination is specified.
2041 * @param node [i] The LI tag node is specified.
2042 * @return The conversion result is returned.
2045 s_hdml_start_li_tag(void *pdoc, Node *UNUSED(node))
2049 hdml = GET_HDML(pdoc);
2051 if (hdml->hdml_br_flag == 0) {
2052 s_output_to_hdml_out(hdml, "<BR>\n");
2053 if (hdml->in_center)
2056 if (hdml->div_in_center)
2057 hdml->div_in_center--;
2060 hdml->hdml_br_flag = 1;
2067 * It is a handler who processes the LI tag.
2069 * @param pdoc [i/o] The pointer to the HDML structure at the output
2070 * destination is specified.
2071 * @param node [i] The LI tag node is specified.
2072 * @return The conversion result is returned.
2075 s_hdml_end_li_tag(void *pdoc, Node *UNUSED(child))
2079 hdml = GET_HDML(pdoc);
2081 if (hdml->hdml_br_flag == 0) {
2082 s_output_to_hdml_out(hdml, "<BR>\n");
2083 if (hdml->in_center)
2086 if (hdml->div_in_center)
2087 hdml->div_in_center--;
2090 hdml->hdml_br_flag = 1;
2097 * It is a handler who processes the IMG tag.
2099 * @param pdoc [i/o] The pointer to the HDML structure at the output
2100 * destination is specified.
2101 * @param node [i] The IMG tag node is specified.
2102 * @return The conversion result is returned.
2105 s_hdml_start_img_tag(void *pdoc, Node *node)
2109 #ifndef IMG_NOT_CONVERT_FILENAME
2110 device_table_t *spec;
2114 hdml = GET_HDML(pdoc);
2116 #ifndef IMG_NOT_CONVERT_FILENAME
2120 s_hdml_tag_output_upper_half(hdml, node);
2122 s_output_to_hdml_out(hdml, "<img");
2124 /* Get Attributes */
2125 for (attr = qs_get_attr(doc,node);
2127 attr = qs_get_next_attr(doc,attr)) {
2129 char *name = qs_get_attr_name(doc,attr);
2130 char *value = qs_get_attr_value(doc,attr);
2132 if ((*name == 's' || *name == 'S') && strcasecmp(name, "src") == 0) {
2133 value = chxj_encoding_parameter(hdml->doc->r, value);
2134 s_output_to_hdml_out(hdml, " src=\"");
2135 #ifdef IMG_NOT_CONVERT_FILENAME
2136 s_output_to_hdml_out(hdml, value );
2138 s_output_to_hdml_out(hdml, chxj_img_conv(doc->r, spec,value));
2140 s_output_to_hdml_out(hdml, "\"" );
2143 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "align" ) == 0) {
2144 s_output_to_hdml_out(hdml, " align=\"" );
2145 s_output_to_hdml_out(hdml, value );
2146 s_output_to_hdml_out(hdml, "\"" );
2149 if ((*name == 'w' || *name == 'W') && strcasecmp(name, "width" ) == 0) {
2150 s_output_to_hdml_out(hdml, " width=\"");
2151 s_output_to_hdml_out(hdml, value );
2152 s_output_to_hdml_out(hdml, "\"" );
2155 if ((*name == 'h' || *name == 'H') && strcasecmp(name, "height") == 0) {
2156 s_output_to_hdml_out(hdml, " height=\"");
2157 s_output_to_hdml_out(hdml, value );
2158 s_output_to_hdml_out(hdml, "\"" );
2161 if ((*name == 'h' || *name == 'H') && strcasecmp(name, "hspace") == 0) {
2162 s_output_to_hdml_out(hdml, " hspace=\"");
2163 s_output_to_hdml_out(hdml, value );
2164 s_output_to_hdml_out(hdml, "\"" );
2167 if ((*name == 'v' || *name == 'V') && strcasecmp(name, "vspace") == 0) {
2168 s_output_to_hdml_out(hdml, " vspace=\"");
2169 s_output_to_hdml_out(hdml, value );
2170 s_output_to_hdml_out(hdml, "\"" );
2173 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "alt" ) == 0) {
2174 s_output_to_hdml_out(hdml, " alt=\"" );
2175 s_output_to_hdml_out(hdml, value );
2176 s_output_to_hdml_out(hdml, "\"" );
2179 s_output_to_hdml_out(hdml, ">" );
2181 hdml->hdml_br_flag = 0;
2188 * It is a handler who processes the IMG tag.
2190 * @param pdoc [i/o] The pointer to the HDML structure at the output
2191 * destination is specified.
2192 * @param node [i] The IMG tag node is specified.
2193 * @return The conversion result is returned.
2196 s_hdml_end_img_tag(void *pdoc, Node *UNUSED(child))
2200 hdml = GET_HDML(pdoc);
2207 * It is a handler who processes the SELECT tag.
2209 * @param pdoc [i/o] The pointer to the HDML structure at the output
2210 * destination is specified.
2211 * @param node [i] The SELECT tag node is specified.
2212 * @return The conversion result is returned.
2215 s_hdml_start_select_tag(void *pdoc, Node *node)
2222 hdml = GET_HDML(pdoc);
2226 s_hdml_tag_output_upper_half(hdml, node);
2230 s_output_to_hdml_out(hdml, apr_psprintf(r->pool,
2231 "<A TASK=GOSUB LABEL=\x91\x49\x91\xf0 "
2232 "VARS=\"V=$%s%02d\" DEST=#D%d "
2233 "RECEIVE=\"%s%02d;%s%02d\">"
2235 s_get_form_no(r, hdml),
2236 hdml->var_cnt[hdml->pure_form_cnt]+0,
2238 s_get_form_no(r, hdml),
2239 hdml->var_cnt[hdml->pure_form_cnt]+0,
2240 s_get_form_no(r, hdml),
2241 hdml->var_cnt[hdml->pure_form_cnt]+1,
2242 s_get_form_no(r, hdml),
2243 hdml->var_cnt[hdml->pure_form_cnt]+1));
2245 s_output_to_hdml_card(hdml,
2246 apr_psprintf(r->pool,
2247 "<CHOICE KEY=V NAME=D%d ", hdml->card_cnt));
2248 s_output_to_hdml_card(hdml,
2249 apr_psprintf(r->pool,
2250 "DEFAULT=$V METHOD=ALPHA MARKABLE=FALSE>\n"));
2251 /*--------------------------------------------------------------------------*/
2252 /* Get Attributes */
2253 /*--------------------------------------------------------------------------*/
2254 for (attr = qs_get_attr(doc,node);
2256 attr=qs_get_next_attr(doc,attr)) {
2258 char *name = qs_get_attr_name(doc,attr);
2259 char *value = qs_get_attr_value(doc,attr);
2260 char *selval = NULL;
2261 char *selvaltxt = NULL;
2263 if ((*name == 'n' || *name == 'N') && strcasecmp(name, "name") == 0) {
2265 s_output_to_postdata(hdml,
2266 apr_psprintf(r->pool, "%s=$%s%02d",
2268 s_get_form_no(r, hdml),
2269 hdml->var_cnt[hdml->pure_form_cnt]));
2270 selval = qs_get_selected_value(doc, node, r);
2272 DBG(r, "selected value not found");
2273 selval = qs_alloc_zero_byte_string(r);
2276 DBG1(r, "selected value found[%s]" , selval);
2278 selvaltxt = qs_get_selected_value_text(doc, node, r);
2280 selvaltxt = qs_alloc_zero_byte_string(r);
2282 DBG1(r, "selvaltxt:[%s]" ,selvaltxt);
2284 s_output_to_init_vars(hdml,
2285 apr_psprintf(r->pool,
2286 "%s%02d=%s&%s%02d=%s",
2287 s_get_form_no(r, hdml),
2288 hdml->var_cnt[hdml->pure_form_cnt] + 0,
2290 s_get_form_no(r, hdml),
2291 hdml->var_cnt[hdml->pure_form_cnt] + 1,
2294 hdml->var_cnt[hdml->pure_form_cnt] += 2;
2299 hdml->hdml_br_flag = 0;
2306 * It is a handler who processes the SELECT tag.
2308 * @param pdoc [i/o] The pointer to the HDML structure at the output
2309 * destination is specified.
2310 * @param node [i] The SELECT tag node is specified.
2311 * @return The conversion result is returned.
2314 s_hdml_end_select_tag(void *pdoc, Node *UNUSED(node))
2318 hdml = GET_HDML(pdoc);
2320 s_output_to_hdml_card(hdml, "</CHOICE>\n");
2327 * It is a handler who processes the OPTION tag.
2329 * @param pdoc [i/o] The pointer to the HDML structure at the output
2330 * destination is specified.
2331 * @param node [i] The OPTION tag node is specified.
2332 * @return The conversion result is returned.
2335 s_hdml_start_option_tag(void *pdoc, Node *node)
2344 hdml = GET_HDML(pdoc);
2350 hdml->option_flag = 1;
2351 val = qs_get_value_attr(doc, node, r);
2353 /*--------------------------------------------------------------------------*/
2354 /* The child node of the object tag node acquires the value in assumption */
2355 /* that is the TEXT node. */
2356 /*--------------------------------------------------------------------------*/
2357 child = qs_get_child_node(doc, node);
2359 txtval = apr_palloc(r->pool, 1);
2363 txtval = qs_get_node_value(doc, child);
2365 DBG1(r, "txtval:[%s]" , txtval);
2367 if (val && txtval) {
2368 s_output_to_hdml_card(hdml,
2369 apr_psprintf(r->pool,
2370 "<CE TASK=RETURN VALUE=\"%s\" "
2371 "RETVALS=\"$V;%s\">%s</CE>\n",
2373 qs_trim_string(r,txtval),
2374 qs_trim_string(r,txtval)));
2377 hdml->hdml_br_flag = 0;
2384 * It is a handler who processes the OPTION tag.
2386 * @param pdoc [i/o] The pointer to the HDML structure at the output
2387 * destination is specified.
2388 * @param node [i] The OPTION tag node is specified.
2389 * @return The conversion result is returned.
2392 s_hdml_end_option_tag(void *pdoc, Node *UNUSED(node))
2396 hdml = GET_HDML(pdoc);
2398 hdml->option_flag = 0;
2405 * It is a handler who processes the DIV tag.
2407 * @param pdoc [i/o] The pointer to the HDML structure at the output
2408 * destination is specified.
2409 * @param node [i] The DIV tag node is specified.
2410 * @return The conversion result is returned.
2413 s_hdml_start_div_tag(void *pdoc, Node *node)
2419 hdml = GET_HDML(pdoc);
2422 /*--------------------------------------------------------------------------*/
2423 /* If the br tag is not output immediately before the div tag appears, the */
2424 /* br tag is output. */
2425 /*--------------------------------------------------------------------------*/
2426 if (hdml->hdml_br_flag == 0) {
2427 hdml->hdml_br_flag = 1;
2428 s_output_to_hdml_out(hdml, "<BR>\n");
2431 /*--------------------------------------------------------------------------*/
2432 /* The object tag node is scanned. */
2433 /*--------------------------------------------------------------------------*/
2434 for (attr = qs_get_attr(doc,node);
2436 attr = qs_get_next_attr(doc,attr)) {
2437 char *name = qs_get_attr_name(doc,attr);
2438 char *value = qs_get_attr_value(doc,attr);
2440 if ((*name == 'a' || *name == 'A') && strcasecmp(name, "align") == 0) {
2441 if ((*value == 'r' || *value == 'R') && strcasecmp(value, "right") == 0) {
2442 hdml->div_right_flag = 1;
2443 s_output_to_hdml_out(hdml, "<RIGHT>");
2444 hdml->hdml_br_flag = 0;
2448 if ((*value == 'c' || *value == 'C') && strcasecmp(value, "center") == 0) {
2449 hdml->div_center_flag = 1;
2450 s_output_to_hdml_out(hdml, "<CENTER>");
2451 hdml->hdml_br_flag = 0;
2456 hdml->hdml_br_flag = 0;
2463 * It is a handler who processes the DIV tag.
2465 * @param pdoc [i/o] The pointer to the HDML structure at the output
2466 * destination is specified.
2467 * @param node [i] The DIV tag node is specified.
2468 * @return The conversion result is returned.
2471 s_hdml_end_div_tag(void *pdoc, Node *UNUSED(node))
2476 hdml = GET_HDML(pdoc);
2479 if (hdml->div_right_flag == 1) {
2480 s_output_to_hdml_out(hdml, apr_psprintf(r->pool, "<BR>\n"));
2481 hdml->div_right_flag = 0;
2483 if (hdml->div_center_flag == 1) {
2484 s_output_to_hdml_out(hdml, apr_psprintf(r->pool, "<BR>\n"));
2485 hdml->div_center_flag = 0;
2486 hdml->div_in_center = 0;
2494 * It is a wrapper of the apr_pstrcat function.
2496 * @param r [i] To use POOL, the pointer to request_rec is specified.
2497 * @param o [i] The character string of connected origin is specified.
2498 * @param s [i] The character string connected with 'o' parameter is
2500 * @param len [i/o] The pointer to the area where the character string
2501 * length is stored is specified.
2502 * @return The character string after it connects it is returned.
2505 qs_out_apr_pstrcat(request_rec *r, char *o, char *s, int *len)
2507 *len = (strlen(s) + *len);
2508 return apr_pstrcat(r->pool, o, s, NULL);
2512 * The prepositive character string used to generate the variable for HDML is
2515 * @param r [i] To use POOL, the pointer to request_rec is specified.
2516 * @param hdml [i] The pointer to the HDML structure that maintains the seed
2517 * to generate it is specified.
2518 * @return The character string after it generates it is returned.
2521 s_get_form_no(request_rec *r, hdml_t *hdml)
2527 fc = hdml->form_cnt;
2529 apr_time_exp_tz(&tm, hdml->form_cnt, 0);
2531 result = apr_psprintf(r->pool, "%c",(int)('A' + ((fc / 100) % 26)));
2532 result = apr_pstrcat(r->pool, result,
2533 apr_psprintf(r->pool, "%02d%02d%02d",
2542 * The number of tag nodes .."Input type =' radio '".. is counted.
2544 * @param hdml [i] The pointer to the HDML structure is specified.
2545 * @param node [i] The first parents node that counts the radio tag node is
2549 s_hdml_count_radio_tag(hdml_t *hdml, Node *node)
2558 /*--------------------------------------------------------------------------*/
2559 /* All the child nodes of the specified node are scanned. */
2560 /*--------------------------------------------------------------------------*/
2561 for (child = qs_get_child_node(doc,node);
2563 child = qs_get_next_node(doc,child)) {
2574 name = qs_get_node_name(doc,child);
2575 if (strcasecmp(name, "input") != 0) {
2576 s_hdml_count_radio_tag(hdml, child);
2580 DBG(r,"found input tag");
2582 type = qs_get_type_attr(doc, child, r);
2584 ERR(r, "Oops! The input tag without the type attribute has been found.Please give a type.");
2588 if (strcasecmp(type, "radio") != 0)
2591 DBG(r, "found type=radio");
2593 rname = qs_get_name_attr (doc, child, r);
2594 rvalue = qs_get_value_attr(doc, child, r);
2597 /*----------------------------------------------------------------------*/
2598 /* Oops!. The input tag without the name attribute has been found. */
2599 /*----------------------------------------------------------------------*/
2600 DBG(r, "Oops!. The input tag without the name attribute has been found. Please give a name.");
2604 DBG(r, "found name attribute");
2606 /*------------------------------------------------------------------------*/
2607 /* It scans in radio_name_list. When the same value exists, the */
2608 /* value is overwrited. */
2609 /* The value is written in a new area when not is. */
2610 /*------------------------------------------------------------------------*/
2611 for (ii=0; ii<MAX_RADIO_COUNT; ii++) {
2612 if (! hdml->radio_name_list[ii]) {
2613 DBG1(r, "new name:[%s]", rname);
2616 if (strcasecmp(hdml->radio_name_list[ii], rname) == 0) {
2617 DBG1(r, "already registered name:[%s]", rname);
2621 if (ii == MAX_RADIO_COUNT) {
2622 DBG(r, apr_psprintf(r->pool,
2623 "I do not understand the name of the radiobutton "
2624 "of %d piece or more. Please decrease "
2625 "the number of radiobuttons.",
2630 DBG1(r,"add radio name:[%s]" ,rname);
2632 hdml->radio_name_list[ii] = apr_pstrdup(r->pool, rname);
2634 /*------------------------------------------------------------------------*/
2635 /* It adds it to radio_value_list. */
2636 /*------------------------------------------------------------------------*/
2637 for (jj=0; jj<MAX_RADIO_VALUE_COUNT; jj++) {
2638 if (!hdml->radio_value_list[ii][jj])
2641 if (jj == MAX_RADIO_VALUE_COUNT) {
2642 DBG(r, apr_psprintf(r->pool,
2643 "I do not understand the value of the radiobutton "
2644 "of %d piece or more. Please decrease "
2645 "the number of radiobuttons.",
2646 MAX_RADIO_VALUE_COUNT));
2649 hdml->radio_value_list[ii][jj] = apr_pstrdup(r->pool, rvalue);
2651 /*------------------------------------------------------------------------*/
2652 /* Now let's be the checked attribute or scan. */
2653 /*------------------------------------------------------------------------*/
2654 chkd = qs_get_checked_attr(hdml->doc, child, hdml->doc->r);
2656 DBG(r,apr_psprintf(r->pool,
2657 "The tag scanned now had the checked "
2658 "attribute. The value is [%s].",
2660 hdml->radio_checked_value[ii] = apr_pstrdup(r->pool, rvalue);
2667 * The character string is added, and output to the out member of the HDML
2670 * @param hdml [i/o] The pointer to the HDML structure that maintains the out
2671 * member at the output destination is specified.
2672 * @param s [i] The character string that should be output is specified.
2673 * @return The pointer to the HDML structure after it processes it is returned.
2676 s_output_to_hdml_out(hdml_t *hdml, char *s)
2678 hdml->out = qs_out_apr_pstrcat(hdml->doc->r, hdml->out, s, &hdml->out_len);
2685 * The character string is added, and output to the card member of the HDML
2688 * @param hdml [i/o] The pointer to the HDML structure that maintains the
2689 * card member at the output destination is specified.
2690 * @param s [i] The character string that should be output is specified.
2691 * @return The pointer to the HDML structure after it processes it is returned.
2694 s_output_to_hdml_card(hdml_t *hdml, char *s)
2696 hdml->card = qs_out_apr_pstrcat(hdml->doc->r, hdml->card, s, &hdml->card_len);
2703 * The data for the post is added, and output.
2705 * @param hdml [i/o] The pointer to the HDML structure at the output
2706 * destination is specified.
2707 * @param s [i] The character string that wants to output to postdata is
2711 s_output_to_postdata(hdml_t *hdml, char *s)
2717 if (strlen(hdml->postdata[hdml->pure_form_cnt]))
2718 hdml->postdata[hdml->pure_form_cnt] =
2719 apr_pstrcat(r->pool,
2720 hdml->postdata[hdml->pure_form_cnt],
2724 hdml->postdata[hdml->pure_form_cnt] =
2725 apr_pstrcat(r->pool,
2726 hdml->postdata[hdml->pure_form_cnt],
2727 qs_trim_string(r, s),
2730 DBG1(r, "POSTDATA:[%s]", hdml->postdata[hdml->pure_form_cnt] );
2736 * The tag output upper half.
2738 * @param hdml [i/o] The pointer to the HDML structure at the output
2739 * destination is specified.
2740 * @param node [i] The A tag node is specified.
2743 s_hdml_tag_output_upper_half(hdml_t *hdml, Node *UNUSED(node))
2745 if (hdml->hdml_br_flag == 1
2746 && hdml->div_right_flag == 1) {
2747 s_output_to_hdml_out(hdml, "<RIGHT>");
2748 hdml->hdml_br_flag = 0;
2751 if (hdml->hdml_br_flag == 1
2753 && hdml->in_center == 0) {
2754 s_output_to_hdml_out(hdml, "<CENTER>");
2756 hdml->hdml_br_flag = 0;
2759 if (hdml->hdml_br_flag == 1
2760 && hdml->div_center_flag > 0
2761 && hdml->div_in_center == 0) {
2762 s_output_to_hdml_out(hdml, "<CENTER>");
2763 hdml->div_in_center++;
2764 hdml->hdml_br_flag = 0;
2770 * The data for the init_vars is added, and output.
2772 * @param hdml [i/o] The pointer to the HDML structure at the output
2773 * destination is specified.
2774 * @param s [i] The character string that wants to output to postdata is
2778 s_output_to_init_vars(hdml_t *hdml, char *s)
2780 request_rec *r = hdml->doc->r;
2782 if (strlen(hdml->init_vars))
2783 hdml->init_vars = apr_pstrcat(r->pool, hdml->init_vars, "&", NULL);
2785 hdml->init_vars = apr_pstrcat(r->pool, hdml->init_vars, qs_trim_string(r,s), NULL);
2787 DBG1(r, "INIT_VARS:[%s]", hdml->init_vars);
2793 s_hdml_chxjif_tag(void *pdoc, Node *node)
2799 hdml = GET_HDML(pdoc);
2802 for (child = qs_get_child_node(doc, node);
2804 child = qs_get_next_node(doc, child)) {
2805 s_output_to_hdml_out(hdml, child->otext);
2806 s_hdml_chxjif_tag(hdml, child);
2812 s_hdml_text_tag(void *pdoc, Node *child)
2824 hdml = GET_HDML(pdoc);
2828 textval = qs_get_node_value(doc,child);
2829 textval = qs_trim_string(r, textval);
2830 if (strlen(textval) == 0)
2833 if (hdml->option_flag == 1)
2836 tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2837 memset(tmp, 0, qs_get_node_size(doc,child)+1);
2838 tdst = apr_palloc(r->pool, 1);
2843 for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2844 if (is_sjis_kanji(textval[ii])) {
2845 one_byte[0] = textval[ii+0];
2846 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2847 one_byte[0] = textval[ii+1];
2848 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2852 if (textval[ii] != '\r' && textval[ii] != '\n') {
2853 one_byte[0] = textval[ii+0];
2854 tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2857 memcpy(tmp, textval, strlen(textval)-1);
2859 s_hdml_tag_output_upper_half(hdml, child->parent);
2860 s_output_to_hdml_out(hdml, tdst);
2861 hdml->hdml_br_flag = 0;