OSDN Git Service

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