OSDN Git Service

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