OSDN Git Service

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