OSDN Git Service

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