OSDN Git Service

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