OSDN Git Service

* A happy new year!!
[modchxj/mod_chxj.git] / src / chxj_jxhtml.c
1 /*
2  * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17 #include "chxj_jxhtml.h"
18 #include "chxj_hdml.h"
19 #include "chxj_dump.h"
20 #include "chxj_img_conv.h"
21 #include "chxj_qr_code.h"
22 #include "chxj_encoding.h"
23 #include "chxj_url_encode.h"
24 #include "chxj_str_util.h"
25 #include "chxj_header_inf.h"
26 #include "chxj_jreserved_tag.h"
27
28
29 #define GET_JXHTML(X) ((jxhtml_t *)(X))
30 #undef W_L
31 #undef W_V
32 #define W_L(X)          do { jxhtml->out = BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, (X)); } while(0)
33 #define W_V(X)          do { jxhtml->out = (X) ? BUFFERED_WRITE_VALUE(jxhtml->out, &doc->buf, (X))  \
34                                                : BUFFERED_WRITE_LITERAL(jxhtml->out, &doc->buf, ""); } while(0)
35 #undef W_NLCODE
36 #define W_NLCODE()     do { char *nlcode = TO_NLCODE(jxhtml->conf); W_V(nlcode); } while (0)
37
38 static char *s_jxhtml_start_html_tag     (void *pdoc, Node *node);
39 static char *s_jxhtml_end_html_tag       (void *pdoc, Node *node);
40 static char *s_jxhtml_start_meta_tag     (void *pdoc, Node *node);
41 static char *s_jxhtml_end_meta_tag       (void *pdoc, Node *node);
42 static char *s_jxhtml_start_head_tag     (void *pdoc, Node *node);
43 static char *s_jxhtml_end_head_tag       (void *pdoc, Node *node);
44 static char *s_jxhtml_start_title_tag    (void *pdoc, Node *node);
45 static char *s_jxhtml_end_title_tag      (void *pdoc, Node *node);
46 static char *s_jxhtml_start_base_tag     (void *pdoc, Node *node);
47 static char *s_jxhtml_end_base_tag       (void *pdoc, Node *node);
48 static char *s_jxhtml_start_body_tag     (void *pdoc, Node *node);
49 static char *s_jxhtml_end_body_tag       (void *pdoc, Node *node);
50 static char *s_jxhtml_start_a_tag        (void *pdoc, Node *node);
51 static char *s_jxhtml_end_a_tag          (void *pdoc, Node *node);
52 static char *s_jxhtml_start_pre_tag      (void *pdoc, Node *node);
53 static char *s_jxhtml_end_pre_tag        (void *pdoc, Node *node);
54 static char *s_jxhtml_start_p_tag        (void *pdoc, Node *node);
55 static char *s_jxhtml_end_p_tag          (void *pdoc, Node *node);
56 static char *s_jxhtml_start_ul_tag       (void *pdoc, Node *node);
57 static char *s_jxhtml_end_ul_tag         (void *pdoc, Node *node);
58 static char *s_jxhtml_start_ol_tag       (void *pdoc, Node *node);
59 static char *s_jxhtml_end_ol_tag         (void *pdoc, Node *node);
60 static char *s_jxhtml_start_li_tag       (void *pdoc, Node *node);
61 static char *s_jxhtml_end_li_tag         (void *pdoc, Node *node);
62 static char *s_jxhtml_start_br_tag       (void *pdoc, Node *node);
63 static char *s_jxhtml_end_br_tag         (void *pdoc, Node *node);
64 static char *s_jxhtml_start_tr_tag       (void *pdoc, Node *node);
65 static char *s_jxhtml_end_tr_tag         (void *pdoc, Node *node);
66 static char *s_jxhtml_start_font_tag     (void *pdoc, Node *node);
67 static char *s_jxhtml_end_font_tag       (void *pdoc, Node *node);
68 static char *s_jxhtml_start_form_tag     (void *pdoc, Node *node);
69 static char *s_jxhtml_end_form_tag       (void *pdoc, Node *node);
70 static char *s_jxhtml_start_input_tag    (void *pdoc, Node *node);
71 static char *s_jxhtml_end_input_tag      (void *pdoc, Node *node);
72 static char *s_jxhtml_start_center_tag   (void *pdoc, Node *node);
73 static char *s_jxhtml_end_center_tag     (void *pdoc, Node *node);
74 static char *s_jxhtml_start_hr_tag       (void *pdoc, Node *node);
75 static char *s_jxhtml_end_hr_tag         (void *pdoc, Node *node);
76 static char *s_jxhtml_start_img_tag      (void *pdoc, Node *node);
77 static char *s_jxhtml_end_img_tag        (void *pdoc, Node *node);
78 static char *s_jxhtml_start_select_tag   (void *pdoc, Node *node);
79 static char *s_jxhtml_end_select_tag     (void *pdoc, Node *node);
80 static char *s_jxhtml_start_option_tag   (void *pdoc, Node *node);
81 static char *s_jxhtml_end_option_tag     (void *pdoc, Node *node);
82 static char *s_jxhtml_start_div_tag      (void *pdoc, Node *node);
83 static char *s_jxhtml_end_div_tag        (void *pdoc, Node *node);
84 static char *s_jxhtml_start_textarea_tag (void *pdoc, Node *node);
85 static char *s_jxhtml_end_textarea_tag   (void *pdoc, Node *node);
86 static char *s_jxhtml_start_b_tag        (void *pdoc, Node *node);
87 static char *s_jxhtml_end_b_tag          (void *pdoc, Node *node);
88 static char *s_jxhtml_chxjif_tag         (void *pdoc, Node *node); 
89 static char *s_jxhtml_text_tag           (void *pdoc, Node *node);
90 static char *s_jxhtml_start_blockquote_tag(void *pdoc, Node *node);
91 static char *s_jxhtml_end_blockquote_tag  (void *pdoc, Node *node);
92 static char *s_jxhtml_start_dir_tag      (void *pdoc, Node *node);
93 static char *s_jxhtml_end_dir_tag        (void *pdoc, Node *node);
94 static char *s_jxhtml_start_dl_tag       (void *pdoc, Node *node);
95 static char *s_jxhtml_end_dl_tag         (void *pdoc, Node *node);
96 static char *s_jxhtml_start_dt_tag       (void *pdoc, Node *node);
97 static char *s_jxhtml_end_dt_tag         (void *pdoc, Node *node);
98 static char *s_jxhtml_start_dd_tag       (void *pdoc, Node *node);
99 static char *s_jxhtml_end_dd_tag         (void *pdoc, Node *node);
100 static char *s_jxhtml_start_h1_tag       (void *pdoc, Node *node);
101 static char *s_jxhtml_end_h1_tag         (void *pdoc, Node *node);
102 static char *s_jxhtml_start_h2_tag       (void *pdoc, Node *node);
103 static char *s_jxhtml_end_h2_tag         (void *pdoc, Node *node);
104 static char *s_jxhtml_start_h3_tag       (void *pdoc, Node *node);
105 static char *s_jxhtml_end_h3_tag         (void *pdoc, Node *node);
106 static char *s_jxhtml_start_h4_tag       (void *pdoc, Node *node);
107 static char *s_jxhtml_end_h4_tag         (void *pdoc, Node *node);
108 static char *s_jxhtml_start_h5_tag       (void *pdoc, Node *node);
109 static char *s_jxhtml_end_h5_tag         (void *pdoc, Node *node);
110 static char *s_jxhtml_start_h6_tag       (void *pdoc, Node *node);
111 static char *s_jxhtml_end_h6_tag         (void *pdoc, Node *node);
112 static char *s_jxhtml_start_menu_tag     (void *pdoc, Node *node);
113 static char *s_jxhtml_end_menu_tag       (void *pdoc, Node *node);
114 static char *s_jxhtml_start_plaintext_tag       (void *pdoc, Node *node);
115 static char *s_jxhtml_start_plaintext_tag_inner (void *pdoc, Node *node);
116 static char *s_jxhtml_end_plaintext_tag         (void *pdoc, Node *node);
117 static char *s_jxhtml_start_blink_tag  (void *pdoc, Node *node);
118 static char *s_jxhtml_end_blink_tag    (void *pdoc, Node *node);
119 static char *s_jxhtml_start_marquee_tag(void *pdoc, Node *node);
120 static char *s_jxhtml_end_marquee_tag  (void *pdoc, Node *node);
121 static char *s_jxhtml_newline_mark       (void *pdoc, Node *node);
122
123 static void  s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec);
124
125 static int   s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt);
126
127 static char *s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s);
128
129
130
131 tag_handler jxhtml_handler[] = {
132   /* tagHTML */
133   {
134     s_jxhtml_start_html_tag,
135     s_jxhtml_end_html_tag,
136   },
137   /* tagMETA */
138   {
139     s_jxhtml_start_meta_tag,
140     s_jxhtml_end_meta_tag,
141   },
142   /* tagTEXTAREA */
143   {
144     s_jxhtml_start_textarea_tag,
145     s_jxhtml_end_textarea_tag,
146   },
147   /* tagP */
148   {
149     s_jxhtml_start_p_tag,
150     s_jxhtml_end_p_tag,
151   },
152   /* tagPRE */
153   {
154     s_jxhtml_start_pre_tag,
155     s_jxhtml_end_pre_tag,
156   },
157   /* tagUL */
158   {
159     s_jxhtml_start_ul_tag,
160     s_jxhtml_end_ul_tag,
161   },
162   /* tagLI */
163   {
164     s_jxhtml_start_li_tag,
165     s_jxhtml_end_li_tag,
166   },
167   /* tagOL */
168   {
169     s_jxhtml_start_ol_tag,
170     s_jxhtml_end_ol_tag,
171   },
172   /* tagH1 */
173   {
174     s_jxhtml_start_h1_tag,
175     s_jxhtml_end_h1_tag,
176   },
177   /* tagH2 */
178   {
179     s_jxhtml_start_h2_tag,
180     s_jxhtml_end_h2_tag,
181   },
182   /* tagH3 */
183   {
184     s_jxhtml_start_h3_tag,
185     s_jxhtml_end_h3_tag,
186   },
187   /* tagH4 */
188   {
189     s_jxhtml_start_h4_tag,
190     s_jxhtml_end_h4_tag,
191   },
192   /* tagH5 */
193   {
194     s_jxhtml_start_h5_tag,
195     s_jxhtml_end_h5_tag,
196   },
197   /* tagH6 */
198   {
199     s_jxhtml_start_h6_tag,
200     s_jxhtml_end_h6_tag,
201   },
202   /* tagHEAD */
203   {
204     s_jxhtml_start_head_tag,
205     s_jxhtml_end_head_tag,
206   },
207   /* tagTITLE */
208   {
209     s_jxhtml_start_title_tag,
210     s_jxhtml_end_title_tag,
211   },
212   /* tagBASE */
213   {
214     s_jxhtml_start_base_tag,
215     s_jxhtml_end_base_tag,
216   },
217   /* tagBODY */
218   {
219     s_jxhtml_start_body_tag,
220     s_jxhtml_end_body_tag,
221   },
222   /* tagA */
223   {
224     s_jxhtml_start_a_tag,
225     s_jxhtml_end_a_tag,
226   },
227   /* tagBR */
228   {
229     s_jxhtml_start_br_tag,
230     s_jxhtml_end_br_tag,
231   },
232   /* tagTABLE */
233   {
234     NULL,
235     NULL,
236   },
237   /* tagTR */
238   {
239     s_jxhtml_start_tr_tag,
240     s_jxhtml_end_tr_tag,
241   },
242   /* tagTD */
243   {
244     NULL,
245     NULL,
246   },
247   /* tagTBODY */
248   {
249     NULL,
250     NULL,
251   },
252   /* tagFONT */
253   {
254     s_jxhtml_start_font_tag,
255     s_jxhtml_end_font_tag,
256   },
257   /* tagFORM */
258   {
259     s_jxhtml_start_form_tag,
260     s_jxhtml_end_form_tag,
261   },
262   /* tagINPUT */
263   {
264     s_jxhtml_start_input_tag,
265     s_jxhtml_end_input_tag,
266   },
267   /* tagCENTER */
268   {
269     s_jxhtml_start_center_tag,
270     s_jxhtml_end_center_tag,
271   },
272   /* tagHR */
273   {
274     s_jxhtml_start_hr_tag,
275     s_jxhtml_end_hr_tag,
276   },
277   /* tagIMG */
278   {
279     s_jxhtml_start_img_tag,
280     s_jxhtml_end_img_tag,
281   },
282   /* tagSELECT */
283   {
284     s_jxhtml_start_select_tag,
285     s_jxhtml_end_select_tag,
286   },
287   /* tagOPTION */
288   {
289     s_jxhtml_start_option_tag,
290     s_jxhtml_end_option_tag,
291   },
292   /* tagDIV */
293   {
294     s_jxhtml_start_div_tag,
295     s_jxhtml_end_div_tag,
296   },
297   /* tagCHXJIF */
298   {
299     s_jxhtml_chxjif_tag,
300     NULL,
301   },
302   /* tagNOBR */
303   {
304     NULL,
305     NULL,
306   },
307   /* tagSMALL */
308   {
309     NULL,
310     NULL,
311   },
312   /* tagSTYLE */
313   {
314     NULL,
315     NULL,
316   },
317   /* tagSPAN */
318   {
319     NULL,
320     NULL,
321   },
322   /* tagTEXT */
323   {
324     s_jxhtml_text_tag,
325     NULL,
326   },
327   /* tagTH */
328   {
329     NULL,
330     NULL,
331   },
332   /* tagB */
333   {
334     s_jxhtml_start_b_tag,
335     s_jxhtml_end_b_tag,
336   },
337   /* tagFIELDSET */
338   {
339     NULL,
340     NULL,
341   },
342   /* tagDT */
343   {
344     s_jxhtml_start_dt_tag,
345     s_jxhtml_end_dt_tag,
346   },
347   /* tagLEGEND */
348   {
349     NULL,
350     NULL,
351   },
352   /* tagLABEL */
353   {
354     NULL,
355     NULL,
356   },
357   /* tagBLOCKQUOTE */
358   {
359     s_jxhtml_start_blockquote_tag,
360     s_jxhtml_end_blockquote_tag,
361   },
362   /* tagDIR */
363   {
364     s_jxhtml_start_dir_tag,
365     s_jxhtml_end_dir_tag,
366   },
367   /* tagDL */
368   {
369     s_jxhtml_start_dl_tag,
370     s_jxhtml_end_dl_tag,
371   },
372   /* tagDD */
373   {
374     s_jxhtml_start_dd_tag,
375     s_jxhtml_end_dd_tag,
376   },
377   /* tagMENU */
378   {
379     s_jxhtml_start_menu_tag,
380     s_jxhtml_end_menu_tag,
381   },
382   /* tagPLAINTEXT */
383   {
384     s_jxhtml_start_plaintext_tag,
385     s_jxhtml_end_plaintext_tag,
386   },
387   /* tagBLINK */
388   {
389     s_jxhtml_start_blink_tag,
390     s_jxhtml_end_blink_tag,
391   },
392   /* tagMARQUEE */
393   {
394     s_jxhtml_start_marquee_tag,
395     s_jxhtml_end_marquee_tag,
396   },
397   /* tagNLMARK */
398   {
399     s_jxhtml_newline_mark,
400     NULL,
401   },
402 };
403
404
405 /**
406  * converts from CHTML5.0 to JXHTML.
407  *
408  * @param r     [i]   Requet_rec is appointed.
409  * @param spec  [i]   The result of the device specification processing which 
410  *                    was done in advance is appointed.
411  * @param src   [i]   The character string before the converting is appointed.
412  * @return The character string after the converting is returned.
413  */
414 char *
415 chxj_convert_jxhtml(
416   request_rec         *r,
417   device_table        *spec,
418   const char          *src,
419   apr_size_t          srclen,
420   apr_size_t          *dstlen,
421   chxjconvrule_entry  *entryp,
422   cookie_t            *cookie
423 )
424 {
425   char      *dst;
426   char      *ss;
427   jxhtml_t   jxhtml;
428   Doc       doc;
429
430   dst = NULL;
431
432   /*--------------------------------------------------------------------------*/
433   /* If qrcode xml                                                            */
434   /*--------------------------------------------------------------------------*/
435   *dstlen = srclen;
436   dst = chxj_qr_code_blob_handler(r, src, (size_t*)dstlen);
437   if (dst) {
438     DBG(r,"I found qrcode xml");
439     return dst;
440   }
441   DBG(r,"not found qrcode xml");
442
443   /*--------------------------------------------------------------------------*/
444   /* The CHTML structure is initialized.                                      */
445   /*--------------------------------------------------------------------------*/
446   s_init_jxhtml(&jxhtml, &doc, r, spec);
447
448   jxhtml.entryp = entryp;
449   jxhtml.cookie = cookie;
450
451   chxj_set_content_type(r, chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=Windows-31J"));
452
453   /*--------------------------------------------------------------------------*/
454   /* The character string of the input is analyzed.                           */
455   /*--------------------------------------------------------------------------*/
456   qs_init_malloc(&doc);
457   qs_init_root_node(&doc);
458
459   ss = apr_pcalloc(r->pool, srclen + 1);
460
461   memset(ss,   0, srclen + 1);
462   memcpy(ss, src, srclen);
463
464 #ifdef DUMP_LOG
465   chxj_dump_out("[src] CHTML -> JXHTML", ss, srclen);
466 #endif
467
468   qs_parse_string(&doc,ss,strlen(ss));
469
470   chxj_buffered_write_init(r->pool, &doc.buf);
471   /*--------------------------------------------------------------------------*/
472   /* It converts it from CHTML to JXHTML.                                      */
473   /*--------------------------------------------------------------------------*/
474   chxj_node_convert(spec,r,(void*)&jxhtml, &doc, qs_get_root(&doc), 0);
475   jxhtml.out = chxj_buffered_write_flush(jxhtml.out, &doc.buf);
476   dst = apr_pstrdup(r->pool, jxhtml.out);
477   chxj_buffered_write_terminate(&doc.buf);
478
479
480   qs_all_free(&doc,QX_LOGMARK);
481
482   if (! dst) 
483     return apr_pstrdup(r->pool,ss);
484
485   if (! strlen(dst)) 
486     dst = apr_psprintf(r->pool, "\n");
487
488   *dstlen = strlen(dst);
489
490 #ifdef DUMP_LOG
491   chxj_dump_out("[dst] CHTML -> JXHTML", dst, *dstlen);
492 #endif
493
494   return dst;
495 }
496
497
498 /**
499  * The CHTML structure is initialized.
500  *
501  * @param jxhtml [i/o] The pointer to the JXHTML structure that wants to be
502  *                   initialized is specified.
503  * @param doc   [i]   The Doc structure that should be set to the initialized
504  *                   JXHTML structure is specified.
505  * @param r     [i]   To use POOL, the pointer to request_rec is specified.
506  * @param spec  [i]   The pointer to the device_table
507  */
508 static void
509 s_init_jxhtml(jxhtml_t *jxhtml, Doc *doc, request_rec *r, device_table *spec)
510 {
511   memset(doc,   0, sizeof(Doc));
512   memset(jxhtml, 0, sizeof(jxhtml_t));
513
514   doc->r      = r;
515   jxhtml->doc  = doc;
516   jxhtml->spec = spec;
517   jxhtml->out  = qs_alloc_zero_byte_string(r->pool);
518   jxhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
519   jxhtml->doc->parse_mode = PARSE_MODE_CHTML;
520 }
521
522
523 /**
524  * Corresponding EMOJI to a current character-code is retrieved. 
525  * The substitution character string is stored in the rslt pointer if agreeing.
526  *
527  * @param jxhtml   [i]   The pointer to the CHTML structure is specified. 
528  * @param txt     [i]   The character string to want to examine whether it is 
529  *                      EMOJI is specified. 
530  * @param rslt    [o]   The pointer to the pointer that stores the result is 
531  *                      specified. 
532  * @return When corresponding EMOJI exists, it returns it excluding 0. 
533  */
534 static int
535 s_jxhtml_search_emoji(jxhtml_t *jxhtml, char *txt, char **rslt)
536 {
537   emoji_t       *ee;
538   request_rec   *r;
539   device_table  *spec;
540   int           len;
541
542   spec = jxhtml->spec;
543
544   len = strlen(txt);
545   r = jxhtml->doc->r;
546
547   if (! spec) DBG(r,"spec is NULL");
548
549   for (ee = jxhtml->conf->emoji;
550        ee;
551        ee = ee->next) {
552
553     unsigned char hex1byte;
554     unsigned char hex2byte;
555
556     if (! ee->imode) { 
557       DBG(r,"emoji->imode is NULL");
558       continue;
559     }
560
561     hex1byte = ee->imode->hex1byte & 0xff;
562     hex2byte = ee->imode->hex2byte & 0xff;
563
564     if (ee->imode->string
565     &&  strlen(ee->imode->string) > 0
566     &&  strncasecmp(ee->imode->string, txt, strlen(ee->imode->string)) == 0) {
567       if (spec == NULL || spec->emoji_type == NULL) {
568         *rslt = apr_psprintf(r->pool,"\e%s\ f", ee->jphone->string);
569         return strlen(ee->imode->string);
570       }
571
572       return 0;
573     }
574
575     if (len >= 2
576     && ((unsigned char)txt[0] & 0xff) == ((unsigned char)hex1byte)
577     && ((unsigned char)txt[1] & 0xff) == ((unsigned char)hex2byte)) {
578       if (spec == NULL || spec->emoji_type == NULL) {
579         *rslt = apr_psprintf(r->pool,"\e%s\ f", ee->jphone->string);
580         return 2;
581       }
582
583       return 0;
584     }
585   }
586
587   return 0;
588 }
589
590
591 /**
592  * It is a handler who processes the HTML tag.
593  *
594  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
595  *                     destination is specified.
596  * @param node   [i]   The HTML tag node is specified.
597  * @return The conversion result is returned.
598  */
599 static char *
600 s_jxhtml_start_html_tag(void *pdoc, Node *UNUSED(node)) 
601 {
602   jxhtml_t       *jxhtml;
603   Doc           *doc;
604   request_rec   *r;
605
606
607   jxhtml  = GET_JXHTML(pdoc);
608   doc    = jxhtml->doc;
609   r      = doc->r;
610   DBG(r, "start s_jxhtml_start_html_tag()");
611
612   W_L("<?xml version='1.0' encoding='Shift_JIS' ?>");
613   W_NLCODE();
614   W_L("<!DOCTYPE html PUBLIC \"-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN\" \"html-basic10-plus.dtd\">");
615   W_NLCODE();
616
617   /*--------------------------------------------------------------------------*/
618   /* start HTML tag                                                           */
619   /*--------------------------------------------------------------------------*/
620   W_L("<html>");
621
622   DBG(r, "end s_jxhtml_start_html_tag()");
623
624   return jxhtml->out;
625 }
626
627
628 /**
629  * It is a handler who processes the HTML tag.
630  *
631  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
632  *                     destination is specified.
633  * @param node   [i]   The HTML tag node is specified.
634  * @return The conversion result is returned.
635  */
636 static char *
637 s_jxhtml_end_html_tag(void *pdoc, Node *UNUSED(child)) 
638 {
639   jxhtml_t      *jxhtml = GET_JXHTML(pdoc);
640   Doc           *doc = jxhtml->doc;
641
642   W_L("</html>");
643
644   return jxhtml->out;
645 }
646
647
648 /**
649  * It is a handler who processes the META tag.
650  *
651  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
652  *                     destination is specified.
653  * @param node   [i]   The META tag node is specified.
654  * @return The conversion result is returned.
655  */
656 static char *
657 s_jxhtml_start_meta_tag(void *pdoc, Node *node) 
658 {
659   jxhtml_t     *jxhtml;
660   Doc          *doc;
661   request_rec  *r;
662   Attr         *attr;
663   int          content_type_flag;
664   int          refresh_flag;
665
666   jxhtml             = GET_JXHTML(pdoc);
667   doc               = jxhtml->doc;
668   r                 = doc->r;
669   refresh_flag      = 0;
670   content_type_flag = 0;
671
672   W_L("<meta");
673   /*--------------------------------------------------------------------------*/
674   /* Get Attributes                                                           */
675   /*--------------------------------------------------------------------------*/
676   for (attr = qs_get_attr(doc,node);
677        attr;
678        attr = qs_get_next_attr(doc,attr)) {
679     char *name   = qs_get_attr_name(doc,attr);
680     char *value  = qs_get_attr_value(doc,attr);
681     switch(*name) {
682     case 'h':
683     case 'H':
684       if (strcasecmp(name, "http-equiv") == 0 && value && *value) {
685         /*----------------------------------------------------------------------*/
686         /* CHTML 2.0                                                            */
687         /*----------------------------------------------------------------------*/
688         W_L(" http-equiv=\"");
689         W_V(value);
690         W_L("\"");
691         if (STRCASEEQ('c','C',"content-type",value)) {
692           content_type_flag = 1;
693         }
694         if (STRCASEEQ('r','R',"refresh",value)) {
695           refresh_flag = 1;
696         }
697       }
698       break;
699
700     case 'c':
701     case 'C':
702       if (strcasecmp(name, "content") == 0 && value && *value) {
703         /*----------------------------------------------------------------------*/
704         /* CHTML 2.0                                                            */
705         /*----------------------------------------------------------------------*/
706         if (content_type_flag)  {
707           W_L(" ");
708           W_V(name);
709           W_L("=\"");
710           W_V(chxj_header_inf_set_content_type(r, "application/xhtml+xml; charset=SHIFT_JIS"));
711           W_L("\"");
712         }
713         else
714         if (refresh_flag) {
715           char *buf;
716           char *sec;
717           char *url;
718   
719           buf = apr_pstrdup(r->pool, value);
720   
721           url = strchr(buf, ';');
722           if (url) {
723             sec = apr_pstrdup(r->pool, buf);
724             sec[url-buf] = 0;
725             url++;
726             url = chxj_encoding_parameter(r, url);
727             W_L(" ");
728             W_V(name);
729             W_L("=\"");
730             W_V(sec);
731             W_L(";");
732             W_V(url);
733             W_L("\"");
734           }
735         }
736         else {
737           W_L(" ");
738           W_V(name);
739           W_L("=\"");
740           W_V(value);
741           W_L("\"");
742         }
743       }
744       break;
745     
746     default:
747       break;
748     }
749   }
750   W_L(" />");
751   return jxhtml->out;
752 }
753
754
755 /**
756  * It is a handler who processes the META tag.
757  *
758  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
759  *                     destination is specified.
760  * @param node   [i]   The META tag node is specified.
761  * @return The conversion result is returned.
762  */
763 static char *
764 s_jxhtml_end_meta_tag(void *pdoc, Node *UNUSED(child)) 
765 {
766   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
767
768   return jxhtml->out;
769 }
770
771
772 /**
773  * It is a handler who processes the HEAD tag.
774  *
775  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
776  *                     destination is specified.
777  * @param node   [i]   The HEAD tag node is specified.
778  * @return The conversion result is returned.
779  */
780 static char *
781 s_jxhtml_start_head_tag(void *pdoc, Node *UNUSED(node)) 
782 {
783   jxhtml_t       *jxhtml;
784   Doc           *doc;
785   request_rec   *r;
786
787   jxhtml = GET_JXHTML(pdoc);
788   doc   = jxhtml->doc;
789   r     = doc->r;
790
791   W_L("<head>");
792   return jxhtml->out;
793 }
794
795
796 /**
797  * It is a handler who processes the HEAD tag.
798  *
799  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
800  *                     destination is specified.
801  * @param node   [i]   The HEAD tag node is specified.
802  * @return The conversion result is returned.
803  */
804 static char *
805 s_jxhtml_end_head_tag(void *pdoc, Node *UNUSED(child)) 
806 {
807   jxhtml_t       *jxhtml;
808   Doc           *doc;
809   request_rec   *r;
810
811   jxhtml = GET_JXHTML(pdoc);
812   doc   = jxhtml->doc;
813   r     = doc->r;
814
815   W_L("</head>");
816   return jxhtml->out;
817 }
818
819
820 /**
821  * It is a handler who processes the TITLE tag.
822  *
823  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
824  *                     destination is specified.
825  * @param node   [i]   The TITLE tag node is specified.
826  * @return The conversion result is returned.
827  */
828 static char *
829 s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node)) 
830 {
831   jxhtml_t      *jxhtml;
832   Doc          *doc;
833   request_rec  *r;
834
835   jxhtml = GET_JXHTML(pdoc);
836   doc   = jxhtml->doc;
837   r     = doc->r;
838
839   W_L("<title>");
840   return jxhtml->out;
841 }
842
843
844 /**
845  * It is a handler who processes the TITLE tag.
846  *
847  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
848  *                     destination is specified.
849  * @param node   [i]   The TITLE tag node is specified.
850  * @return The conversion result is returned.
851  */
852 static char *
853 s_jxhtml_end_title_tag(void *pdoc, Node *UNUSED(child)) 
854 {
855   jxhtml_t       *jxhtml;
856   Doc           *doc;
857   request_rec   *r;
858
859   jxhtml = GET_JXHTML(pdoc);
860   doc   = jxhtml->doc;
861   r     = doc->r;
862
863   W_L("</title>");
864   return jxhtml->out;
865 }
866
867
868 /**
869  * It is a handler who processes the BASE tag.
870  *
871  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
872  *                     destination is specified.
873  * @param node   [i]   The BASE tag node is specified.
874  * @return The conversion result is returned.
875  */
876 static char *
877 s_jxhtml_start_base_tag(void *pdoc, Node *node) 
878 {
879   jxhtml_t       *jxhtml;
880   Attr          *attr;
881   Doc           *doc;
882   request_rec   *r;
883
884   jxhtml = GET_JXHTML(pdoc);
885   doc   = jxhtml->doc;
886   r     = doc->r;
887
888   W_L("<base");
889   /*--------------------------------------------------------------------------*/
890   /* Get Attributes                                                           */
891   /*--------------------------------------------------------------------------*/
892   for (attr = qs_get_attr(doc,node);
893        attr;
894        attr = qs_get_next_attr(doc,attr)) {
895     char *name  = qs_get_attr_name(doc,attr);
896     char *value = qs_get_attr_value(doc,attr);
897     if (STRCASEEQ('h','H',"href",name)) {
898       W_L(" href=\"");
899       W_V(value);
900       W_L("\"");
901     }
902   }
903   W_L(" />");
904   return jxhtml->out;
905 }
906
907
908 /**
909  * It is a handler who processes the BASE tag.
910  *
911  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
912  *                     destination is specified.
913  * @param node   [i]   The BASE tag node is specified.
914  * @return The conversion result is returned.
915  */
916 static char *
917 s_jxhtml_end_base_tag(void *pdoc, Node *UNUSED(child)) 
918 {
919   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
920   return jxhtml->out;
921 }
922
923
924 /**
925  * It is a handler who processes the BODY tag.
926  *
927  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
928  *                     destination is specified.
929  * @param node   [i]   The BODY tag node is specified.
930  * @return The conversion result is returned.
931  */
932 static char *
933 s_jxhtml_start_body_tag(void *pdoc, Node *node) 
934 {
935   jxhtml_t      *jxhtml;
936   Doc          *doc;
937   request_rec  *r;
938   Attr         *attr;
939
940   jxhtml = GET_JXHTML(pdoc);
941   doc   = jxhtml->doc;
942   r     = doc->r;
943
944   W_L("<body");
945   /*--------------------------------------------------------------------------*/
946   /* Get Attributes                                                           */
947   /*--------------------------------------------------------------------------*/
948   for (attr = qs_get_attr(doc,node);
949        attr;
950        attr = qs_get_next_attr(doc,attr)) {
951     char *name   = qs_get_attr_name(doc,attr);
952     char *value  = qs_get_attr_value(doc,attr);
953     if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
954       /*----------------------------------------------------------------------*/
955       /* CHTML 2.0                                                            */
956       /*----------------------------------------------------------------------*/
957       W_L(" bgcolor=\"");
958       W_V(value);
959       W_L("\"");
960     }
961     else if (STRCASEEQ('t','T',"text",name) && value && *value) {
962       /*----------------------------------------------------------------------*/
963       /* CHTML 2.0                                                            */
964       /*----------------------------------------------------------------------*/
965       W_L(" text=\"");
966       W_V(value);
967       W_L("\"");
968     }
969     else if (STRCASEEQ('l','L',"link",name) && value && *value) {
970       /*----------------------------------------------------------------------*/
971       /* CHTML 2.0                                                            */
972       /*----------------------------------------------------------------------*/
973       W_L(" link=\"");
974       W_V(value);
975       W_L("\"");
976     }
977     else if (STRCASEEQ('a','A',"alink",name)) {
978       /*----------------------------------------------------------------------*/
979       /* CHTML 4.0                                                            */
980       /*----------------------------------------------------------------------*/
981       /* ignore */
982     }
983     else if (STRCASEEQ('v','V',"vlink",name)) {
984       /*----------------------------------------------------------------------*/
985       /* CHTML 4.0                                                            */
986       /*----------------------------------------------------------------------*/
987       /* ignore */
988     }
989   }
990   W_L("><div>");
991   return jxhtml->out;
992 }
993
994
995 /**
996  * It is a handler who processes the BODY tag.
997  *
998  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
999  *                     destination is specified.
1000  * @param node   [i]   The BODY tag node is specified.
1001  * @return The conversion result is returned.
1002  */
1003 static char *
1004 s_jxhtml_end_body_tag(void *pdoc, Node *UNUSED(child)) 
1005 {
1006   jxhtml_t       *jxhtml;
1007   Doc           *doc;
1008   request_rec   *r;
1009
1010   jxhtml = GET_JXHTML(pdoc);
1011   doc   = jxhtml->doc;
1012   r     = doc->r;
1013
1014   W_L("</div></body>");
1015   return jxhtml->out;
1016 }
1017
1018
1019 /**
1020  * It is a handler who processes the A tag.
1021  *
1022  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1023  *                     destination is specified.
1024  * @param node   [i]   The A tag node is specified.
1025  * @return The conversion result is returned.
1026  */
1027 static char *
1028 s_jxhtml_start_a_tag(void *pdoc, Node *node) 
1029 {
1030   jxhtml_t       *jxhtml;
1031   Doc           *doc;
1032   request_rec   *r;
1033   Attr          *attr;
1034
1035   jxhtml = GET_JXHTML(pdoc);
1036   doc   = jxhtml->doc;
1037   r     = doc->r;
1038
1039   W_L("<a");
1040   /*--------------------------------------------------------------------------*/
1041   /* Get Attributes                                                           */
1042   /*--------------------------------------------------------------------------*/
1043   for (attr = qs_get_attr(doc,node);
1044        attr; 
1045        attr = qs_get_next_attr(doc,attr)) {
1046     char *name  = qs_get_attr_name(doc,attr);
1047     char *value = qs_get_attr_value(doc,attr);
1048     if (STRCASEEQ('n','N',"name",name)) {
1049       /*----------------------------------------------------------------------*/
1050       /* CHTML1.0                                                             */
1051       /*----------------------------------------------------------------------*/
1052       W_L(" name=\"");
1053       W_V(chxj_jreserved_to_safe_tag(r, value, jxhtml->entryp));
1054       W_L("\"");
1055     }
1056     else if (STRCASEEQ('h','H',"href",name)) {
1057       /*----------------------------------------------------------------------*/
1058       /* CHTML1.0                                                             */
1059       /*----------------------------------------------------------------------*/
1060       value = chxj_encoding_parameter(r, value);
1061       if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
1062         value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
1063       }
1064       W_L(" href=\"");
1065       W_V(value);
1066       W_L("\"");
1067     }
1068     else if (STRCASEEQ('a','A',"accesskey",name)) {
1069       /*----------------------------------------------------------------------*/
1070       /* CHTML1.0                                                             */
1071       /*----------------------------------------------------------------------*/
1072       W_L(" accesskey=\"");
1073       W_V(value);
1074       W_L("\"");
1075     }
1076     else if (STRCASEEQ('c','C',"cti",name)) {
1077       /*----------------------------------------------------------------------*/
1078       /* CHTML 2.0                                                            */
1079       /*----------------------------------------------------------------------*/
1080       W_L(" cti=\"");
1081       W_V(value);
1082       W_L("\"");
1083     }
1084     else if (STRCASEEQ('i','I',"ijam",name)) {
1085       /*----------------------------------------------------------------------*/
1086       /* CHTML 3.0                                                            */
1087       /*----------------------------------------------------------------------*/
1088       /* ignore */
1089     }
1090     else if (STRCASEEQ('u','U',"utn",name)) {
1091       /*----------------------------------------------------------------------*/
1092       /* CHTML 3.0                                                            */
1093       /* It is special only for CHTML.                                        */
1094       /*----------------------------------------------------------------------*/
1095       W_L(" utn ");
1096     }
1097     else if (STRCASEEQ('t','T',"telbook",name)) {
1098       /*----------------------------------------------------------------------*/
1099       /* CHTML 3.0                                                            */
1100       /*----------------------------------------------------------------------*/
1101       /* not support */
1102     }
1103     else if (STRCASEEQ('k','K',"kana",name)) {
1104       /*----------------------------------------------------------------------*/
1105       /* CHTML 3.0                                                            */
1106       /*----------------------------------------------------------------------*/
1107       /* not support */
1108     }
1109     else if (STRCASEEQ('e','E',"email",name)) {
1110       /*----------------------------------------------------------------------*/
1111       /* CHTML 3.0                                                            */
1112       /*----------------------------------------------------------------------*/
1113       /* not support */
1114     }
1115     else if (STRCASEEQ('i','I',"ista",name)) {
1116       /*----------------------------------------------------------------------*/
1117       /* CHTML 4.0                                                            */
1118       /*----------------------------------------------------------------------*/
1119       /* ignore */
1120     }
1121     else if (STRCASEEQ('i','I',"ilet",name)) {
1122       /*----------------------------------------------------------------------*/
1123       /* CHTML 5.0                                                            */
1124       /*----------------------------------------------------------------------*/
1125       /* ignore */
1126     }
1127     else if (STRCASEEQ('i','I',"iswf",name)) {
1128       /*----------------------------------------------------------------------*/
1129       /* CHTML 5.0                                                            */
1130       /*----------------------------------------------------------------------*/
1131       /* ignore */
1132     }
1133     else if (STRCASEEQ('i','I',"irst",name)) {
1134       /*----------------------------------------------------------------------*/
1135       /* CHTML 5.0                                                            */
1136       /*----------------------------------------------------------------------*/
1137       /* ignore */
1138     }
1139   }
1140   W_L(">");
1141   return jxhtml->out;
1142 }
1143
1144
1145 /**
1146  * It is a handler who processes the A tag.
1147  *
1148  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1149  *                     destination is specified.
1150  * @param node   [i]   The A tag node is specified.
1151  * @return The conversion result is returned.
1152  */
1153 static char *
1154 s_jxhtml_end_a_tag(void *pdoc, Node *UNUSED(child)) 
1155 {
1156   jxhtml_t      *jxhtml;
1157   Doc          *doc;
1158   request_rec  *r;
1159
1160   jxhtml = GET_JXHTML(pdoc);
1161   doc   = jxhtml->doc;
1162   r     = doc->r;
1163
1164   W_L("</a>");
1165   return jxhtml->out;
1166 }
1167
1168
1169 /**
1170  * It is a handler who processes the BR tag.
1171  *
1172  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1173  *                     destination is specified.
1174  * @param node   [i]   The BR tag node is specified.
1175  * @return The conversion result is returned.
1176  */
1177 static char *
1178 s_jxhtml_start_br_tag(void *pdoc, Node *node)
1179 {
1180   jxhtml_t     *jxhtml;
1181   Doc          *doc;
1182   request_rec  *r;
1183   Attr         *attr;
1184
1185   jxhtml = GET_JXHTML(pdoc);
1186   doc   = jxhtml->doc;
1187   r     = doc->r;
1188
1189   W_L("<br");
1190   /*--------------------------------------------------------------------------*/
1191   /* Get Attributes                                                           */
1192   /*--------------------------------------------------------------------------*/
1193   for (attr = qs_get_attr(doc,node);
1194        attr;
1195        attr = qs_get_next_attr(doc,attr)) {
1196     char *name  = qs_get_attr_name(doc,attr);
1197     char *value = qs_get_attr_value(doc,attr);
1198     if (STRCASEEQ('c','C',"clear",name)) {
1199       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
1200         W_L(" clear=\"");
1201         W_V(value);
1202         W_L("\"");
1203       }
1204     }
1205   }
1206   W_L(" />");
1207   return jxhtml->out;
1208 }
1209
1210
1211 /**
1212  * It is a handler who processes the BR tag.
1213  *
1214  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1215  *                     destination is specified.
1216  * @param node   [i]   The BR tag node is specified.
1217  * @return The conversion result is returned.
1218  */
1219 static char *
1220 s_jxhtml_end_br_tag(void *pdoc, Node *UNUSED(child)) 
1221 {
1222   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1223   return jxhtml->out;
1224 }
1225
1226
1227 /**
1228  * It is a handler who processes the TR tag.
1229  *
1230  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1231  *                     destination is specified.
1232  * @param node   [i]   The TR tag node is specified.
1233  * @return The conversion result is returned.
1234  */
1235 static char *
1236 s_jxhtml_start_tr_tag(void *pdoc, Node *UNUSED(node)) 
1237 {
1238   jxhtml_t      *jxhtml;
1239   Doc          *doc;
1240   request_rec  *r;
1241
1242   jxhtml = GET_JXHTML(pdoc);
1243   doc   = jxhtml->doc;
1244   r     = doc->r;
1245
1246   W_L("<br />");
1247   return jxhtml->out;
1248 }
1249
1250
1251 /**
1252  * It is a handler who processes the TR tag.
1253  *
1254  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1255  *                     destination is specified.
1256  * @param node   [i]   The TR tag node is specified.
1257  * @return The conversion result is returned.
1258  */
1259 static char *
1260 s_jxhtml_end_tr_tag(void *pdoc, Node *UNUSED(child)) 
1261 {
1262   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1263   return jxhtml->out;
1264 }
1265
1266
1267 /**
1268  * It is a handler who processes the FONT tag.
1269  *
1270  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1271  *                     destination is specified.
1272  * @param node   [i]   The FONT tag node is specified.
1273  * @return The conversion result is returned.
1274  */
1275 static char *
1276 s_jxhtml_start_font_tag(void *pdoc, Node *node) 
1277 {
1278   jxhtml_t      *jxhtml;
1279   Doc           *doc;
1280   request_rec   *r;
1281   Attr          *attr;
1282   char          *color = NULL;
1283   char          *size  = NULL;
1284
1285   jxhtml = GET_JXHTML(pdoc);
1286   doc   = jxhtml->doc;
1287   r     = doc->r;
1288
1289   /*--------------------------------------------------------------------------*/
1290   /* Get Attributes                                                           */
1291   /*--------------------------------------------------------------------------*/
1292   for (attr = qs_get_attr(doc,node);
1293        attr; 
1294        attr = qs_get_next_attr(doc,attr)) {
1295     char *name  = qs_get_attr_name(doc,attr);
1296     char *value = qs_get_attr_value(doc,attr);
1297     if (STRCASEEQ('c','C',"color",name) && value && *value) {
1298       color = apr_pstrdup(doc->buf.pool, value);
1299     }
1300     else if (STRCASEEQ('s','S',"size",name) && value && *value) {
1301       /*----------------------------------------------------------------------*/
1302       /* CHTML 5.0                                                            */
1303       /*----------------------------------------------------------------------*/
1304       size = apr_pstrdup(doc->buf.pool, value);
1305     }
1306   }
1307   if (color) {
1308     W_L("<font color=\"");
1309     W_V(color);
1310     W_L("\">");
1311     jxhtml->font_flag++;
1312   }
1313   if (size) {
1314     jxhtml->font_size_flag++;
1315     switch(*size) {
1316     case '1': W_L("<span style=\"font-size: xx-small\">"); break;
1317     case '2': W_L("<span style=\"font-size: x-small\">");  break;
1318     case '3': W_L("<span style=\"font-size: small\">");    break;
1319     case '4': W_L("<span style=\"font-size: medium\">");   break;
1320     case '5': W_L("<span style=\"font-size: large\">");    break;
1321     case '6': W_L("<span style=\"font-size: x-large\">");  break;
1322     case '7': W_L("<span style=\"font-size: xx-large\">"); break;
1323     case '-':
1324       if (*(size + 1) == '1') {
1325         W_L("<span style=\"font-size: small\">");
1326         break;
1327       }
1328       if (*(size + 1) == '2') {
1329         W_L("<span style=\"font-size: x-small\">");
1330         break;
1331       }
1332       if (*(size + 1) == '3') {
1333         W_L("<span style=\"font-size: xx-small\">");
1334         break;
1335       }
1336       jxhtml->font_size_flag--;
1337       break;
1338
1339     case '+':
1340       if (*(size + 1) == '1') {
1341         W_L("<span style=\"font-size: large\">");
1342         break;
1343       }
1344       if (*(size + 1) == '2') {
1345         W_L("<span style=\"font-size: x-large\">");
1346         break;
1347       }
1348       if (*(size + 1) == '3') {
1349         W_L("<span style=\"font-size: xx-large\">");
1350         break;
1351       }
1352       jxhtml->font_size_flag--;
1353       break;
1354
1355     default:
1356       WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
1357       jxhtml->font_size_flag--;
1358     }
1359   }
1360   return jxhtml->out;
1361 }
1362
1363
1364 /**
1365  * It is a handler who processes the FONT tag.
1366  *
1367  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1368  *                     destination is specified.
1369  * @param node   [i]   The FONT tag node is specified.
1370  * @return The conversion result is returned.
1371  */
1372 static char *
1373 s_jxhtml_end_font_tag(void *pdoc, Node *UNUSED(child)) 
1374 {
1375   jxhtml_t      *jxhtml;
1376   request_rec  *r;
1377   Doc          *doc;
1378
1379   jxhtml = GET_JXHTML(pdoc);
1380   doc   = jxhtml->doc;
1381   r     = jxhtml->doc->r;
1382
1383   if (jxhtml->font_size_flag) {
1384     W_L("</span>");  
1385     jxhtml->font_size_flag--;
1386   }
1387   if (jxhtml->font_flag) {
1388     W_L("</font>");
1389     jxhtml->font_flag--;
1390   }
1391   return jxhtml->out;
1392 }
1393
1394
1395 /**
1396  * It is a handler who processes the FORM tag.
1397  *
1398  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1399  *                     destination is specified.
1400  * @param node   [i]   The FORM tag node is specified.
1401  * @return The conversion result is returned.
1402  */
1403 static char *
1404 s_jxhtml_start_form_tag(void *pdoc, Node *node) 
1405 {
1406   jxhtml_t      *jxhtml;
1407   Doc           *doc;
1408   request_rec   *r;
1409   Attr          *attr;
1410   char          *new_hidden_tag = NULL;
1411   char          *attr_method = NULL;
1412   char          *attr_action = NULL;
1413   char          *attr_utn    = NULL;
1414
1415   jxhtml  = GET_JXHTML(pdoc);
1416   doc     = jxhtml->doc;
1417   r       = doc->r;
1418
1419   /*--------------------------------------------------------------------------*/
1420   /* Get Attributes                                                           */
1421   /*--------------------------------------------------------------------------*/
1422   for (attr = qs_get_attr(doc,node);
1423        attr;
1424        attr = qs_get_next_attr(doc,attr)) {
1425     char *name  = qs_get_attr_name(doc,attr);
1426     char *value = qs_get_attr_value(doc,attr);
1427     if (STRCASEEQ('a','A',"action", name)) {
1428       /*----------------------------------------------------------------------*/
1429       /* CHTML 1.0                                                            */
1430       /*----------------------------------------------------------------------*/
1431       attr_action = chxj_encoding_parameter(r, value);
1432       attr_action = chxj_add_cookie_parameter(r, attr_action, jxhtml->cookie);
1433     }
1434     else if (STRCASEEQ('m','M',"method", name)) {
1435       /*----------------------------------------------------------------------*/
1436       /* CHTML 1.0                                                            */
1437       /*----------------------------------------------------------------------*/
1438       attr_method = apr_pstrdup(doc->pool, value);
1439     }
1440     else if (STRCASEEQ('u','U',"utn", name)) {
1441       /*----------------------------------------------------------------------*/
1442       /* CHTML 3.0                                                            */
1443       /* It is special only for CHTML.                                        */
1444       /*----------------------------------------------------------------------*/
1445       attr_utn = value;
1446     }
1447   }
1448
1449   int post_flag = (attr_method && strcasecmp(attr_method, "post") == 0) ? 1 : 0;
1450
1451   W_L("<form");
1452   if (attr_action) {
1453     char *q;
1454     char *old_qs = NULL;
1455     q = strchr(attr_action, '?');
1456     if (q) {
1457       new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 1, post_flag, &old_qs, CHXJ_FALSE, CHXJ_TRUE, jxhtml->entryp);
1458       if (new_hidden_tag || old_qs) {
1459         *q = 0;
1460       }
1461     }
1462     W_L(" action=\"");
1463     W_V(attr_action);
1464     if (old_qs) {
1465       W_L("?");
1466       W_V(old_qs);
1467     }
1468     W_L("\"");
1469   }
1470   if (attr_method) {
1471     W_L(" method=\"");
1472     W_V(attr_method);
1473     W_L("\"");
1474   }
1475   if (attr_utn) {
1476     W_L(" utn");
1477   }
1478   W_L(">");
1479   if (new_hidden_tag) {
1480     W_V(new_hidden_tag);
1481   }
1482   return jxhtml->out;
1483 }
1484
1485
1486 /**
1487  * It is a handler who processes the FORM tag.
1488  *
1489  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1490  *                     destination is specified.
1491  * @param node   [i]   The FORM tag node is specified.
1492  * @return The conversion result is returned.
1493  */
1494 static char *
1495 s_jxhtml_end_form_tag(void *pdoc, Node *UNUSED(child)) 
1496 {
1497   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1498   Doc     *doc   = jxhtml->doc;
1499   W_L("</form>");
1500   return jxhtml->out;
1501 }
1502
1503
1504 /**
1505  * It is a handler who processes the INPUT tag.
1506  *
1507  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1508  *                     destination is specified.
1509  * @param node   [i]   The INPUT tag node is specified.
1510  * @return The conversion result is returned.
1511  */
1512 static char *
1513 s_jxhtml_start_input_tag(void *pdoc, Node *node) 
1514 {
1515   jxhtml_t       *jxhtml;
1516   Doc           *doc;
1517   request_rec   *r;
1518   char          *max_length;
1519   char          *type;
1520   char          *name;
1521   char          *value;
1522   char          *istyle;
1523   char          *size;
1524   char          *checked;
1525   char          *accesskey;
1526
1527   jxhtml       = GET_JXHTML(pdoc);
1528   doc         = jxhtml->doc;
1529   r           = doc->r;
1530   max_length  = NULL;
1531   type        = NULL;
1532   name        = NULL;
1533   value       = NULL;
1534   istyle      = NULL;
1535   size        = NULL;
1536   checked     = NULL;
1537   accesskey   = NULL;
1538
1539   W_L("<input");
1540   /*--------------------------------------------------------------------------*/
1541   /* Get Attributes                                                           */
1542   /*--------------------------------------------------------------------------*/
1543   type       = qs_get_type_attr(doc, node, doc->buf.pool);
1544   name       = qs_get_name_attr(doc, node, doc->buf.pool);
1545   value      = qs_get_value_attr(doc,node, doc->buf.pool);
1546   istyle     = qs_get_istyle_attr(doc,node,doc->buf.pool);
1547   max_length = qs_get_maxlength_attr(doc,node,doc->buf.pool);
1548   checked    = qs_get_checked_attr(doc,node,doc->buf.pool);
1549   accesskey  = qs_get_accesskey_attr(doc, node, doc->buf.pool);
1550   size       = qs_get_size_attr(doc, node, doc->buf.pool);
1551
1552   if (type) {
1553     if (type && (STRCASEEQ('t','T',"text",    type) ||
1554                  STRCASEEQ('p','P',"password",type) ||
1555                  STRCASEEQ('c','C',"checkbox",type) ||
1556                  STRCASEEQ('r','R',"radio",   type) ||
1557                  STRCASEEQ('h','H',"hidden",  type) ||
1558                  STRCASEEQ('s','S',"submit",  type) ||
1559                  STRCASEEQ('r','R',"reset",   type))) {
1560       W_L(" type=\"");
1561       W_V(type);
1562       W_L("\"");
1563     }
1564   }
1565   if (size && *size) {
1566     W_L(" size=\"");
1567     W_V(size);
1568     W_L("\"");
1569   }
1570   if (name && *name) {
1571     W_L(" name=\"");
1572     W_V(chxj_jreserved_to_safe_tag(r, name, jxhtml->entryp));
1573     W_L("\"");
1574   }
1575   if (value && *value) {
1576     W_L(" value=\"");
1577     W_V(chxj_add_slash_to_doublequote(doc->pool, value));
1578     W_L("\"");
1579   }
1580   if (accesskey && *accesskey) {
1581     W_L(" accesskey=\"");
1582     W_V(accesskey);
1583     W_L("\"");
1584   }
1585   if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
1586     /*------------------------------------------------------------------------*/
1587     /* CHTML 2.0                                                              */
1588     /*------------------------------------------------------------------------*/
1589     if (type && STRCASEEQ('p','P',"password", type) && ! jxhtml->entryp->pc_flag ) {
1590       W_L(" mode=\"");
1591       W_L("numeric");
1592       W_L("\"");
1593     }
1594     else {
1595       char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,istyle);
1596       W_L(" mode=\"");
1597       W_V(vv);
1598       W_L("\"");
1599     }
1600   }
1601   else if (type && STRCASEEQ('p','P',"password",type)) {
1602     W_L(" mode=\"");
1603     W_L("numeric");
1604     W_L("\"");
1605   }
1606   /*--------------------------------------------------------------------------*/
1607   /* The figure is default for the password.                                  */
1608   /*--------------------------------------------------------------------------*/
1609   if (max_length && *max_length) {
1610     if (chxj_chk_numeric(max_length) == 0) {
1611       W_L(" maxlength=\"");
1612       W_V(max_length);
1613       W_L("\"");
1614     }
1615   }
1616
1617   if (checked) {
1618     W_L(" checked=\"checked\"");
1619   }
1620   W_L(" />");
1621   return jxhtml->out;
1622 }
1623
1624
1625 /**
1626  * It is a handler who processes the INPUT tag.
1627  *
1628  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1629  *                     destination is specified.
1630  * @param node   [i]   The INPUT tag node is specified.
1631  * @return The conversion result is returned.
1632  */
1633 static char *
1634 s_jxhtml_end_input_tag(void *pdoc, Node *UNUSED(child)) 
1635 {
1636   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1637   return jxhtml->out;
1638 }
1639
1640
1641 /**
1642  * It is a handler who processes the CENTER tag.
1643  *
1644  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1645  *                     destination is specified.
1646  * @param node   [i]   The CENTER tag node is specified.
1647  * @return The conversion result is returned.
1648  */
1649 static char *
1650 s_jxhtml_start_center_tag(void *pdoc, Node *UNUSED(node)) 
1651 {
1652   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1653   Doc     *doc   = jxhtml->doc;
1654   W_L("<center>");
1655   return jxhtml->out;
1656 }
1657
1658
1659 /**
1660  * It is a handler who processes the CENTER tag.
1661  *
1662  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1663  *                     destination is specified.
1664  * @param node   [i]   The CENTER tag node is specified.
1665  * @return The conversion result is returned.
1666  */
1667 static char *
1668 s_jxhtml_end_center_tag(void *pdoc, Node *UNUSED(child)) 
1669 {
1670   jxhtml_t     *jxhtml;
1671   Doc         *doc;
1672   request_rec *r;
1673
1674   jxhtml = GET_JXHTML(pdoc);
1675   doc   = jxhtml->doc;
1676   r     = doc->r;
1677
1678   W_L("</center>");
1679   return jxhtml->out;
1680 }
1681
1682
1683 /**
1684  * It is a handler who processes the li tag.
1685  *
1686  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1687  *                     destination is specified.
1688  * @param node   [i]   The li tag node is specified.
1689  * @return The conversion result is returned.
1690  */
1691 static char *
1692 s_jxhtml_start_li_tag(void *pdoc, Node *node)
1693 {
1694   jxhtml_t       *jxhtml;
1695   Doc           *doc;
1696   request_rec   *r;
1697   Attr          *attr;
1698
1699   jxhtml = GET_JXHTML(pdoc);
1700   doc   = jxhtml->doc;
1701   r     = doc->r;
1702
1703   W_L("<li");
1704   /*--------------------------------------------------------------------------*/
1705   /* Get Attributes                                                           */
1706   /*--------------------------------------------------------------------------*/
1707   for (attr = qs_get_attr(doc,node);
1708        attr;
1709        attr = qs_get_next_attr(doc,attr)) {
1710     char *name = qs_get_attr_name(doc,attr);
1711     char *value = qs_get_attr_value(doc,attr);
1712     if (STRCASEEQ('t','T',"type",name)) {
1713       if (value && (*value == '1' || *value == 'a' || *value == 'A' || STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1714         W_L(" type=\"");
1715         W_V(value);
1716         W_L("\"");
1717       }
1718     }
1719     else if (STRCASEEQ('v','V',"value", name) && value && *value) {
1720       W_L(" value=\"");
1721       W_V(value);
1722       W_L("\"");
1723     }
1724   }
1725   W_L(">");
1726   return jxhtml->out;
1727 }
1728
1729
1730 /**
1731  * It is a handler who processes the li tag.
1732  *
1733  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1734  *                     destination is specified.
1735  * @param node   [i]   The li tag node is specified.
1736  * @return The conversion result is returned.
1737  */
1738 static char *
1739 s_jxhtml_end_li_tag(void *pdoc, Node *UNUSED(child)) 
1740 {
1741   jxhtml_t     *jxhtml;
1742   Doc         *doc;
1743   request_rec *r;
1744
1745   jxhtml = GET_JXHTML(pdoc);
1746   doc   = jxhtml->doc;
1747   r     = doc->r;
1748
1749   W_L("</li>");
1750   return jxhtml->out;
1751 }
1752
1753
1754 /**
1755  * It is a handler who processes the OL tag.
1756  *
1757  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1758  *                     destination is specified.
1759  * @param node   [i]   The OL tag node is specified.
1760  * @return The conversion result is returned.
1761  */
1762 static char *
1763 s_jxhtml_start_ol_tag(void *pdoc, Node *node)
1764 {
1765   jxhtml_t     *jxhtml;
1766   Doc         *doc;
1767   request_rec *r;
1768   Attr        *attr;
1769
1770   jxhtml = GET_JXHTML(pdoc);
1771   doc   = jxhtml->doc;
1772   r     = doc->r;
1773
1774   W_L("<ol");
1775   /*--------------------------------------------------------------------------*/
1776   /* Get Attributes                                                           */
1777   /*--------------------------------------------------------------------------*/
1778   for (attr = qs_get_attr(doc,node);
1779        attr;
1780        attr = qs_get_next_attr(doc,attr)) {
1781     char *name = qs_get_attr_name(doc,attr);
1782     char *value = qs_get_attr_value(doc,attr);
1783     if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
1784       W_L(" type=\"");
1785       W_V(value);
1786       W_L("\"");
1787     }
1788     else if (STRCASEEQ('s','S',"start",name) && value && *value) {
1789       W_L(" start=\"");
1790       W_V(value);
1791       W_L("\"");
1792     }
1793   }
1794   W_L(">");
1795   return jxhtml->out;
1796 }
1797
1798
1799 /**
1800  * It is a handler who processes the OL tag.
1801  *
1802  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1803  *                     destination is specified.
1804  * @param node   [i]   The OL tag node is specified.
1805  * @return The conversion result is returned.
1806  */
1807 static char *
1808 s_jxhtml_end_ol_tag(void *pdoc, Node *UNUSED(child)) 
1809 {
1810   jxhtml_t     *jxhtml;
1811   Doc         *doc;
1812   request_rec *r;
1813
1814   jxhtml = GET_JXHTML(pdoc);
1815   doc   = jxhtml->doc;
1816   r     = doc->r;
1817
1818   W_L("</ol>");
1819   return jxhtml->out;
1820 }
1821
1822
1823 /**
1824  * It is a handler who processes the P tag.
1825  *
1826  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1827  *                     destination is specified.
1828  * @param node   [i]   The P tag node is specified.
1829  * @return The conversion result is returned.
1830  */
1831 static char *
1832 s_jxhtml_start_p_tag(void *pdoc, Node *node)
1833 {
1834   jxhtml_t     *jxhtml;
1835   Doc         *doc;
1836   request_rec *r;
1837   char        *align = NULL;
1838   Attr        *attr;
1839
1840   jxhtml = GET_JXHTML(pdoc);
1841   doc   = jxhtml->doc;
1842   r     = doc->r;
1843
1844   W_L("<p");
1845   for (attr = qs_get_attr(doc,node);
1846        attr;
1847        attr = qs_get_next_attr(doc,attr)) {
1848     char *nm  = qs_get_attr_name(doc,attr);
1849     char *val = qs_get_attr_value(doc,attr);
1850     if (STRCASEEQ('a','A',"align", nm)) {
1851       /*----------------------------------------------------------------------*/
1852       /* CHTML 1.0 (W3C version 3.2)                                          */
1853       /*----------------------------------------------------------------------*/
1854       if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
1855         align = apr_pstrdup(doc->buf.pool, val);
1856         break;
1857       }
1858     }
1859   }
1860   if (align) {
1861     W_L(" align=\"");
1862     W_V(align);
1863     W_L("\"");
1864   }
1865   W_L(">");
1866   return jxhtml->out;
1867 }
1868
1869
1870 /**
1871  * It is a handler who processes the P tag.
1872  *
1873  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1874  *                     destination is specified.
1875  * @param node   [i]   The P tag node is specified.
1876  * @return The conversion result is returned.
1877  */
1878 static char *
1879 s_jxhtml_end_p_tag(void *pdoc, Node *UNUSED(child)) 
1880 {
1881   jxhtml_t   *jxhtml = GET_JXHTML(pdoc);
1882   Doc       *doc   = jxhtml->doc;
1883
1884   W_L("</p>");
1885   return jxhtml->out;
1886 }
1887
1888
1889 /**
1890  * It is a handler who processes the PRE tag.
1891  *
1892  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1893  *                     destination is specified.
1894  * @param node   [i]   The PRE tag node is specified.
1895  * @return The conversion result is returned.
1896  */
1897 static char *
1898 s_jxhtml_start_pre_tag(void *pdoc, Node *UNUSED(node)) 
1899 {
1900   jxhtml_t  *jxhtml = GET_JXHTML(pdoc);
1901   Doc      *doc   = jxhtml->doc;
1902
1903   jxhtml->pre_flag++;
1904   W_L("<pre>");
1905   return jxhtml->out;
1906 }
1907
1908
1909 /**
1910  * It is a handler who processes the PRE tag.
1911  *
1912  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1913  *                     destination is specified.
1914  * @param node   [i]   The PRE tag node is specified.
1915  * @return The conversion result is returned.
1916  */
1917 static char *
1918 s_jxhtml_end_pre_tag(void *pdoc, Node *UNUSED(child)) 
1919 {
1920   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1921   Doc     *doc   = jxhtml->doc;
1922
1923   W_L("</pre>");
1924   jxhtml->pre_flag--;
1925
1926   return jxhtml->out;
1927 }
1928
1929
1930 /**
1931  * It is a handler who processes the UL tag.
1932  *
1933  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1934  *                     destination is specified.
1935  * @param node   [i]   The UL tag node is specified.
1936  * @return The conversion result is returned.
1937  */
1938 static char *
1939 s_jxhtml_start_ul_tag(void *pdoc, Node *node)
1940 {
1941   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1942   Doc      *doc    = jxhtml->doc;
1943   Attr     *attr;
1944   W_L("<ul");
1945   /*--------------------------------------------------------------------------*/
1946   /* Get Attributes                                                           */
1947   /*--------------------------------------------------------------------------*/
1948   for (attr = qs_get_attr(doc,node);
1949        attr;
1950        attr = qs_get_next_attr(doc,attr)) {
1951     char *name   = qs_get_attr_name(doc,attr);
1952     char *value  = qs_get_attr_value(doc,attr);
1953     if (STRCASEEQ('t','T',"type",name)) {
1954       if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
1955         W_L(" type=\"");
1956         W_V(value);
1957         W_L("\"");
1958       }
1959     }
1960   }
1961   W_L(">");
1962   return jxhtml->out;
1963 }
1964
1965
1966 /**
1967  * It is a handler who processes the UL tag.
1968  *
1969  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
1970  *                     destination is specified.
1971  * @param node   [i]   The UL tag node is specified.
1972  * @return The conversion result is returned.
1973  */
1974 static char *
1975 s_jxhtml_end_ul_tag(void *pdoc, Node *UNUSED(child)) 
1976 {
1977   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1978   Doc     *doc   = jxhtml->doc;
1979
1980   W_L("</ul>");
1981   return jxhtml->out;
1982 }
1983
1984
1985 /**
1986  * It is a handler who processes the HR tag.
1987  *
1988  * @param pdoc  [i/o] The pointer to the CHTML 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.
1992  */
1993 static char *
1994 s_jxhtml_start_hr_tag(void *pdoc, Node *node) 
1995 {
1996   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
1997   Doc     *doc   = jxhtml->doc;
1998   Attr    *attr;
1999
2000   W_L("<hr");
2001   for (attr = qs_get_attr(doc,node);
2002        attr; 
2003        attr = qs_get_next_attr(doc,attr)) {
2004     char *name = qs_get_attr_name(doc,attr);
2005     char *value = qs_get_attr_value(doc,attr);
2006     if (STRCASEEQ('a','A',"align",name)) {
2007       /*----------------------------------------------------------------------*/
2008       /* CHTML 1.0                                                            */
2009       /*----------------------------------------------------------------------*/
2010       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2011         W_L(" align=\"");
2012         W_V(value);
2013         W_L("\"");
2014       }
2015     }
2016     else if (STRCASEEQ('s','S',"size",name) && value && *value) {
2017       /*----------------------------------------------------------------------*/
2018       /* CHTML 1.0                                                            */
2019       /*----------------------------------------------------------------------*/
2020       W_L(" size=\"");
2021       W_V(value);
2022       W_L("\"");
2023     }
2024     else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2025       /*----------------------------------------------------------------------*/
2026       /* CHTML 1.0                                                            */
2027       /*----------------------------------------------------------------------*/
2028       W_L(" width=\"");
2029       W_V(value);
2030       W_L("\"");
2031     }
2032     else if (STRCASEEQ('n','N',"noshade",name)) {
2033       /*----------------------------------------------------------------------*/
2034       /* CHTML 1.0                                                            */
2035       /*----------------------------------------------------------------------*/
2036       W_L(" noshade");
2037     }
2038     else if (STRCASEEQ('c','C',"color",name) && value && *value) {
2039       /*----------------------------------------------------------------------*/
2040       /* CHTML 4.0                                                            */
2041       /*----------------------------------------------------------------------*/
2042       W_L(" color=\"");
2043       W_V(value);
2044       W_L("\"");
2045     }
2046   }
2047   W_L(" />");
2048   return jxhtml->out;
2049 }
2050
2051
2052 /**
2053  * It is a handler who processes the HR tag.
2054  *
2055  * @param jxhtml  [i/o] The pointer to the CHTML structure at the output
2056  *                     destination is specified.
2057  * @param node   [i]   The HR tag node is specified.
2058  * @return The conversion result is returned.
2059  */
2060 static char *
2061 s_jxhtml_end_hr_tag(void *pdoc, Node *UNUSED(child)) 
2062 {
2063   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2064   return jxhtml->out;
2065 }
2066
2067
2068 /**
2069  * It is a handler who processes the IMG tag.
2070  *
2071  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2072  *                     destination is specified.
2073  * @param node   [i]   The IMG tag node is specified.
2074  * @return The conversion result is returned.
2075  */
2076 static char *
2077 s_jxhtml_start_img_tag(void *pdoc, Node *node) 
2078 {
2079   jxhtml_t       *jxhtml = GET_JXHTML(pdoc);
2080   Doc           *doc   = jxhtml->doc;
2081   request_rec   *r     = doc->r;
2082   Attr          *attr;
2083 #ifndef IMG_NOT_CONVERT_FILENAME
2084   device_table  *spec = jxhtml->spec;
2085 #endif
2086   int           has_alt = 0;
2087
2088   W_L("<img");
2089   /*--------------------------------------------------------------------------*/
2090   /* Get Attributes                                                           */
2091   /*--------------------------------------------------------------------------*/
2092   for (attr = qs_get_attr(doc,node);
2093        attr;
2094        attr = qs_get_next_attr(doc,attr)) {
2095     char *name  = qs_get_attr_name(doc,attr);
2096     char *value = qs_get_attr_value(doc,attr);
2097     if (STRCASEEQ('s','S',"src",name)) {
2098       /*----------------------------------------------------------------------*/
2099       /* CHTML 1.0                                                            */
2100       /*----------------------------------------------------------------------*/
2101 #ifdef IMG_NOT_CONVERT_FILENAME
2102       value = chxj_encoding_parameter(r, value);
2103       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2104       value = chxj_add_cookie_no_update_parameter(r, value);
2105       W_L(" src=\"");
2106       W_V(value);
2107       W_L("\"");
2108 #else
2109       value = chxj_img_conv(r, spec, value);
2110       value = chxj_encoding_parameter(r, value);
2111       value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp);
2112       value = chxj_add_cookie_no_update_parameter(r, value);
2113       W_L(" src=\"");
2114       W_V(value);
2115       W_L("\"");
2116 #endif
2117     }
2118     else if (STRCASEEQ('a','A',"align",name)) {
2119       /*----------------------------------------------------------------------*/
2120       /* CHTML 1.0                                                            */
2121       /*----------------------------------------------------------------------*/
2122       if (value) {
2123         if (STRCASEEQ('t','T',"top",   value) ||
2124             STRCASEEQ('m','M',"middle",value) ||
2125             STRCASEEQ('b','B',"bottom",value) ||
2126             STRCASEEQ('l','L',"left",  value) ||
2127             STRCASEEQ('r','R',"right", value)) {
2128           W_L(" align=\"");
2129           W_V(value);
2130           W_L("\"");
2131         }
2132         else if (STRCASEEQ('c','C',"center",value)) {
2133           W_L(" align=\"");
2134           W_L("middle"); 
2135           W_L("\"");
2136         }
2137       }
2138     }
2139     else if (STRCASEEQ('w','W',"width",name) && value && *value) {
2140       /*----------------------------------------------------------------------*/
2141       /* CHTML 1.0                                                            */
2142       /*----------------------------------------------------------------------*/
2143       W_L(" width=\"");
2144       W_V(value);
2145       W_L("\"");
2146     }
2147     else if (STRCASEEQ('h','H',"height",name) && value && *value) {
2148       /*----------------------------------------------------------------------*/
2149       /* CHTML 1.0                                                            */
2150       /*----------------------------------------------------------------------*/
2151       W_L(" height=\"");
2152       W_V(value);
2153       W_L("\"");
2154     }
2155     else if (STRCASEEQ('h','H',"hspace",name)) {
2156       /*----------------------------------------------------------------------*/
2157       /* CHTML 1.0                                                            */
2158       /*----------------------------------------------------------------------*/
2159       /* ignore */
2160     }
2161     else if (STRCASEEQ('v','V',"vspace",name)) {
2162       /*----------------------------------------------------------------------*/
2163       /* CHTML 1.0                                                            */
2164       /*----------------------------------------------------------------------*/
2165       /* ignore */
2166     }
2167     else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
2168       /*----------------------------------------------------------------------*/
2169       /* CHTML 1.0                                                            */
2170       /*----------------------------------------------------------------------*/
2171       W_L(" alt=\"");
2172       W_V(value);
2173       W_L("\"");
2174       has_alt = 1;
2175     }
2176   }
2177   if (! has_alt) {
2178     W_L(" alt=\"\"");
2179   }
2180   W_L(" />");
2181   return jxhtml->out;
2182 }
2183
2184
2185 /**
2186  * It is a handler who processes the IMG tag.
2187  *
2188  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2189  *                     destination is specified.
2190  * @param node   [i]   The IMG tag node is specified.
2191  * @return The conversion result is returned.
2192  */
2193 static char *
2194 s_jxhtml_end_img_tag(void *pdoc, Node *UNUSED(child)) 
2195 {
2196   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2197   return jxhtml->out;
2198 }
2199
2200
2201 /**
2202  * It is a handler who processes the SELECT tag.
2203  *
2204  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2205  *                     destination is specified.
2206  * @param node   [i]   The SELECT tag node is specified.
2207  * @return The conversion result is returned.
2208  */
2209 static char *
2210 s_jxhtml_start_select_tag(void *pdoc, Node *child)
2211 {
2212   jxhtml_t *jxhtml    = GET_JXHTML(pdoc);
2213   Doc     *doc      = jxhtml->doc;
2214   Attr    *attr;
2215   char    *size     = NULL;
2216   char    *name     = NULL;
2217   char    *multiple = NULL;
2218
2219   W_L("<select");
2220   for (attr = qs_get_attr(doc,child);
2221        attr;
2222        attr = qs_get_next_attr(doc,attr)) {
2223     char *nm  = qs_get_attr_name(doc,attr);
2224     char *val = qs_get_attr_value(doc,attr);
2225     if (STRCASEEQ('s','S',"size",nm)) {
2226       /*----------------------------------------------------------------------*/
2227       /* CHTML 1.0 version 2.0                                                */
2228       /*----------------------------------------------------------------------*/
2229       size = apr_pstrdup(doc->buf.pool, val);
2230     }
2231     else if (STRCASEEQ('n','N',"name",nm)) {
2232       /*----------------------------------------------------------------------*/
2233       /* CHTML 1.0 version 2.0                                                */
2234       /*----------------------------------------------------------------------*/
2235       name = apr_pstrdup(doc->buf.pool, val);
2236     }
2237     else if (STRCASEEQ('m','M',"multiple", nm)) {
2238       /*----------------------------------------------------------------------*/
2239       /* CHTML 1.0 version 2.0                                                */
2240       /*----------------------------------------------------------------------*/
2241       multiple = apr_pstrdup(doc->buf.pool, val);
2242     }
2243   }
2244   if (size && *size) {
2245     W_L(" size=\"");
2246     W_V(size);
2247     W_L("\"");
2248   }
2249   if (name && *name) {
2250     W_L(" name=\"");
2251     W_V(name);
2252     W_L("\"");
2253   }
2254   if (multiple) {
2255     W_L(" multiple");
2256   }
2257   W_L(">");
2258   return jxhtml->out;
2259 }
2260
2261
2262 /**
2263  * It is a handler who processes the SELECT tag.
2264  *
2265  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2266  *                     destination is specified.
2267  * @param node   [i]   The SELECT tag node is specified.
2268  * @return The conversion result is returned.
2269  */
2270 static char *
2271 s_jxhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
2272 {
2273   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2274   Doc     *doc   = jxhtml->doc;
2275
2276   W_L("</select>");
2277   return jxhtml->out;
2278 }
2279
2280 /**
2281  * It is a handler who processes the OPTION tag.
2282  *
2283  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2284  *                     destination is specified.
2285  * @param node   [i]   The OPTION tag node is specified.
2286  * @return The conversion result is returned.
2287  */
2288 static char *
2289 s_jxhtml_start_option_tag(void *pdoc, Node *child)
2290 {
2291   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2292   Doc     *doc   = jxhtml->doc;
2293   Attr    *attr;
2294
2295   char *selected   = NULL;
2296   char *value      = NULL;
2297
2298   W_L("<option");
2299   for (attr = qs_get_attr(doc,child);
2300        attr;
2301        attr = qs_get_next_attr(doc,attr)) {
2302     char *nm  = qs_get_attr_name(doc,attr);
2303     char *val = qs_get_attr_value(doc,attr);
2304     if (STRCASEEQ('s','S',"selected",nm)) {
2305       /*----------------------------------------------------------------------*/
2306       /* CHTML 1.0 version 2.0                                                */
2307       /*----------------------------------------------------------------------*/
2308       selected = apr_pstrdup(doc->buf.pool, val);
2309     }
2310     else if (STRCASEEQ('v','V',"value",nm)) {
2311       /*----------------------------------------------------------------------*/
2312       /* CHTML 1.0 version 2.0                                                */
2313       /*----------------------------------------------------------------------*/
2314       value = apr_pstrdup(doc->buf.pool, val);
2315     }
2316   }
2317   if (value) {
2318     W_L(" value=\"");
2319     W_V(value);
2320     W_L("\"");
2321   }
2322   if (selected) {
2323     W_L(" selected");
2324   }
2325   W_L(">");
2326   return jxhtml->out;
2327 }
2328
2329
2330 /**
2331  * It is a handler who processes the OPTION tag.
2332  *
2333  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2334  *                     destination is specified.
2335  * @param node   [i]   The OPTION tag node is specified.
2336  * @return The conversion result is returned.
2337  */
2338 static char *
2339 s_jxhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
2340 {
2341   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2342   Doc      *doc = jxhtml->doc;
2343   W_L("</option>");
2344   return jxhtml->out;
2345 }
2346
2347
2348 /**
2349  * It is a handler who processes the DIV tag.
2350  *
2351  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2352  *                     destination is specified.
2353  * @param node   [i]   The DIV tag node is specified.
2354  * @return The conversion result is returned.
2355  */
2356 static char *
2357 s_jxhtml_start_div_tag(void *pdoc, Node *child)
2358 {
2359   jxhtml_t     *jxhtml;
2360   Doc          *doc;
2361   request_rec  *r;
2362   Attr         *attr;
2363   char         *align = NULL;
2364
2365   jxhtml = GET_JXHTML(pdoc);
2366   doc   = jxhtml->doc;
2367   r     = doc->r;
2368
2369   W_L("<div");
2370   for (attr = qs_get_attr(doc,child);
2371        attr;
2372        attr = qs_get_next_attr(doc,attr)) {
2373     char *nm  = qs_get_attr_name(doc,attr);
2374     char *val = qs_get_attr_value(doc,attr);
2375     if (STRCASEEQ('a','A',"align",nm)) {
2376       /*----------------------------------------------------------------------*/
2377       /* CHTML 1.0 (W3C version 3.2)                                          */
2378       /*----------------------------------------------------------------------*/
2379       if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
2380         align = apr_pstrdup(doc->buf.pool, val);
2381       }
2382     }
2383   }
2384   if (align) {
2385     W_L(" align=\"");
2386     W_V(align);
2387     W_L("\"");
2388   }
2389   W_L(">");
2390   return jxhtml->out;
2391 }
2392
2393
2394 /**
2395  * It is a handler who processes the DIV tag.
2396  *
2397  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2398  *                     destination is specified.
2399  * @param node   [i]   The DIV tag node is specified.
2400  * @return The conversion result is returned.
2401  */
2402 static char *
2403 s_jxhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
2404 {
2405   jxhtml_t      *jxhtml;
2406   Doc          *doc;
2407   request_rec  *r;
2408
2409   jxhtml = GET_JXHTML(pdoc);
2410   doc   = jxhtml->doc;
2411   r     = doc->r;
2412
2413   W_L("</div>");
2414   return jxhtml->out;
2415 }
2416
2417
2418 static char *
2419 s_jxhtml_istyle_to_mode(apr_pool_t *p, const char *s)
2420 {
2421   char *tmp;
2422
2423   if (s) {
2424     switch (s[0]) {
2425     case '1': return apr_psprintf(p, "hiragana");
2426     case '2': return apr_psprintf(p, "hankakukana");
2427     case '3': return apr_psprintf(p, "alphabet");
2428     case '4': return apr_psprintf(p, "numeric");
2429     default: 
2430       tmp = apr_palloc(p, 1);
2431       tmp[0] = '\0';
2432       return apr_pstrdup(p, tmp);
2433     }
2434   }
2435
2436   tmp = apr_palloc(p, 1);
2437   tmp[0] = '\0';
2438   return apr_pstrdup(p,tmp);
2439 }
2440
2441
2442 static char *
2443 s_jxhtml_chxjif_tag(void *pdoc, Node *node)
2444 {
2445   jxhtml_t *jxhtml;
2446   Doc     *doc;
2447   Node    *child;
2448   request_rec *r;
2449
2450   jxhtml = GET_JXHTML(pdoc);
2451   doc   = jxhtml->doc;
2452   r     = doc->r;
2453
2454   for (child = qs_get_child_node(doc, node);
2455        child;
2456        child = qs_get_next_node(doc, child)) {
2457     W_V(child->otext);
2458     s_jxhtml_chxjif_tag(jxhtml, child);
2459   }
2460   return NULL;
2461 }
2462
2463
2464 /**
2465  * It is a handler who processes the TEXTARE tag.
2466  *
2467  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2468  *                     destination is specified.
2469  * @param node   [i]   The TEXTAREA tag node is specified.
2470  * @return The conversion result is returned.
2471  */
2472 static char *
2473 s_jxhtml_start_textarea_tag(void *pdoc, Node *node) 
2474 {
2475   jxhtml_t       *jxhtml;
2476   Doc           *doc;
2477   request_rec   *r;
2478   Attr          *attr;
2479
2480   jxhtml = GET_JXHTML(pdoc);
2481   doc   = jxhtml->doc;
2482   r     = doc->r;
2483
2484   jxhtml->textarea_flag++;
2485   W_L("<textarea");
2486   for (attr = qs_get_attr(doc,node);
2487        attr;
2488        attr = qs_get_next_attr(doc,attr)) {
2489     char *name  = qs_get_attr_name(doc,attr);
2490     char *value = qs_get_attr_value(doc,attr);
2491     if (STRCASEEQ('a','A',"accesskey",name) && value && *value != 0) {
2492       W_L(" accesskey=\"");
2493       W_V(value);
2494       W_L("\"");
2495     }
2496     else if (STRCASEEQ('i','I',"istyle", name) && value && (*value == '1' || *value == '2' || *value == '3' || *value == '4')) {
2497       char *vv = s_jxhtml_istyle_to_mode(doc->buf.pool,value);
2498       W_L(" mode=\"");
2499       W_V(vv);
2500       W_L("\"");
2501     }
2502     else if (STRCASEEQ('n','N',"name", name) && value && *value) {
2503       W_L(" name=\"");
2504       W_V(value);
2505       W_L("\"");
2506     }
2507     else if (STRCASEEQ('r','R',"rows", name) && value && *value) {
2508       W_L(" rows=\"");
2509       W_V(value);
2510       W_L("\"");
2511     }
2512     else if (STRCASEEQ('c','C',"cols", name) && value && *value) {
2513       W_L(" cols=\"");
2514       W_V(value);
2515       W_L("\"");
2516     }
2517   }
2518   W_L(">");
2519   return jxhtml->out;
2520 }
2521
2522
2523 /**
2524  * It is a handler who processes the TEXTAREA tag.
2525  *
2526  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2527  *                     destination is specified.
2528  * @param node   [i]   The TEXTAREA tag node is specified.
2529  * @return The conversion result is returned.
2530  */
2531 static char *
2532 s_jxhtml_end_textarea_tag(void *pdoc, Node *UNUSED(child)) 
2533 {
2534   jxhtml_t       *jxhtml;
2535   Doc           *doc;
2536   request_rec   *r;
2537
2538   jxhtml = GET_JXHTML(pdoc);
2539   doc   = jxhtml->doc;
2540   r     = doc->r;
2541
2542   W_L("</textarea>");
2543   jxhtml->textarea_flag--;
2544
2545   return jxhtml->out;
2546 }
2547
2548
2549 /**
2550  * It is a handler who processes the B tag.
2551  *
2552  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2553  *                     destination is specified.
2554  * @param node   [i]   The B tag node is specified.
2555  * @return The conversion result is returned.
2556  */
2557 static char*
2558 s_jxhtml_start_b_tag(void* pdoc, Node* UNUSED(node)) 
2559 {
2560   jxhtml_t*      jxhtml;
2561   Doc*          doc;
2562   request_rec*  r;
2563
2564   jxhtml = GET_JXHTML(pdoc);
2565   doc   = jxhtml->doc;
2566   r     = doc->r;
2567
2568   W_L("<b>");
2569   return jxhtml->out;
2570 }
2571
2572
2573 /**
2574  * It is a handler who processes the B tag.
2575  *
2576  * @param pdoc  [i/o] The pointer to the CHTML structure at the output
2577  *                     destination is specified.
2578  * @param node   [i]   The B tag node is specified.
2579  * @return The conversion result is returned.
2580  */
2581 static char*
2582 s_jxhtml_end_b_tag(void* pdoc, Node* UNUSED(child)) 
2583 {
2584   jxhtml_t*      jxhtml = GET_JXHTML(pdoc);
2585   Doc*          doc   = jxhtml->doc;
2586
2587   W_L("</b>");
2588   return jxhtml->out;
2589 }
2590
2591 static char*
2592 s_jxhtml_text_tag(void* pdoc, Node* child)
2593 {
2594   jxhtml_t*     jxhtml;
2595   Doc*         doc;
2596   char*        textval;
2597   char*        tmp;
2598   char*        tdst;
2599   char         one_byte[2];
2600   int          ii;
2601   int          tdst_len;
2602   request_rec* r;
2603
2604   jxhtml = GET_JXHTML(pdoc);
2605   doc   = jxhtml->doc;
2606   r     = doc->r;
2607
2608   textval = qs_get_node_value(doc,child);
2609   if (strlen(textval) == 0) {
2610     return jxhtml->out;
2611   }
2612
2613   tmp = apr_palloc(r->pool, qs_get_node_size(doc,child)+1);
2614   memset(tmp, 0, qs_get_node_size(doc,child)+1);
2615
2616   tdst     = qs_alloc_zero_byte_string(doc->buf.pool);
2617   memset(one_byte, 0, sizeof(one_byte));
2618   tdst_len = 0;
2619
2620   for (ii=0; ii<qs_get_node_size(doc,child); ii++) {
2621     char* out;
2622     int rtn = s_jxhtml_search_emoji(jxhtml, &textval[ii], &out);
2623     if (rtn) {
2624       tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
2625       ii+=(rtn - 1);
2626       continue;
2627     }
2628
2629     if (is_sjis_kanji(textval[ii])) {
2630       one_byte[0] = textval[ii+0];
2631       tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2632       one_byte[0] = textval[ii+1];
2633       tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2634       ii++;
2635     }
2636     else 
2637     if (jxhtml->pre_flag) {
2638       one_byte[0] = textval[ii+0];
2639       tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2640     }
2641     else
2642     if (jxhtml->textarea_flag) {
2643       one_byte[0] = textval[ii+0];
2644       tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2645     }
2646     else {
2647       if (textval[ii] != '\r' && textval[ii] != '\n') {
2648         one_byte[0] = textval[ii+0];
2649         tdst = qs_out_apr_pstrcat(r, tdst, one_byte, &tdst_len);
2650       }
2651     }
2652   }
2653   W_V(tdst);
2654   return jxhtml->out;
2655 }
2656
2657
2658 /**
2659  * It is a handler who processes the BLOCKQUOTE tag.
2660  *
2661  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2662  *                     destination is specified.
2663  * @param node   [i]   The BLOCKQUOTE tag node is specified.
2664  * @return The conversion result is returned.
2665  */
2666 static char *
2667 s_jxhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
2668 {
2669   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2670   Doc     *doc   = jxhtml->doc;
2671   W_L("<blockquote>");
2672   return jxhtml->out;
2673 }
2674
2675
2676 /**
2677  * It is a handler who processes the BLOCKQUOTE tag.
2678  *
2679  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2680  *                     destination is specified.
2681  * @param node   [i]   The BLOCKQUOTE tag node is specified.
2682  * @return The conversion result is returned.
2683  */
2684 static char *
2685 s_jxhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
2686 {
2687   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2688   Doc     *doc   = jxhtml->doc;
2689   W_L("</blockquote>");
2690   return jxhtml->out;
2691 }
2692
2693
2694 /**
2695  * It is a handler who processes the DIR tag.
2696  *
2697  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2698  *                     destination is specified.
2699  * @param node   [i]   The DIR tag node is specified.
2700  * @return The conversion result is returned.
2701  */
2702 static char *
2703 s_jxhtml_start_dir_tag(void *pdoc, Node *node)
2704 {
2705   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2706   Doc      *doc = jxhtml->doc;
2707   Attr     *attr;
2708   W_L("<dir");
2709   for (attr = qs_get_attr(doc,node);
2710        attr;
2711        attr = qs_get_next_attr(doc,attr)) {
2712     char *name   = qs_get_attr_name(doc,attr);
2713     char *value  = qs_get_attr_value(doc,attr);
2714     if (STRCASEEQ('t','T',"type",name)) {
2715       if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
2716         W_L(" type=\"");
2717         W_V(value);
2718         W_L("\"");
2719       }
2720     }
2721   }
2722   W_L(">");
2723   return jxhtml->out;
2724 }
2725
2726
2727 /**
2728  * It is a handler who processes the DIR tag.
2729  *
2730  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2731  *                     destination is specified.
2732  * @param node   [i]   The DIR tag node is specified.
2733  * @return The conversion result is returned.
2734  */
2735 static char *
2736 s_jxhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
2737 {
2738   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2739   Doc *doc = jxhtml->doc;
2740   W_L("</dir>");
2741   return jxhtml->out;
2742 }
2743
2744
2745 /**
2746  * It is a handler who processes the DL tag.
2747  *
2748  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2749  *                     destination is specified.
2750  * @param node   [i]   The DL tag node is specified.
2751  * @return The conversion result is returned.
2752  */
2753 static char *
2754 s_jxhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
2755 {
2756   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2757   Doc *doc = jxhtml->doc;
2758   W_L("<dl>");
2759   return jxhtml->out;
2760 }
2761
2762
2763 /**
2764  * It is a handler who processes the DL tag.
2765  *
2766  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2767  *                     destination is specified.
2768  * @param node   [i]   The DL tag node is specified.
2769  * @return The conversion result is returned.
2770  */
2771 static char *
2772 s_jxhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
2773 {
2774   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2775   Doc *doc = jxhtml->doc;
2776   W_L("</dl>");
2777   return jxhtml->out;
2778 }
2779
2780
2781 /**
2782  * It is a handler who processes the DT tag.
2783  *
2784  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2785  *                     destination is specified.
2786  * @param node   [i]   The DT tag node is specified.
2787  * @return The conversion result is returned.
2788  */
2789 static char *
2790 s_jxhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
2791 {
2792   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2793   Doc     *doc   = jxhtml->doc;
2794   W_L("<dt>");
2795   return jxhtml->out;
2796 }
2797
2798
2799 /**
2800  * It is a handler who processes the DT tag.
2801  *
2802  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2803  *                     destination is specified.
2804  * @param node   [i]   The DT tag node is specified.
2805  * @return The conversion result is returned.
2806  */
2807 static char *
2808 s_jxhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
2809 {
2810   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2811   return jxhtml->out;
2812 }
2813
2814
2815 /**
2816  * It is a handler who processes the DD tag.
2817  *
2818  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2819  *                     destination is specified.
2820  * @param node   [i]   The DD tag node is specified.
2821  * @return The conversion result is returned.
2822  */
2823 static char *
2824 s_jxhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
2825 {
2826   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2827   Doc *doc = jxhtml->doc;
2828   W_L("<dd>");
2829   return jxhtml->out;
2830 }
2831
2832
2833 /**
2834  * It is a handler who processes the DD tag.
2835  *
2836  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2837  *                     destination is specified.
2838  * @param node   [i]   The DD tag node is specified.
2839  * @return The conversion result is returned.
2840  */
2841 static char *
2842 s_jxhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
2843 {
2844   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
2845   return jxhtml->out;
2846 }
2847
2848
2849 /**
2850  * It is a handler who processes the H1 tag.
2851  *
2852  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2853  *                     destination is specified.
2854  * @param node   [i]   The H1 tag node is specified.
2855  * @return The conversion result is returned.
2856  */
2857 static char *
2858 s_jxhtml_start_h1_tag(void *pdoc, Node *node)
2859 {
2860   jxhtml_t       *jxhtml;
2861   Doc           *doc;
2862   request_rec   *r;
2863   Attr          *attr;
2864   char          *align = NULL;
2865
2866   jxhtml   = GET_JXHTML(pdoc);
2867   doc     = jxhtml->doc;
2868   r       = doc->r;
2869
2870   for (attr = qs_get_attr(doc,node);
2871        attr;
2872        attr = qs_get_next_attr(doc,attr)) {
2873     char *name  = qs_get_attr_name(doc,attr);
2874     char *value = qs_get_attr_value(doc,attr);
2875     if (STRCASEEQ('a','A',"align", name)) {
2876       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2877         jxhtml->h1_align_flag++;
2878         align = apr_pstrdup(doc->buf.pool, value);
2879         break;
2880       }
2881     }
2882   }
2883   if (align) {
2884     W_L("<div align=\"");
2885     W_V(align);
2886     W_L("\">");
2887   }
2888   return jxhtml->out;
2889 }
2890
2891
2892 /**
2893  * It is a handler who processes the H1 tag.
2894  *
2895  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2896  *                     destination is specified.
2897  * @param node   [i]   The H1 tag node is specified.
2898  * @return The conversion result is returned.
2899  */
2900 static char *
2901 s_jxhtml_end_h1_tag(void *pdoc, Node *UNUSED(child)) 
2902 {
2903   jxhtml_t*    jxhtml;
2904   Doc*          doc;
2905   request_rec*  r;
2906
2907   jxhtml = GET_JXHTML(pdoc);
2908   doc     = jxhtml->doc;
2909   r       = doc->r;
2910   
2911   if (jxhtml->h1_align_flag) {
2912     jxhtml->h1_align_flag--;
2913     W_L("</div>");
2914   }
2915   return jxhtml->out;
2916 }
2917
2918
2919 /**
2920  * It is a handler who processes the H2 tag.
2921  *
2922  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2923  *                     destination is specified.
2924  * @param node   [i]   The H1 tag node is specified.
2925  * @return The conversion result is returned.
2926  */
2927 static char *
2928 s_jxhtml_start_h2_tag(void *pdoc, Node *node)
2929 {
2930   jxhtml_t       *jxhtml;
2931   Doc           *doc;
2932   request_rec   *r;
2933   Attr          *attr;
2934   char          *align = NULL;
2935
2936   jxhtml   = GET_JXHTML(pdoc);
2937   doc     = jxhtml->doc;
2938   r       = doc->r;
2939
2940   for (attr = qs_get_attr(doc,node);
2941        attr;
2942        attr = qs_get_next_attr(doc,attr)) {
2943     char *name  = qs_get_attr_name(doc,attr);
2944     char *value = qs_get_attr_value(doc,attr);
2945     if (STRCASEEQ('a','A',"align", name)) {
2946       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
2947         jxhtml->h2_align_flag++;
2948         align = apr_pstrdup(doc->buf.pool, value);
2949         break;
2950       }
2951     }
2952   }
2953   if (align) {
2954     W_L("<div align=\"");
2955     W_V(align);
2956     W_L("\">");
2957   }
2958   return jxhtml->out;
2959 }
2960
2961
2962 /**
2963  * It is a handler who processes the H2 tag.
2964  *
2965  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2966  *                     destination is specified.
2967  * @param node   [i]   The H1 tag node is specified.
2968  * @return The conversion result is returned.
2969  */
2970 static char *
2971 s_jxhtml_end_h2_tag(void *pdoc, Node *UNUSED(child)) 
2972 {
2973   jxhtml_t*    jxhtml;
2974   Doc*          doc;
2975   request_rec*  r;
2976
2977   jxhtml = GET_JXHTML(pdoc);
2978   doc     = jxhtml->doc;
2979   r       = doc->r;
2980   
2981   if (jxhtml->h2_align_flag) {
2982     jxhtml->h2_align_flag--;
2983     W_L("</div>");
2984   }
2985   return jxhtml->out;
2986 }
2987
2988
2989 /**
2990  * It is a handler who processes the H3 tag.
2991  *
2992  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
2993  *                     destination is specified.
2994  * @param node   [i]   The H1 tag node is specified.
2995  * @return The conversion result is returned.
2996  */
2997 static char *
2998 s_jxhtml_start_h3_tag(void *pdoc, Node *node)
2999 {
3000   jxhtml_t       *jxhtml;
3001   Doc           *doc;
3002   request_rec   *r;
3003   Attr          *attr;
3004   char          *align = NULL;
3005
3006   jxhtml   = GET_JXHTML(pdoc);
3007   doc     = jxhtml->doc;
3008   r       = doc->r;
3009
3010   for (attr = qs_get_attr(doc,node);
3011        attr;
3012        attr = qs_get_next_attr(doc,attr)) {
3013     char* name;
3014     char* value;
3015     name  = qs_get_attr_name(doc,attr);
3016     value = qs_get_attr_value(doc,attr);
3017     if (STRCASEEQ('a','A',"align", name)) {
3018       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3019         jxhtml->h3_align_flag++;
3020         align = apr_pstrdup(doc->buf.pool, value);
3021         break;
3022       }
3023     }
3024   }
3025   if (align) {
3026     W_L("<div align=\"");
3027     W_V(align);
3028     W_L("\">");
3029   }
3030   return jxhtml->out;
3031 }
3032
3033
3034 /**
3035  * It is a handler who processes the H3 tag.
3036  *
3037  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3038  *                     destination is specified.
3039  * @param node   [i]   The H1 tag node is specified.
3040  * @return The conversion result is returned.
3041  */
3042 static char *
3043 s_jxhtml_end_h3_tag(void *pdoc, Node *UNUSED(child)) 
3044 {
3045   jxhtml_t*    jxhtml;
3046   Doc*          doc;
3047   request_rec*  r;
3048
3049   jxhtml = GET_JXHTML(pdoc);
3050   doc     = jxhtml->doc;
3051   r       = doc->r;
3052   
3053   if (jxhtml->h3_align_flag) {
3054     jxhtml->h3_align_flag--;
3055     W_L("</div>");
3056   }
3057   return jxhtml->out;
3058 }
3059
3060
3061 /**
3062  * It is a handler who processes the H4 tag.
3063  *
3064  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3065  *                     destination is specified.
3066  * @param node   [i]   The H1 tag node is specified.
3067  * @return The conversion result is returned.
3068  */
3069 static char *
3070 s_jxhtml_start_h4_tag(void *pdoc, Node *node)
3071 {
3072   jxhtml_t       *jxhtml;
3073   Doc           *doc;
3074   request_rec   *r;
3075   Attr          *attr;
3076   char          *align = NULL;
3077
3078   jxhtml   = GET_JXHTML(pdoc);
3079   doc     = jxhtml->doc;
3080   r       = doc->r;
3081
3082   for (attr = qs_get_attr(doc,node);
3083        attr;
3084        attr = qs_get_next_attr(doc,attr)) {
3085     char *name  = qs_get_attr_name(doc,attr);
3086     char *value = qs_get_attr_value(doc,attr);
3087     if (STRCASEEQ('a','A',"align", name)) {
3088       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3089         jxhtml->h4_align_flag++;
3090         align = apr_pstrdup(doc->buf.pool, value);
3091         break;
3092       }
3093     }
3094   }
3095   if (align) {
3096     W_L("<div align=\"");
3097     W_V(align);
3098     W_L("\">");
3099   }
3100   return jxhtml->out;
3101 }
3102
3103
3104 /**
3105  * It is a handler who processes the H4 tag.
3106  *
3107  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3108  *                     destination is specified.
3109  * @param node   [i]   The H1 tag node is specified.
3110  * @return The conversion result is returned.
3111  */
3112 static char *
3113 s_jxhtml_end_h4_tag(void *pdoc, Node *UNUSED(child)) 
3114 {
3115   jxhtml_t      *jxhtml;
3116   Doc           *doc;
3117   request_rec   *r;
3118
3119   jxhtml = GET_JXHTML(pdoc);
3120   doc     = jxhtml->doc;
3121   r       = doc->r;
3122   
3123   if (jxhtml->h4_align_flag) {
3124     jxhtml->h4_align_flag--;
3125     W_L("</div>");
3126   }
3127   return jxhtml->out;
3128 }
3129
3130
3131 /**
3132  * It is a handler who processes the H5 tag.
3133  *
3134  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3135  *                     destination is specified.
3136  * @param node   [i]   The H1 tag node is specified.
3137  * @return The conversion result is returned.
3138  */
3139 static char *
3140 s_jxhtml_start_h5_tag(void *pdoc, Node *node)
3141 {
3142   jxhtml_t      *jxhtml;
3143   Doc           *doc;
3144   request_rec   *r;
3145   Attr          *attr;
3146   char          *align = NULL;
3147
3148   jxhtml   = GET_JXHTML(pdoc);
3149   doc     = jxhtml->doc;
3150   r       = doc->r;
3151
3152   for (attr = qs_get_attr(doc,node);
3153        attr;
3154        attr = qs_get_next_attr(doc,attr)) {
3155     char *name  = qs_get_attr_name(doc,attr);
3156     char *value = qs_get_attr_value(doc,attr);
3157     if (STRCASEEQ('a','A',"align", name)) {
3158       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3159         jxhtml->h5_align_flag++;
3160         align = apr_pstrdup(doc->buf.pool, value);
3161         break;
3162       }
3163     }
3164   }
3165   if (align) {
3166     W_L("<div align=\"");
3167     W_V(align);
3168     W_L("\">");
3169   }
3170   return jxhtml->out;
3171 }
3172
3173
3174 /**
3175  * It is a handler who processes the H5 tag.
3176  *
3177  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3178  *                     destination is specified.
3179  * @param node   [i]   The H1 tag node is specified.
3180  * @return The conversion result is returned.
3181  */
3182 static char *
3183 s_jxhtml_end_h5_tag(void *pdoc, Node *UNUSED(child)) 
3184 {
3185   jxhtml_t    *jxhtml;
3186   Doc         *doc;
3187   request_rec *r;
3188
3189   jxhtml = GET_JXHTML(pdoc);
3190   doc     = jxhtml->doc;
3191   r       = doc->r;
3192   
3193   if (jxhtml->h5_align_flag) {
3194     jxhtml->h5_align_flag--;
3195     W_L("</div>");
3196   }
3197   return jxhtml->out;
3198 }
3199
3200
3201 /**
3202  * It is a handler who processes the H6 tag.
3203  *
3204  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3205  *                     destination is specified.
3206  * @param node   [i]   The H1 tag node is specified.
3207  * @return The conversion result is returned.
3208  */
3209 static char *
3210 s_jxhtml_start_h6_tag(void *pdoc, Node *node)
3211 {
3212   jxhtml_t      *jxhtml;
3213   Doc           *doc;
3214   request_rec   *r;
3215   Attr          *attr;
3216   char          *align = NULL;
3217
3218   jxhtml   = GET_JXHTML(pdoc);
3219   doc     = jxhtml->doc;
3220   r       = doc->r;
3221
3222   for (attr = qs_get_attr(doc,node);
3223        attr;
3224        attr = qs_get_next_attr(doc,attr)) {
3225     char *name  = qs_get_attr_name(doc,attr);
3226     char *value = qs_get_attr_value(doc,attr);
3227     if (STRCASEEQ('a','A',"align", name)) {
3228       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
3229         jxhtml->h6_align_flag++;
3230         align = apr_pstrdup(doc->buf.pool, value);
3231         break;
3232       }
3233     }
3234   }
3235   if (align) {
3236     W_L("<div align=\"");
3237     W_V(align);
3238     W_L("\">");
3239   }
3240   return jxhtml->out;
3241 }
3242
3243
3244 /**
3245  * It is a handler who processes the H6 tag.
3246  *
3247  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3248  *                     destination is specified.
3249  * @param node   [i]   The H1 tag node is specified.
3250  * @return The conversion result is returned.
3251  */
3252 static char *
3253 s_jxhtml_end_h6_tag(void *pdoc, Node *UNUSED(child)) 
3254 {
3255   jxhtml_t    *jxhtml;
3256   Doc         *doc;
3257   request_rec *r;
3258
3259   jxhtml = GET_JXHTML(pdoc);
3260   doc     = jxhtml->doc;
3261   r       = doc->r;
3262   
3263   if (jxhtml->h6_align_flag) {
3264     jxhtml->h6_align_flag--;
3265     W_L("</div>");
3266   }
3267   return jxhtml->out;
3268 }
3269
3270
3271 /**
3272  * It is a handler who processes the MENU tag.
3273  *
3274  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3275  *                     destination is specified.
3276  * @param node   [i]   The MENU tag node is specified.
3277  * @return The conversion result is returned.
3278  */
3279 static char *
3280 s_jxhtml_start_menu_tag(void *pdoc, Node *node)
3281 {
3282   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3283   Doc      *doc = jxhtml->doc;
3284   Attr     *attr;
3285   W_L("<menu");
3286   /*--------------------------------------------------------------------------*/
3287   /* Get Attributes                                                           */
3288   /*--------------------------------------------------------------------------*/
3289   for (attr = qs_get_attr(doc,node);
3290        attr;
3291        attr = qs_get_next_attr(doc,attr)) {
3292     char *name   = qs_get_attr_name(doc,attr);
3293     char *value  = qs_get_attr_value(doc,attr);
3294     if (STRCASEEQ('t','T',"type",name)) {
3295       if (value && (STRCASEEQ('d','D',"disc",value) || STRCASEEQ('c','C',"circle",value) || STRCASEEQ('s','S',"square",value))) {
3296         W_L(" type=\"");
3297         W_V(value);
3298         W_L("\"");
3299       }
3300     }
3301   }
3302   W_L(">");
3303   return jxhtml->out;
3304 }
3305
3306
3307 /**
3308  * It is a handler who processes the MENU tag.
3309  *
3310  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3311  *                     destination is specified.
3312  * @param node   [i]   The MENU tag node is specified.
3313  * @return The conversion result is returned.
3314  */
3315 static char *
3316 s_jxhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
3317 {
3318   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3319   Doc     *doc = jxhtml->doc;
3320   W_L("</menu>");
3321   return jxhtml->out;
3322 }
3323
3324
3325 /**
3326  * It is a handler who processes the PLAINTEXT tag.
3327  *
3328  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3329  *                     destination is specified.
3330  * @param node   [i]   The PLAINTEXT tag node is specified.
3331  * @return The conversion result is returned.
3332  */
3333 static char *
3334 s_jxhtml_start_plaintext_tag(void *pdoc, Node *node)
3335 {
3336   jxhtml_t *jxhtml;
3337   Doc *doc;
3338
3339   jxhtml = GET_JXHTML(pdoc);
3340   doc     = jxhtml->doc;
3341   W_L("<plaintext>");
3342   s_jxhtml_start_plaintext_tag_inner(pdoc,node);
3343   return jxhtml->out;
3344 }
3345
3346 static char *
3347 s_jxhtml_start_plaintext_tag_inner(void *pdoc, Node *node)
3348 {
3349   jxhtml_t *jxhtml;
3350   Doc *doc;
3351   Node *child;
3352   jxhtml = GET_JXHTML(pdoc);
3353   doc     = jxhtml->doc;
3354   for (child = qs_get_child_node(doc, node);
3355        child;
3356        child = qs_get_next_node(doc, child)) {
3357     W_V(child->otext);
3358     s_jxhtml_start_plaintext_tag_inner(pdoc, child);
3359   }
3360   return jxhtml->out;
3361 }
3362
3363
3364 /**
3365  * It is a handler who processes the PLAINTEXT tag.
3366  *
3367  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3368  *                     destination is specified.
3369  * @param node   [i]   The PLAINTEXT tag node is specified.
3370  * @return The conversion result is returned.
3371  */
3372 static char *
3373 s_jxhtml_end_plaintext_tag(void *pdoc, Node *UNUSED(child))
3374 {
3375   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3376   return jxhtml->out;
3377 }
3378
3379
3380 /**
3381  * It is a handler who processes the BLINK tag.
3382  *
3383  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3384  *                     destination is specified.
3385  * @param node   [i]   The BLINK tag node is specified.
3386  * @return The conversion result is returned.
3387  */
3388 static char *
3389 s_jxhtml_start_blink_tag(void *pdoc, Node *UNUSED(child))
3390 {
3391   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3392   Doc     *doc = jxhtml->doc;
3393   W_L("<blink>");
3394   return jxhtml->out;
3395 }
3396
3397
3398 /**
3399  * It is a handler who processes the BLINK tag.
3400  *
3401  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3402  *                     destination is specified.
3403  * @param node   [i]   The BLINK tag node is specified.
3404  * @return The conversion result is returned.
3405  */
3406 static char *
3407 s_jxhtml_end_blink_tag(void *pdoc, Node *UNUSED(child))
3408 {
3409   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3410   Doc     *doc = jxhtml->doc;
3411   W_L("</blink>");
3412   return jxhtml->out;
3413 }
3414
3415
3416 /**
3417  * It is a handler who processes the MARQUEE tag.
3418  *
3419  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3420  *                     destination is specified.
3421  * @param node   [i]   The MARQUEE tag node is specified.
3422  * @return The conversion result is returned.
3423  */
3424 static char *
3425 s_jxhtml_start_marquee_tag(void *pdoc, Node *node)
3426 {
3427   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3428   Doc *doc = jxhtml->doc;
3429   Attr *attr;
3430   W_L("<marquee");
3431   /*--------------------------------------------------------------------------*/
3432   /* Get Attributes                                                           */
3433   /*--------------------------------------------------------------------------*/
3434   for (attr = qs_get_attr(doc,node);
3435        attr;
3436        attr = qs_get_next_attr(doc,attr)) {
3437     char *name   = qs_get_attr_name(doc,attr);
3438     char *value  = qs_get_attr_value(doc,attr);
3439     if (STRCASEEQ('d','D',"direction", name)) {
3440       if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value))) {
3441         W_L(" direction=\"");
3442         W_V(value);
3443         W_L("\"");
3444       }
3445     }
3446     else if (STRCASEEQ('b','B',"behavior",name)) {
3447       /* ignore */
3448     }
3449     else if (STRCASEEQ('l','L',"loop",name)) {
3450       /* ignore */
3451     }
3452     else if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
3453       W_L(" bgcolor=\"");
3454       W_V(value);
3455       W_L("\"");
3456     }
3457   }
3458   W_L(">");
3459   return jxhtml->out;
3460 }
3461
3462
3463 /**
3464  * It is a handler who processes the MARQUEE tag.
3465  *
3466  * @param pdoc  [i/o] The pointer to the JXHTML structure at the output
3467  *                     destination is specified.
3468  * @param node   [i]   The MARQUEE tag node is specified.
3469  * @return The conversion result is returned.
3470  */
3471 static char *
3472 s_jxhtml_end_marquee_tag(void *pdoc, Node *UNUSED(child))
3473 {
3474   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3475   Doc *doc = jxhtml->doc;
3476   W_L("</marquee>");
3477   return jxhtml->out;
3478 }
3479
3480
3481 /**
3482  * It is handler who processes the New Line Code.
3483  */
3484 static char *
3485 s_jxhtml_newline_mark(void *pdoc, Node *UNUSED(node))
3486 {
3487   jxhtml_t *jxhtml = GET_JXHTML(pdoc);
3488   Doc *doc = jxhtml->doc;
3489   W_NLCODE();
3490   return jxhtml->out;
3491 }
3492 /*
3493  * vim:ts=2 et
3494  */