OSDN Git Service

* Added test code of the <ol> tag for SoftBank HTML converter.
[modchxj/mod_chxj.git] / src / chxj_jhtml.c
index ca3aed8..649f7bb 100644 (file)
 #include "chxj_qr_code.h"
 #include "chxj_encoding.h"
 #include "chxj_url_encode.h"
-
-
-#define GET_JHTML(X) ((jhtml_t*)(X))
-#define WJ_L(X)          do { jhtml->out = BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, (X)); } while(0)
-#define WJ_V(X)          do { jhtml->out = (X) ? BUFFERED_WRITE_VALUE(jhtml->out, &doc->buf, (X))  \
-                                               : BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, ""); } while(0)
-
-static char* s_jhtml_start_html_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_html_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_meta_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_meta_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_head_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_head_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_title_tag    (void* pdoc, Node* node);
-static char* s_jhtml_end_title_tag      (void* pdoc, Node* node);
-static char* s_jhtml_start_base_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_base_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_body_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_body_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_a_tag        (void* pdoc, Node* node);
-static char* s_jhtml_end_a_tag          (void* pdoc, Node* node);
-static char* s_jhtml_start_pre_tag      (void* pdoc, Node* node);
-static char* s_jhtml_end_pre_tag        (void* pdoc, Node* node);
-static char* s_jhtml_start_p_tag        (void* pdoc, Node* node);
-static char* s_jhtml_end_p_tag          (void* pdoc, Node* node);
-static char* s_jhtml_start_ul_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_ul_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_ol_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_ol_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_li_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_li_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_br_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_br_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_tr_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_tr_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_font_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_font_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_form_tag     (void* pdoc, Node* node);
-static char* s_jhtml_end_form_tag       (void* pdoc, Node* node);
-static char* s_jhtml_start_input_tag    (void* pdoc, Node* node);
-static char* s_jhtml_end_input_tag      (void* pdoc, Node* node);
-static char* s_jhtml_start_center_tag   (void* pdoc, Node* node);
-static char* s_jhtml_end_center_tag     (void* pdoc, Node* node);
-static char* s_jhtml_start_hr_tag       (void* pdoc, Node* node);
-static char* s_jhtml_end_hr_tag         (void* pdoc, Node* node);
-static char* s_jhtml_start_img_tag      (void* pdoc, Node* node);
-static char* s_jhtml_end_img_tag        (void* pdoc, Node* node);
-static char* s_jhtml_start_select_tag   (void* pdoc, Node* node);
-static char* s_jhtml_end_select_tag     (void* pdoc, Node* node);
-static char* s_jhtml_start_option_tag   (void* pdoc, Node* node);
-static char* s_jhtml_end_option_tag     (void* pdoc, Node* node);
-static char* s_jhtml_start_div_tag      (void* pdoc, Node* node);
-static char* s_jhtml_end_div_tag        (void* pdoc, Node* node);
-static char* s_jhtml_start_textarea_tag (void* pdoc, Node* node);
-static char* s_jhtml_end_textarea_tag   (void* pdoc, Node* node);
-static char* s_jhtml_start_b_tag        (void* pdoc, Node* node);
-static char* s_jhtml_end_b_tag          (void* pdoc, Node* node);
-static char* s_jhtml_chxjif_tag         (void* pdoc, Node* node); 
-static char* s_jhtml_text_tag           (void* pdoc, Node* node);
-
-static void  s_init_jhtml(jhtml_t* jhtml, Doc* doc, request_rec* r, device_table* spec);
-
-static int   s_jhtml_search_emoji(jhtml_t* jhtml, char* txt, char** rslt);
-
-static char* chxj_istyle_to_mode(request_rec* r, const char* s);
+#include "chxj_str_util.h"
+
+
+#define GET_JHTML(X) ((jhtml_t *)(X))
+#undef W_L
+#undef W_V
+#define W_L(X)          do { jhtml->out = BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, (X)); } while(0)
+#define W_V(X)          do { jhtml->out = (X) ? BUFFERED_WRITE_VALUE(jhtml->out, &doc->buf, (X))  \
+                                              : BUFFERED_WRITE_LITERAL(jhtml->out, &doc->buf, ""); } while(0)
+
+static char *s_jhtml_start_html_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_html_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_meta_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_meta_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_head_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_head_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_title_tag    (void *pdoc, Node *node);
+static char *s_jhtml_end_title_tag      (void *pdoc, Node *node);
+static char *s_jhtml_start_base_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_base_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_body_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_body_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_a_tag        (void *pdoc, Node *node);
+static char *s_jhtml_end_a_tag          (void *pdoc, Node *node);
+static char *s_jhtml_start_pre_tag      (void *pdoc, Node *node);
+static char *s_jhtml_end_pre_tag        (void *pdoc, Node *node);
+static char *s_jhtml_start_p_tag        (void *pdoc, Node *node);
+static char *s_jhtml_end_p_tag          (void *pdoc, Node *node);
+static char *s_jhtml_start_ul_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_ul_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_ol_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_ol_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_li_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_li_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_br_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_br_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_tr_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_tr_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_font_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_font_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_form_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_form_tag       (void *pdoc, Node *node);
+static char *s_jhtml_start_input_tag    (void *pdoc, Node *node);
+static char *s_jhtml_end_input_tag      (void *pdoc, Node *node);
+static char *s_jhtml_start_center_tag   (void *pdoc, Node *node);
+static char *s_jhtml_end_center_tag     (void *pdoc, Node *node);
+static char *s_jhtml_start_hr_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_hr_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_img_tag      (void *pdoc, Node *node);
+static char *s_jhtml_end_img_tag        (void *pdoc, Node *node);
+static char *s_jhtml_start_select_tag   (void *pdoc, Node *node);
+static char *s_jhtml_end_select_tag     (void *pdoc, Node *node);
+static char *s_jhtml_start_option_tag   (void *pdoc, Node *node);
+static char *s_jhtml_end_option_tag     (void *pdoc, Node *node);
+static char *s_jhtml_start_div_tag      (void *pdoc, Node *node);
+static char *s_jhtml_end_div_tag        (void *pdoc, Node *node);
+static char *s_jhtml_start_textarea_tag (void *pdoc, Node *node);
+static char *s_jhtml_end_textarea_tag   (void *pdoc, Node *node);
+static char *s_jhtml_start_b_tag        (void *pdoc, Node *node);
+static char *s_jhtml_end_b_tag          (void *pdoc, Node *node);
+static char *s_jhtml_chxjif_tag         (void *pdoc, Node *node); 
+static char *s_jhtml_text_tag           (void *pdoc, Node *node);
+static char *s_jhtml_start_blockquote_tag(void *pdoc, Node *node);
+static char *s_jhtml_end_blockquote_tag  (void *pdoc, Node *node);
+static char *s_jhtml_start_dir_tag      (void *pdoc, Node *node);
+static char *s_jhtml_end_dir_tag        (void *pdoc, Node *node);
+static char *s_jhtml_start_dl_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_dl_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_dt_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_dt_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_dd_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_dd_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h1_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h1_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h2_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h2_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h3_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h3_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h4_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h4_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h5_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h5_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_h6_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_h6_tag         (void *pdoc, Node *node);
+static char *s_jhtml_start_menu_tag     (void *pdoc, Node *node);
+static char *s_jhtml_end_menu_tag       (void *pdoc, Node *node);
+
+static void  s_init_jhtml(jhtml_t *jhtml, Doc *doc, request_rec *r, device_table *spec);
+
+static int   s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt);
+
+static char *chxj_istyle_to_mode(apr_pool_t *p, const char *s);
 
 
 
@@ -132,33 +159,33 @@ tag_handler jhtml_handler[] = {
   },
   /* tagH1 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h1_tag,
+    s_jhtml_end_h1_tag,
   },
   /* tagH2 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h2_tag,
+    s_jhtml_end_h2_tag,
   },
   /* tagH3 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h3_tag,
+    s_jhtml_end_h3_tag,
   },
   /* tagH4 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h4_tag,
+    s_jhtml_end_h4_tag,
   },
   /* tagH5 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h5_tag,
+    s_jhtml_end_h5_tag,
   },
   /* tagH6 */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_h6_tag,
+    s_jhtml_end_h6_tag,
   },
   /* tagHEAD */
   {
@@ -302,8 +329,8 @@ tag_handler jhtml_handler[] = {
   },
   /* tagDT */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_dt_tag,
+    s_jhtml_end_dt_tag,
   },
   /* tagLEGEND */
   {
@@ -317,20 +344,40 @@ tag_handler jhtml_handler[] = {
   },
   /* tagBLOCKQUOTE */
   {
-    NULL,
-    NULL,
+    s_jhtml_start_blockquote_tag,
+    s_jhtml_end_blockquote_tag,
   },
   /* tagDIR */
   {
+    s_jhtml_start_dir_tag,
+    s_jhtml_end_dir_tag,
+  },
+  /* tagDL */
+  {
+    s_jhtml_start_dl_tag,
+    s_jhtml_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    s_jhtml_start_dd_tag,
+    s_jhtml_end_dd_tag,
+  },
+  /* tagMENU */
+  {
+    s_jhtml_start_menu_tag,
+    s_jhtml_end_menu_tag,
+  },
+  /* tagPLAINTEXT */
+  {
     NULL,
     NULL,
   },
-  /* tagDL */
+  /* tagBLINK */
   {
     NULL,
     NULL,
   },
-  /* tagDD */
+  /* tagMARQUEE */
   {
     NULL,
     NULL,
@@ -349,17 +396,17 @@ tag_handler jhtml_handler[] = {
  */
 char*
 chxj_exchange_jhtml(
-  request_rec*        r,
-  device_table*       spec,
-  const char*         src,
+  request_rec         *r,
+  device_table        *spec,
+  const char          *src,
   apr_size_t          srclen,
-  apr_size_t*         dstlen,
-  chxjconvrule_entryentryp,
-  cookie_t*           cookie
+  apr_size_t          *dstlen,
+  chxjconvrule_entry  *entryp,
+  cookie_t            *cookie
 )
 {
-  char*     dst;
-  char*     ss;
+  char      *dst;
+  char      *ss;
   jhtml_t   jhtml;
   Doc       doc;
 
@@ -468,11 +515,11 @@ s_init_jhtml(jhtml_t* jhtml, Doc* doc, request_rec* r, device_table* spec)
  * @return When corresponding EMOJI exists, it returns it excluding 0. 
  */
 static int
-s_jhtml_search_emoji(jhtml_t* jhtml, char* txt, char** rslt)
+s_jhtml_search_emoji(jhtml_t *jhtml, char *txt, char **rslt)
 {
-  emoji_t*      ee;
-  request_rec*  r;
-  device_tablespec;
+  emoji_t       *ee;
+  request_rec   *r;
+  device_table  *spec;
   int           len;
 
   spec = jhtml->spec;
@@ -532,12 +579,12 @@ s_jhtml_search_emoji(jhtml_t* jhtml, char* txt, char** rslt)
  * @param node   [i]   The HTML tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_html_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_html_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
 
 
   jhtml  = GET_JHTML(pdoc);
@@ -548,7 +595,7 @@ s_jhtml_start_html_tag(void* pdoc, Node* UNUSED(node))
   /*--------------------------------------------------------------------------*/
   /* start HTML tag                                                           */
   /*--------------------------------------------------------------------------*/
-  WJ_L("<html>\n");
+  W_L("<html>");
 
   DBG(r, "end s_jhtml_start_html_tag()");
 
@@ -564,13 +611,13 @@ s_jhtml_start_html_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The HTML tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_html_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_html_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc = jhtml->doc;
+  jhtml_t       *jhtml = GET_JHTML(pdoc);
+  Doc           *doc = jhtml->doc;
 
-  WJ_L("</html>\n");
+  W_L("</html>");
 
   return jhtml->out;
 }
@@ -584,13 +631,13 @@ s_jhtml_end_html_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The META tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_meta_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_meta_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
-  Attr*        attr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
+  Attr         *attr;
   int          content_type_flag;
   int          refresh_flag;
 
@@ -600,20 +647,15 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
   refresh_flag      = 0;
   content_type_flag = 0;
 
-  WJ_L("<meta");
+  W_L("<meta");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name   = qs_get_attr_name(doc,attr);
-    value  = qs_get_attr_value(doc,attr);
-
+    char *name   = qs_get_attr_name(doc,attr);
+    char *value  = qs_get_attr_value(doc,attr);
     switch(*name) {
     case 'h':
     case 'H':
@@ -621,9 +663,9 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
         /*----------------------------------------------------------------------*/
         /* CHTML 2.0                                                            */
         /*----------------------------------------------------------------------*/
-        WJ_L(" http-equiv=\"");
-        WJ_V(value);
-        WJ_L("\"");
+        W_L(" http-equiv=\"");
+        W_V(value);
+        W_L("\"");
         if (STRCASEEQ('c','C',"content-type",value)) {
           content_type_flag = 1;
         }
@@ -640,17 +682,17 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
         /* CHTML 2.0                                                            */
         /*----------------------------------------------------------------------*/
         if (content_type_flag)  {
-          WJ_L(" ");
-          WJ_V(name);
-          WJ_L("=\"");
-          WJ_L("text/html; charset=Windows-31J");
-          WJ_L("\"");
+          W_L(" ");
+          W_V(name);
+          W_L("=\"");
+          W_L("text/html; charset=Windows-31J");
+          W_L("\"");
         }
         else
         if (refresh_flag) {
-          charbuf;
-          charsec;
-          charurl;
+          char *buf;
+          char *sec;
+          char *url;
   
           buf = apr_pstrdup(r->pool, value);
   
@@ -661,21 +703,21 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
             url++;
             url = chxj_encoding_parameter(r, url);
             url = chxj_add_cookie_parameter(r, url, jhtml->cookie);
-            WJ_L(" ");
-            WJ_V(name);
-            WJ_L("=\"");
-            WJ_V(sec);
-            WJ_L(";");
-            WJ_V(url);
-            WJ_L("\"");
+            W_L(" ");
+            W_V(name);
+            W_L("=\"");
+            W_V(sec);
+            W_L(";");
+            W_V(url);
+            W_L("\"");
           }
         }
         else {
-          WJ_L(" ");
-          WJ_V(name);
-          WJ_L("=\"");
-          WJ_V(value);
-          WJ_L("\"");
+          W_L(" ");
+          W_V(name);
+          W_L("=\"");
+          W_V(value);
+          W_L("\"");
         }
       }
       break;
@@ -684,7 +726,7 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
       break;
     }
   }
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -697,12 +739,10 @@ s_jhtml_start_meta_tag(void* pdoc, Node* node)
  * @param node   [i]   The META tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_meta_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_meta_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t* jhtml;
-
-  jhtml = GET_JHTML(pdoc);
+  jhtml_t *jhtml = GET_JHTML(pdoc);
 
   return jhtml->out;
 }
@@ -716,18 +756,18 @@ s_jhtml_end_meta_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The HEAD tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_head_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_head_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<head>\r\n");
+  W_L("<head>");
   return jhtml->out;
 }
 
@@ -740,18 +780,18 @@ s_jhtml_start_head_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The HEAD tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_head_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_head_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</head>\r\n");
+  W_L("</head>");
   return jhtml->out;
 }
 
@@ -764,18 +804,18 @@ s_jhtml_end_head_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The TITLE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_title_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<title>");
+  W_L("<title>");
   return jhtml->out;
 }
 
@@ -788,18 +828,18 @@ s_jhtml_start_title_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The TITLE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_title_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_title_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</title>\r\n");
+  W_L("</title>");
   return jhtml->out;
 }
 
@@ -812,39 +852,34 @@ s_jhtml_end_title_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The BASE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_base_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_base_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*      jhtml;
-  Attr*         attr;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Attr          *attr;
+  Doc           *doc;
+  request_rec   *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<base");
+  W_L("<base");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name  = qs_get_attr_name(doc,attr);
-    value = qs_get_attr_value(doc,attr);
-
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('h','H',"href",name)) {
-      WJ_L(" href=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" href=\"");
+      W_V(value);
+      W_L("\"");
     }
   }
-  WJ_L(" >\r\n");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -857,13 +892,10 @@ s_jhtml_start_base_tag(void* pdoc, Node* node)
  * @param node   [i]   The BASE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_base_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_base_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t* jhtml;
-
-  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -876,55 +908,50 @@ s_jhtml_end_base_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The BODY tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_body_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_body_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
-  Attr*        attr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
+  Attr         *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<body");
+  W_L("<body");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name   = qs_get_attr_name(doc,attr);
-    value  = qs_get_attr_value(doc,attr);
-
-    if (STRCASEEQ('b','B',"bgcolor",name)) {
+    char *name   = qs_get_attr_name(doc,attr);
+    char *value  = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('b','B',"bgcolor",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 2.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" bgcolor=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" bgcolor=\"");
+      W_V(value);
+      W_L("\"");
     }
-    else if (STRCASEEQ('t','T',"text",name)) {
+    else if (STRCASEEQ('t','T',"text",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 2.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" text=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" text=\"");
+      W_V(value);
+      W_L("\"");
     }
-    else if (STRCASEEQ('l','L',"link",name)) {
+    else if (STRCASEEQ('l','L',"link",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 2.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" link=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" link=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('a','A',"alink",name)) {
       /*----------------------------------------------------------------------*/
@@ -932,14 +959,16 @@ s_jhtml_start_body_tag(void* pdoc, Node* node)
       /*----------------------------------------------------------------------*/
       /* ignore */
     }
-    else if (STRCASEEQ('v','V',"vlink",name)) {
+    else if (STRCASEEQ('v','V',"vlink",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 4.0                                                            */
       /*----------------------------------------------------------------------*/
-      /* ignore */
+      W_L(" vlink=\"");
+      W_V(value);
+      W_L("\"");
     }
   }
-  WJ_L(">\r\n");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -952,18 +981,18 @@ s_jhtml_start_body_tag(void* pdoc, Node* node)
  * @param node   [i]   The BODY tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_body_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_body_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</body>\r\n");
+  W_L("</body>");
   return jhtml->out;
 }
 
@@ -976,39 +1005,34 @@ s_jhtml_end_body_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The A tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_a_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_a_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
-  Attr*         attr;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<a");
+  W_L("<a");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr; 
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name  = qs_get_attr_name(doc,attr);
-    value = qs_get_attr_value(doc,attr);
-
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('n','N',"name",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML1.0                                                             */
       /*----------------------------------------------------------------------*/
-      WJ_L(" name=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" name=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('h','H',"href",name)) {
       /*----------------------------------------------------------------------*/
@@ -1016,25 +1040,25 @@ s_jhtml_start_a_tag(void* pdoc, Node* node)
       /*----------------------------------------------------------------------*/
       value = chxj_encoding_parameter(r, value);
       value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
-      WJ_L(" href=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" href=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('a','A',"accesskey",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML1.0                                                             */
       /*----------------------------------------------------------------------*/
-      WJ_L(" accesskey=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" accesskey=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('c','C',"cti",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 2.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" cti=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" cti=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('i','I',"ijam",name)) {
       /*----------------------------------------------------------------------*/
@@ -1047,7 +1071,7 @@ s_jhtml_start_a_tag(void* pdoc, Node* node)
       /* CHTML 3.0                                                            */
       /* It is special only for CHTML.                                        */
       /*----------------------------------------------------------------------*/
-      WJ_L(" utn ");
+      W_L(" utn ");
     }
     else if (STRCASEEQ('t','T',"telbook",name)) {
       /*----------------------------------------------------------------------*/
@@ -1092,7 +1116,7 @@ s_jhtml_start_a_tag(void* pdoc, Node* node)
       /* ignore */
     }
   }
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1105,18 +1129,18 @@ s_jhtml_start_a_tag(void* pdoc, Node* node)
  * @param node   [i]   The A tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_a_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_a_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</a>");
+  W_L("</a>");
   return jhtml->out;
 }
 
@@ -1129,18 +1153,36 @@ s_jhtml_end_a_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The BR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_br_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_br_tag(void *pdoc, Node *node)
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_rec* r;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
+  Attr         *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<br>\r\n");
+  W_L("<br");
+  /*--------------------------------------------------------------------------*/
+  /* Get Attributes                                                           */
+  /*--------------------------------------------------------------------------*/
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('c','C',"clear",name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('a','A',"all",value))) {
+        W_L(" clear=\"");
+        W_V(value);
+        W_L("\"");
+      }
+    }
+  }
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1153,13 +1195,10 @@ s_jhtml_start_br_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The BR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_br_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_br_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*  jhtml;
-
-  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -1172,18 +1211,18 @@ s_jhtml_end_br_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The TR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_tr_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_tr_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<br>\r\n");
+  W_L("<br>\r\n");
   return jhtml->out;
 }
 
@@ -1196,13 +1235,10 @@ s_jhtml_start_tr_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The TR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_tr_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_tr_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t* jhtml;
-
-  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -1215,36 +1251,31 @@ s_jhtml_end_tr_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The FONT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_font_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_font_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
-  Attr*         attr;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<font");
+  W_L("<font");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr; 
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name  = qs_get_attr_name(doc,attr);
-    value = qs_get_attr_value(doc,attr);
-
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('c','C',"color",name)) {
-      WJ_L(" color=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" color=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('s','S',"size",name)) {
       /*----------------------------------------------------------------------*/
@@ -1253,8 +1284,7 @@ s_jhtml_start_font_tag(void* pdoc, Node* node)
       /* ignore */
     }
   }
-
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1267,18 +1297,18 @@ s_jhtml_start_font_tag(void* pdoc, Node* node)
  * @param node   [i]   The FONT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_font_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_font_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*     jhtml;
-  request_recr;
+  jhtml_t      *jhtml;
+  request_rec  *r;
   Doc          *doc;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = jhtml->doc->r;
 
-  WJ_L("</font>");
+  W_L("</font>");
   return jhtml->out;
 }
 
@@ -1291,66 +1321,74 @@ s_jhtml_end_font_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The FORM tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_form_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_form_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_rec* r;
-  Attr*        attr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
+  Attr         *attr;
+  int          dcflag = 0;
+  char         *dc = NULL;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<form");
+  W_L("<form");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* name;
-    char* value;
-
-    name  = qs_get_attr_name(doc,attr);
-    value = qs_get_attr_value(doc,attr);
-
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('a','A',"action",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" action=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" action=\"");
+      W_V(value);
+      W_L("\"");
+      dc = chxj_add_cookie_parameter(r, value, jhtml->cookie);
+      if (strcmp(dc, value)) {
+        dcflag = 1;
+      } 
     }
     else if (STRCASEEQ('m','M',"method",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" method=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" method=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('u','U',"utn",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 3.0                                                            */
       /* It is special only for CHTML.                                        */
       /*----------------------------------------------------------------------*/
-      WJ_L(" utn ");
+      /* ignore */
     }
   }
-  WJ_L(">");
-
-  if (jhtml->cookie && jhtml->cookie->cookie_id) {
+  W_L(">");
+  /*-------------------------------------------------------------------------*/
+  /* ``action=""''                                                           */
+  /*-------------------------------------------------------------------------*/
+  if (! dc) {
+    dcflag = 1;
+  }
+  /*-------------------------------------------------------------------------*/
+  /* Add cookie parameter                                                    */
+  /*-------------------------------------------------------------------------*/
+  if (jhtml->cookie && jhtml->cookie->cookie_id && dcflag == 1) {
     char *vv = apr_psprintf(doc->buf.pool, "%s<input type='hidden' name='%s' value='%s'>",
                             jhtml->out, 
                             CHXJ_COOKIE_PARAM,
                             chxj_url_decode(r, jhtml->cookie->cookie_id));
-    WJ_V(vv);
+    W_V(vv);
   }
-
   return jhtml->out;
 }
 
@@ -1363,13 +1401,12 @@ s_jhtml_start_form_tag(void* pdoc, Node* node)
  * @param node   [i]   The FORM tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_form_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_form_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*     jhtml = GET_JHTML(pdoc);
-  Doc*         doc   = jhtml->doc;
-
-  WJ_L("</form>");
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  W_L("</form>");
   return jhtml->out;
 }
 
@@ -1382,20 +1419,20 @@ s_jhtml_end_form_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The INPUT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_input_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_input_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
-  char*         max_length;
-  char*         type;
-  char*         name;
-  char*         value;
-  char*         istyle;
-  char*         size;
-  char*         checked;
-  char*         accesskey;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  char          *max_length;
+  char          *type;
+  char          *name;
+  char          *value;
+  char          *istyle;
+  char          *size;
+  char          *checked;
+  char          *accesskey;
 
   jhtml       = GET_JHTML(pdoc);
   doc         = jhtml->doc;
@@ -1409,7 +1446,7 @@ s_jhtml_start_input_tag(void* pdoc, Node* node)
   checked     = NULL;
   accesskey   = NULL;
 
-  WJ_L("<input");
+  W_L("<input");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
@@ -1423,64 +1460,74 @@ s_jhtml_start_input_tag(void* pdoc, Node* node)
   size       = qs_get_size_attr(doc, node, r);
 
   if (type) {
-    WJ_L(" type=\"");
-    WJ_V(type);
-    WJ_L("\" ");
+    if (type && (STRCASEEQ('t','T',"text",    type) ||
+                 STRCASEEQ('p','P',"password",type) ||
+                 STRCASEEQ('c','C',"checkbox",type) ||
+                 STRCASEEQ('r','R',"radio",   type) ||
+                 STRCASEEQ('h','H',"hidden",  type) ||
+                 STRCASEEQ('s','S',"submit",  type) ||
+                 STRCASEEQ('r','R',"reset",   type))) {
+      W_L(" type=\"");
+      W_V(type);
+      W_L("\"");
+    }
   }
-  if (size) {
-    WJ_L(" size=\"");
-    WJ_V(size);
-    WJ_L("\" ");
+  if (size && *size) {
+    W_L(" size=\"");
+    W_V(size);
+    W_L("\"");
   }
-  if (name) {
-    WJ_L(" name=\"");
-    WJ_V(name);
-    WJ_L("\" ");
+  if (name && *name) {
+    W_L(" name=\"");
+    W_V(name);
+    W_L("\"");
   }
-  if (value) {
-    WJ_L(" value=\"");
-    WJ_V(value);
-    WJ_L("\" ");
+  if (value && *value) {
+    W_L(" value=\"");
+    W_V(value);
+    W_L("\"");
   }
-  if (accesskey) {
-    WJ_L(" accesskey=\"");
-    WJ_V(accesskey);
-    WJ_L("\" ");
+  if (accesskey && *accesskey) {
+    W_L(" accesskey=\"");
+    W_V(accesskey);
+    W_L("\"");
   }
-  if (istyle) {
+  if (istyle && (*istyle == '1' || *istyle == '2' || *istyle == '3' || *istyle == '4')) {
     /*------------------------------------------------------------------------*/
     /* CHTML 2.0                                                              */
     /*------------------------------------------------------------------------*/
-    if (STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
-      WJ_L(" mode=\"");
-      WJ_L("numeric");
-      WJ_L("\" ");
+    if (type && STRCASEEQ('p','P',"password", type) && ! jhtml->entryp->pc_flag ) {
+      W_L(" mode=\"");
+      W_L("numeric");
+      W_L("\"");
     }
     else {
-      char *vv = chxj_istyle_to_mode(r,istyle);
-      WJ_L(" mode=\"");
-      WJ_V(vv);
-      WJ_L("\" ");
+      char *vv = chxj_istyle_to_mode(doc->buf.pool,istyle);
+      W_L(" mode=\"");
+      W_V(vv);
+      W_L("\"");
     }
   }
-  else if (istyle == NULL && type != NULL && STRCASEEQ('p','P',"password",type)) {
-    WJ_L(" mode=\"");
-    WJ_L("numeric");
-    WJ_L("\" ");
+  else if (type && STRCASEEQ('p','P',"password",type)) {
+    W_L(" mode=\"");
+    W_L("numeric");
+    W_L("\"");
   }
   /*--------------------------------------------------------------------------*/
   /* The figure is default for the password.                                  */
   /*--------------------------------------------------------------------------*/
-  if (max_length) {
-    WJ_L(" maxlength=\"");
-    WJ_V(max_length);
-    WJ_L("\"");
+  if (max_length && *max_length) {
+    if (chxj_chk_numeric(max_length) == 0) {
+      W_L(" maxlength=\"");
+      W_V(max_length);
+      W_L("\"");
+    }
   }
 
   if (checked) {
-    WJ_L(" checked ");
+    W_L(" checked");
   }
-  WJ_L(" >");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1493,11 +1540,10 @@ s_jhtml_start_input_tag(void* pdoc, Node* node)
  * @param node   [i]   The INPUT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_input_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_input_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -1510,13 +1556,12 @@ s_jhtml_end_input_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The CENTER tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_center_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_center_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
-
-  WJ_L("<center>");
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  W_L("<center>");
   return jhtml->out;
 }
 
@@ -1529,18 +1574,18 @@ s_jhtml_start_center_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The CENTER tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_center_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_center_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t     *jhtml;
+  Doc         *doc;
+  request_rec *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</center>");
+  W_L("</center>");
   return jhtml->out;
 }
 
@@ -1553,18 +1598,39 @@ s_jhtml_end_center_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The li tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_li_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_li_tag(void *pdoc, Node *node)
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<li>");
+  W_L("<li");
+  /*--------------------------------------------------------------------------*/
+  /* Get Attributes                                                           */
+  /*--------------------------------------------------------------------------*/
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char *name = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
+      W_L(" type=\"");
+      W_V(value);
+      W_L("\"");
+    }
+    else if (STRCASEEQ('v','V',"value", name) && value && *value) {
+      W_L(" value=\"");
+      W_V(value);
+      W_L("\"");
+    }
+  }
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1577,18 +1643,18 @@ s_jhtml_start_li_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The li tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_li_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_li_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t     *jhtml;
+  Doc         *doc;
+  request_rec *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</li>");
+  W_L("</li>");
   return jhtml->out;
 }
 
@@ -1601,18 +1667,39 @@ s_jhtml_end_li_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The OL tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_ol_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_ol_tag(void *pdoc, Node *node)
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t     *jhtml;
+  Doc         *doc;
+  request_rec *r;
+  Attr        *attr;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<ol>");
+  W_L("<ol");
+  /*--------------------------------------------------------------------------*/
+  /* Get Attributes                                                           */
+  /*--------------------------------------------------------------------------*/
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char *name = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('t','T',"type",name) && value && (*value == '1' || *value == 'a' || *value == 'A')) {
+      W_L(" type=\"");
+      W_V(value);
+      W_L("\"");
+    }
+    else if (STRCASEEQ('s','S',"start",name) && value && *value) {
+      W_L(" start=\"");
+      W_V(value);
+      W_L("\"");
+    }
+  }
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1625,18 +1712,18 @@ s_jhtml_start_ol_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The OL tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_ol_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_ol_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t     *jhtml;
+  Doc         *doc;
+  request_rec *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</ol>");
+  W_L("</ol>");
   return jhtml->out;
 }
 
@@ -1649,18 +1736,18 @@ s_jhtml_end_ol_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The P tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_p_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_p_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml;
-  Doc*          doc;
-  request_rec*  r;
+  jhtml_t     *jhtml;
+  Doc         *doc;
+  request_rec *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<p>");
+  W_L("<p>");
   return jhtml->out;
 }
 
@@ -1673,13 +1760,13 @@ s_jhtml_start_p_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The P tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_p_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_p_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
+  jhtml_t   *jhtml = GET_JHTML(pdoc);
+  Doc       *doc   = jhtml->doc;
 
-  WJ_L("</p>");
+  W_L("</p>");
   return jhtml->out;
 }
 
@@ -1692,14 +1779,14 @@ s_jhtml_end_p_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The PRE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_pre_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_pre_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
+  jhtml_t  *jhtml = GET_JHTML(pdoc);
+  Doc      *doc   = jhtml->doc;
 
   jhtml->pre_flag++;
-  WJ_L("<pre>");
+  W_L("<pre>");
   return jhtml->out;
 }
 
@@ -1712,13 +1799,13 @@ s_jhtml_start_pre_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The PRE tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_pre_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_pre_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
 
-  WJ_L("</pre>");
+  W_L("</pre>");
   jhtml->pre_flag--;
 
   return jhtml->out;
@@ -1733,13 +1820,13 @@ s_jhtml_end_pre_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The UL tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_ul_tag(void* pdoc, Node* UNUSED(node)) 
+static char *
+s_jhtml_start_ul_tag(void *pdoc, Node *UNUSED(node)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
 
-  WJ_L("<ul>");
+  W_L("<ul>");
   return jhtml->out;
 }
 
@@ -1752,13 +1839,13 @@ s_jhtml_start_ul_tag(void* pdoc, Node* UNUSED(node))
  * @param node   [i]   The UL tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_ul_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_ul_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
 
-  WJ_L("</ul>");
+  W_L("</ul>");
   return jhtml->out;
 }
 
@@ -1771,57 +1858,61 @@ s_jhtml_end_ul_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The HR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_hr_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_hr_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*     jhtml = GET_JHTML(pdoc);
-  Doc*         doc   = jhtml->doc;
-  Attr*        attr;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  Attr    *attr;
 
-  WJ_L("<hr ");
+  W_L("<hr");
   for (attr = qs_get_attr(doc,node);
        attr; 
        attr = qs_get_next_attr(doc,attr)) {
-    charname = qs_get_attr_name(doc,attr);
-    charvalue = qs_get_attr_value(doc,attr);
+    char *name = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('a','A',"align",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" align=\"");
-      WJ_V(value);
-      WJ_L("\" ");
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        W_L(" align=\"");
+        W_V(value);
+        W_L("\"");
+      }
     }
-    else if (STRCASEEQ('s','S',"size",name)) {
+    else if (STRCASEEQ('s','S',"size",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" size=\"");
-      WJ_V(value);
-      WJ_L("\" ");
+      W_L(" size=\"");
+      W_V(value);
+      W_L("\"");
     }
-    else if (STRCASEEQ('w','W',"width",name)) {
+    else if (STRCASEEQ('w','W',"width",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" width=\"");
-      WJ_V(value);
-      WJ_L("\" ");
+      W_L(" width=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('n','N',"noshade",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" noshade ");
+      W_L(" noshade");
     }
-    else if (STRCASEEQ('c','C',"color",name)) {
+    else if (STRCASEEQ('c','C',"color",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 4.0                                                            */
       /*----------------------------------------------------------------------*/
-      /* ignore */
+      W_L(" color=\"");
+      W_V(value);
+      W_L("\"");
     }
   }
-  WJ_L(" >");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1834,11 +1925,10 @@ s_jhtml_start_hr_tag(void* pdoc, Node* node)
  * @param node   [i]   The HR tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_hr_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_hr_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t* jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -1851,27 +1941,26 @@ s_jhtml_end_hr_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The IMG tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_img_tag(void* pdoc, Node* node) 
+static char *
+s_jhtml_start_img_tag(void *pdoc, Node *node) 
 {
-  jhtml_t*      jhtml = GET_JHTML(pdoc);
-  Doc*          doc   = jhtml->doc;
-  request_rec*  r     = doc->r;
-  Attr*         attr;
+  jhtml_t       *jhtml = GET_JHTML(pdoc);
+  Doc           *doc   = jhtml->doc;
+  request_rec   *r     = doc->r;
+  Attr          *attr;
 #ifndef IMG_NOT_CONVERT_FILENAME
-  device_tablespec = jhtml->spec;
+  device_table  *spec = jhtml->spec;
 #endif
 
-  WJ_L("<img");
+  W_L("<img");
   /*--------------------------------------------------------------------------*/
   /* Get Attributes                                                           */
   /*--------------------------------------------------------------------------*/
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-    char* name  = qs_get_attr_name(doc,attr);
-    char* value = qs_get_attr_value(doc,attr);
-
+    char *name  = qs_get_attr_name(doc,attr);
+    char *value = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('s','S',"src",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
@@ -1886,9 +1975,9 @@ s_jhtml_start_img_tag(void* pdoc, Node* node)
                              (strchr(value, '?')) ? '&' : '?',
                              CHXJ_COOKIE_NOUPDATE_PARAM);
       }
-      WJ_L(" src=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" src=\"");
+      W_V(value);
+      W_L("\"");
 #else
       value = chxj_img_conv(r, spec, value);
       value = chxj_encoding_parameter(r, value);
@@ -1900,67 +1989,63 @@ s_jhtml_start_img_tag(void* pdoc, Node* node)
                              (strchr(value, '?')) ? '&' : '?',
                              CHXJ_COOKIE_NOUPDATE_PARAM);
       }
-      WJ_L(" src=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" src=\"");
+      W_V(value);
+      W_L("\"");
 #endif
     }
     else if (STRCASEEQ('a','A',"align",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" align=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      if (value && (STRCASEEQ('t','T',"top",   value) ||
+                    STRCASEEQ('m','M',"middle",value) ||
+                    STRCASEEQ('b','B',"bottom",value) ||
+                    STRCASEEQ('l','L',"left",  value) ||
+                    STRCASEEQ('r','R',"right", value))) {
+        W_L(" align=\"");
+        W_V(value);
+        W_L("\"");
+      }
     }
-    else if (STRCASEEQ('w','W',"width",name)) {
+    else if (STRCASEEQ('w','W',"width",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" width=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" width=\"");
+      W_V(value);
+      W_L("\"");
     }
-    else if (STRCASEEQ('h','H',"height",name)) {
+    else if (STRCASEEQ('h','H',"height",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" height=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" height=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('h','H',"hspace",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" hspace=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      /* ignore */
     }
     else if (STRCASEEQ('v','V',"vspace",name)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" vspace=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      /* ignore */
     }
-    else if (STRCASEEQ('a','A',"alt",name)) {
+    else if (STRCASEEQ('a','A',"alt",name) && value && *value) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0                                                            */
       /*----------------------------------------------------------------------*/
-      WJ_L(" alt=\"");
-      WJ_V(value);
-      WJ_L("\"");
-    }
-    else if (STRCASEEQ('a','A',"align",name)) {
-      /*----------------------------------------------------------------------*/
-      /* CHTML 4.0                                                            */
-      /*----------------------------------------------------------------------*/
-      /* ignore */
+      W_L(" alt=\"");
+      W_V(value);
+      W_L("\"");
     }
   }
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -1973,11 +2058,10 @@ s_jhtml_start_img_tag(void* pdoc, Node* node)
  * @param node   [i]   The IMG tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_img_tag(void* pdoc, Node* UNUSED(child)) 
+static char *
+s_jhtml_end_img_tag(void *pdoc, Node *UNUSED(child)) 
 {
-  jhtml_t*  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   return jhtml->out;
 }
 
@@ -1990,23 +2074,22 @@ s_jhtml_end_img_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The SELECT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_select_tag(void* pdoc, Node* child)
+static char *
+s_jhtml_start_select_tag(void *pdoc, Node *child)
 {
-  jhtml_t*     jhtml = GET_JHTML(pdoc);
-  Doc*         doc   = jhtml->doc;
-  Attr*        attr;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  Attr    *attr;
 
-  charsize      = NULL;
-  charname      = NULL;
+  char *size      = NULL;
+  char *name      = NULL;
 
-  WJ_L("<select");
+  W_L("<select");
   for (attr = qs_get_attr(doc,child);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-    char* nm  = qs_get_attr_name(doc,attr);
-    char* val = qs_get_attr_value(doc,attr);
-
+    char *nm  = qs_get_attr_name(doc,attr);
+    char *val = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('s','S',"size",nm)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0 version 2.0                                                */
@@ -2028,17 +2111,17 @@ s_jhtml_start_select_tag(void* pdoc, Node* child)
   }
 
   if (size) {
-    WJ_L(" size=\"");
-    WJ_V(size);
-    WJ_L("\"");
+    W_L(" size=\"");
+    W_V(size);
+    W_L("\"");
   }
 
   if (name) {
-    WJ_L(" name=\"");
-    WJ_V(name);
-    WJ_L("\"");
+    W_L(" name=\"");
+    W_V(name);
+    W_L("\"");
   }
-  WJ_L(">\n");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -2050,13 +2133,13 @@ s_jhtml_start_select_tag(void* pdoc, Node* child)
  * @param node   [i]   The SELECT tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_select_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_jhtml_end_select_tag(void *pdoc, Node *UNUSED(child))
 {
-  jhtml_t*     jhtml = GET_JHTML(pdoc);
-  Doc*         doc   = jhtml->doc;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
 
-  WJ_L("</select>\n");
+  W_L("</select>");
   return jhtml->out;
 }
 
@@ -2068,23 +2151,22 @@ s_jhtml_end_select_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The OPTION tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_option_tag(void* pdoc, Node* child)
+static char *
+s_jhtml_start_option_tag(void *pdoc, Node *child)
 {
-  jhtml_t*     jhtml = GET_JHTML(pdoc);
-  Doc*         doc   = jhtml->doc;
-  Attr*        attr;
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  Attr    *attr;
 
-  charselected   = NULL;
-  charvalue      = NULL;
+  char *selected   = NULL;
+  char *value      = NULL;
 
-  WJ_L("<option");
+  W_L("<option");
   for (attr = qs_get_attr(doc,child);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-    char* nm  = qs_get_attr_name(doc,attr);
-    char* val = qs_get_attr_value(doc,attr);
-
+    char *nm  = qs_get_attr_name(doc,attr);
+    char *val = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('s','S',"selected",nm)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0 version 2.0                                                */
@@ -2100,18 +2182,18 @@ s_jhtml_start_option_tag(void* pdoc, Node* child)
   }
 
   if (value) {
-    WJ_L(" value=\"");
-    WJ_V(value);
-    WJ_L("\"");
+    W_L(" value=\"");
+    W_V(value);
+    W_L("\"");
   }
   else {
-    WJ_L(" value=\"\"");
+    W_L(" value=\"\"");
   }
 
   if (selected) {
-    WJ_L(" selected ");
+    W_L(" selected ");
   }
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -2124,15 +2206,11 @@ s_jhtml_start_option_tag(void* pdoc, Node* child)
  * @param node   [i]   The OPTION tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_option_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_jhtml_end_option_tag(void *pdoc, Node *UNUSED(child))
 {
-  jhtml_t*  jhtml;
-
-  jhtml = GET_JHTML(pdoc);
-
+  jhtml_t *jhtml = GET_JHTML(pdoc);
   /* Don't close */
-
   return jhtml->out;
 }
 
@@ -2145,47 +2223,40 @@ s_jhtml_end_option_tag(void* pdoc, Node* UNUSED(child))
  * @param node   [i]   The DIV tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_start_div_tag(void* pdoc, Node* child)
+static char *
+s_jhtml_start_div_tag(void *pdoc, Node *child)
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_rec* r;
-  Attr*        attr;
-
-  char*        align;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
+  Attr         *attr;
+  char         *align = NULL;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  align = NULL;
-
-  WJ_L("<div");
+  W_L("<div");
   for (attr = qs_get_attr(doc,child);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
-
-    char* nm;
-    char* val;
-
-    nm  = qs_get_attr_name(doc,attr);
-    val = qs_get_attr_value(doc,attr);
-
+    char *nm  = qs_get_attr_name(doc,attr);
+    char *val = qs_get_attr_value(doc,attr);
     if (STRCASEEQ('a','A',"align",nm)) {
       /*----------------------------------------------------------------------*/
       /* CHTML 1.0 (W3C version 3.2)                                          */
       /*----------------------------------------------------------------------*/
-      align = apr_pstrdup(doc->buf.pool, val);
+      if (val && (STRCASEEQ('l','L',"left",val) || STRCASEEQ('r','R',"right",val) || STRCASEEQ('c','C',"center",val))) {
+        align = apr_pstrdup(doc->buf.pool, val);
+      }
     }
   }
-
   if (align) {
-    WJ_L(" align=\"");
-    WJ_V(align);
-    WJ_L("\"");
+    W_L(" align=\"");
+    W_V(align);
+    W_L("\"");
   }
-  WJ_L(">");
+  W_L(">");
   return jhtml->out;
 }
 
@@ -2198,53 +2269,53 @@ s_jhtml_start_div_tag(void* pdoc, Node* child)
  * @param node   [i]   The DIV tag node is specified.
  * @return The conversion result is returned.
  */
-static char*
-s_jhtml_end_div_tag(void* pdoc, Node* UNUSED(child))
+static char *
+s_jhtml_end_div_tag(void *pdoc, Node *UNUSED(child))
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  request_recr;
+  jhtml_t      *jhtml;
+  Doc          *doc;
+  request_rec  *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</div>\n");
+  W_L("</div>");
   return jhtml->out;
 }
 
 
-static char*
-chxj_istyle_to_mode(request_rec* r, const char* s)
+static char *
+chxj_istyle_to_mode(apr_pool_t *p, const char *s)
 {
-  chartmp;
+  char *tmp;
 
   if (s) {
     switch (s[0]) {
-    case '1': return apr_psprintf(r->pool, "hiragana");
-    case '2': return apr_psprintf(r->pool, "hankakukana");
-    case '3': return apr_psprintf(r->pool, "alphabet");
-    case '4': return apr_psprintf(r->pool, "numeric");
+    case '1': return apr_psprintf(p, "hiragana");
+    case '2': return apr_psprintf(p, "hankakukana");
+    case '3': return apr_psprintf(p, "alphabet");
+    case '4': return apr_psprintf(p, "numeric");
     default: 
-      tmp = apr_palloc(r->pool, 1);
+      tmp = apr_palloc(p, 1);
       tmp[0] = '\0';
-      return apr_pstrdup(r->pool, tmp);
+      return apr_pstrdup(p, tmp);
     }
   }
 
-  tmp = apr_palloc(r->pool, 1);
+  tmp = apr_palloc(p, 1);
   tmp[0] = '\0';
-  return apr_pstrdup(r->pool,tmp);
+  return apr_pstrdup(p,tmp);
 }
 
 
-static char*
-s_jhtml_chxjif_tag(void* pdoc, Node* node)
+static char *
+s_jhtml_chxjif_tag(void *pdoc, Node *node)
 {
-  jhtml_t*     jhtml;
-  Doc*         doc;
-  Node*        child;
-  request_recr;
+  jhtml_t *jhtml;
+  Doc     *doc;
+  Node    *child;
+  request_rec *r;
 
   jhtml = GET_JHTML(pdoc);
   doc   = jhtml->doc;
@@ -2253,7 +2324,7 @@ s_jhtml_chxjif_tag(void* pdoc, Node* node)
   for (child = qs_get_child_node(doc, node);
        child;
        child = qs_get_next_node(doc, child)) {
-    WJ_V(child->otext);
+    W_V(child->otext);
     s_jhtml_chxjif_tag(jhtml, child);
   }
   return NULL;
@@ -2281,7 +2352,7 @@ s_jhtml_start_textarea_tag(void* pdoc, Node* node)
   r     = doc->r;
 
   jhtml->textarea_flag++;
-  WJ_L("<textarea ");
+  W_L("<textarea ");
   for (attr = qs_get_attr(doc,node);
        attr;
        attr = qs_get_next_attr(doc,attr)) {
@@ -2293,22 +2364,22 @@ s_jhtml_start_textarea_tag(void* pdoc, Node* node)
     value = qs_get_attr_value(doc,attr);
 
     if (STRCASEEQ('n','N',"name",name)) {
-      WJ_L(" name=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" name=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('r','R',"rows",name)) {
-      WJ_L(" rows=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" rows=\"");
+      W_V(value);
+      W_L("\"");
     }
     else if (STRCASEEQ('c','C',"cols",name)) {
-      WJ_L(" cols=\"");
-      WJ_V(value);
-      WJ_L("\"");
+      W_L(" cols=\"");
+      W_V(value);
+      W_L("\"");
     }
   }
-  WJ_L(">\r\n");
+  W_L(">\r\n");
   return jhtml->out;
 }
 
@@ -2332,7 +2403,7 @@ s_jhtml_end_textarea_tag(void* pdoc, Node* UNUSED(child))
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("</textarea>\r\n");
+  W_L("</textarea>\r\n");
   jhtml->textarea_flag--;
 
   return jhtml->out;
@@ -2358,7 +2429,7 @@ s_jhtml_start_b_tag(void* pdoc, Node* UNUSED(node))
   doc   = jhtml->doc;
   r     = doc->r;
 
-  WJ_L("<b>");
+  W_L("<b>");
   return jhtml->out;
 }
 
@@ -2377,7 +2448,7 @@ s_jhtml_end_b_tag(void* pdoc, Node* UNUSED(child))
   jhtml_t*      jhtml = GET_JHTML(pdoc);
   Doc*          doc   = jhtml->doc;
 
-  WJ_L("</b>\r\n");
+  W_L("</b>\r\n");
   return jhtml->out;
 }
 
@@ -2443,7 +2514,651 @@ s_jhtml_text_tag(void* pdoc, Node* child)
       }
     }
   }
-  WJ_V(tdst);
+  W_V(tdst);
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the BLOCKQUOTE tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The BLOCKQUOTE tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_blockquote_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  W_L("<blockquote>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the BLOCKQUOTE tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The BLOCKQUOTE tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_blockquote_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  W_L("</blockquote>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DIR tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DIR tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_dir_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc *doc = jhtml->doc;
+  W_L("<dir>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DIR tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DIR tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_dir_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc *doc = jhtml->doc;
+  W_L("</dir>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DL tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc *doc = jhtml->doc;
+  W_L("<dl>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DL tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc *doc = jhtml->doc;
+  W_L("</dl>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_dt_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc   = jhtml->doc;
+  W_L("<dt>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DT tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_dt_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DD tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DD tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_dd_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc *doc = jhtml->doc;
+  W_L("<dd>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DD tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The DD tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_dd_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H1 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h1_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h1_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H1 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h1_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h1_align_flag) {
+    jhtml->h1_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H2 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h2_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h2_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H2 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h2_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h2_align_flag) {
+    jhtml->h2_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H3 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h3_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h3_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H3 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h3_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h3_align_flag) {
+    jhtml->h3_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H4 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h4_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h4_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H4 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h4_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h4_align_flag) {
+    jhtml->h4_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H5 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h5_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h5_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H5 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h5_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h5_align_flag) {
+    jhtml->h5_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H6 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_h6_tag(void *pdoc, Node *node)
+{
+  jhtml_t       *jhtml;
+  Doc           *doc;
+  request_rec   *r;
+  Attr          *attr;
+  char          *align = NULL;
+
+  jhtml   = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+
+  for (attr = qs_get_attr(doc,node);
+       attr;
+       attr = qs_get_next_attr(doc,attr)) {
+    char* name;
+    char* value;
+    name  = qs_get_attr_name(doc,attr);
+    value = qs_get_attr_value(doc,attr);
+    if (STRCASEEQ('a','A',"align", name)) {
+      if (value && (STRCASEEQ('l','L',"left",value) || STRCASEEQ('r','R',"right",value) || STRCASEEQ('c','C',"center",value))) {
+        jhtml->h6_align_flag++;
+        align = apr_pstrdup(doc->buf.pool, value);
+        break;
+      }
+    }
+  }
+  if (align) {
+    W_L("<div align=\"");
+    W_V(align);
+    W_L("\">");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the H6 tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The H1 tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_h6_tag(void *pdoc, Node *UNUSED(child)) 
+{
+  jhtml_t*    jhtml;
+  Doc*          doc;
+  request_rec*  r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc     = jhtml->doc;
+  r       = doc->r;
+  
+  if (jhtml->h6_align_flag) {
+    jhtml->h6_align_flag--;
+    W_L("</div>");
+  }
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the MENU tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The MENU tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_start_menu_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc = jhtml->doc;
+  W_L("<menu>");
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the MENU tag.
+ *
+ * @param pdoc  [i/o] The pointer to the JHTML structure at the output
+ *                     destination is specified.
+ * @param node   [i]   The MENU tag node is specified.
+ * @return The conversion result is returned.
+ */
+static char *
+s_jhtml_end_menu_tag(void *pdoc, Node *UNUSED(child))
+{
+  jhtml_t *jhtml = GET_JHTML(pdoc);
+  Doc     *doc = jhtml->doc;
+  W_L("</menu>");
   return jhtml->out;
 }
 /*