OSDN Git Service

* Added DL tag.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Wed, 19 Mar 2008 05:00:24 +0000 (05:00 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Wed, 19 Mar 2008 05:00:24 +0000 (05:00 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@1893 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/chxj_chtml10.c
src/chxj_chtml20.c
src/chxj_chtml30.c
src/chxj_hdml.c
src/chxj_jhtml.c
src/chxj_node_convert.c
src/chxj_xhtml_mobile_1_0.c

index ecaab92..439d4e1 100644 (file)
@@ -84,6 +84,8 @@ static char *s_chtml10_start_option_tag   (void *pdoc, Node *node);
 static char *s_chtml10_end_option_tag     (void *pdoc, Node *node);
 static char *s_chtml10_start_div_tag      (void *pdoc, Node *node);
 static char *s_chtml10_end_div_tag        (void *pdoc, Node *node);
+static char *s_chtml10_start_dl_tag      (void *pdoc, Node *node);
+static char *s_chtml10_end_dl_tag        (void *pdoc, Node *node);
 
 static void  s_init_chtml10(chtml10_t *chtml, Doc *doc, request_rec *r, device_table *spec);
 
@@ -316,6 +318,16 @@ tag_handler chtml10_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    s_chtml10_start_dl_tag,
+    s_chtml10_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
 
 
@@ -2804,6 +2816,57 @@ s_chtml10_text(void *pdoc, Node *child)
 
   return chtml10->out;
 }
+
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml10_start_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml10_t    *chtml10;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml10 = GET_CHTML10(pdoc);
+  doc     = chtml10->doc;
+  r       = doc->r;
+
+  chtml10->out = apr_pstrcat(r->pool, chtml10->out, "<dl>", NULL);
+
+  return chtml10->out;
+}
+
+
+/**
+ * It is a handler who processes the DLtag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml10_end_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml10_t    *chtml10;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml10 = GET_CHTML10(pdoc);
+  doc     = chtml10->doc;
+  r       = doc->r;
+
+  chtml10->out = apr_pstrcat(r->pool, chtml10->out, "</dl>\n", NULL);
+
+  return chtml10->out;
+}
 /*
  * vim:ts=2 et
  */
index 587d68a..e1a5a14 100644 (file)
@@ -85,6 +85,8 @@ static char *s_chtml20_start_option_tag  (void *pdoc, Node *node);
 static char *s_chtml20_end_option_tag    (void *pdoc, Node *node);
 static char *s_chtml20_start_div_tag     (void *pdoc, Node *node);
 static char *s_chtml20_end_div_tag       (void *pdoc, Node *node);
+static char *s_chtml20_start_dl_tag      (void *pdoc, Node *node);
+static char *s_chtml20_end_dl_tag        (void *pdoc, Node *node);
 
 static void  s_init_chtml20(chtml20_t *chtml, Doc *doc, request_rec *r, device_table *spec);
 
@@ -319,6 +321,16 @@ tag_handler chtml20_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    s_chtml20_start_dl_tag,
+    s_chtml20_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
 
 /**
@@ -3088,6 +3100,56 @@ s_chtml20_text_tag(void *pdoc, Node *child)
 
   return chtml20->out;
 }
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml20_start_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml20_t    *chtml20;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml20 = GET_CHTML20(pdoc);
+  doc     = chtml20->doc;
+  r       = doc->r;
+
+  chtml20->out = apr_pstrcat(r->pool, chtml20->out, "<dl>", NULL);
+
+  return chtml20->out;
+}
+
+
+/**
+ * It is a handler who processes the DLtag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml20_end_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml20_t    *chtml20;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml20 = GET_CHTML20(pdoc);
+  doc     = chtml20->doc;
+  r       = doc->r;
+
+  chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</dl>\n", NULL);
+
+  return chtml20->out;
+}
 /*
  * vim:ts=2 et
  */
index d4cfb1d..d25447a 100644 (file)
@@ -87,6 +87,8 @@ static char *s_chtml30_start_div_tag      (void *pdoc, Node *node);
 static char *s_chtml30_end_div_tag        (void *pdoc, Node *node);
 static char *s_chtml30_chxjif_tag         (void *pdoc, Node *node); 
 static char *s_chtml30_text_tag           (void *pdoc, Node *node);
+static char *s_chtml30_start_dl_tag       (void *pdoc, Node *node);
+static char *s_chtml30_end_dl_tag         (void *pdoc, Node *node);
 
 static void  s_init_chtml30(chtml30_t *chtml, Doc *doc, request_rec *r, device_table *spec);
 
@@ -316,6 +318,16 @@ tag_handler chtml30_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    s_chtml30_start_dl_tag,
+    s_chtml30_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
 
 
@@ -2779,6 +2791,56 @@ s_chtml30_text_tag(void *pdoc, Node *child)
   return chtml30->out;
 }
 
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml30_start_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml30_t    *chtml30;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml30 = GET_CHTML30(pdoc);
+  doc     = chtml30->doc;
+  r       = doc->r;
+
+  chtml30->out = apr_pstrcat(r->pool, chtml30->out, "<dl>", NULL);
+
+  return chtml30->out;
+}
+
+
+/**
+ * It is a handler who processes the DLtag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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_chtml30_end_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  chtml30_t    *chtml30;
+  Doc          *doc;
+  request_rec  *r;
+
+  chtml30 = GET_CHTML30(pdoc);
+  doc     = chtml30->doc;
+  r       = doc->r;
+
+  chtml30->out = apr_pstrcat(r->pool, chtml30->out, "</dl>\n", NULL);
+
+  return chtml30->out;
+}
+
 /*
  * vim:ts=2 et
  */
index 469411c..849b5d5 100644 (file)
@@ -317,6 +317,16 @@ tag_handler hdml_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    NULL,     /* not support */
+    NULL,     /* not support */
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
 
 /**
index 3452708..6145467 100644 (file)
@@ -76,6 +76,8 @@ 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_dl_tag       (void *pdoc, Node *node);
+static char *s_jhtml_end_dl_tag         (void *pdoc, Node *node);
 
 static void  s_init_jhtml(
   jhtml_t *jhtml,
@@ -313,6 +315,16 @@ tag_handler jhtml_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    s_jhtml_start_dl_tag,
+    s_jhtml_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
 
 
@@ -2526,6 +2538,58 @@ s_jhtml_text_tag(void *pdoc, Node *child)
 
   return jhtml->out;
 }
+
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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;
+  Doc          *doc;
+  request_rec  *r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc   = jhtml->doc;
+  r     = doc->r;
+
+
+  jhtml->out = apr_pstrcat(r->pool, jhtml->out, "<dl>", NULL);
+
+  return jhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the CHTML 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;
+  Doc          *doc;
+  request_rec  *r;
+
+  jhtml = GET_JHTML(pdoc);
+  doc   = jhtml->doc;
+  r     = doc->r;
+
+  jhtml->out = apr_pstrcat(r->pool, jhtml->out, "</dl>\n", NULL);
+
+  return jhtml->out;
+}
 /*
  * vim:ts=2 et
  */
index b64a32d..a8ae6b4 100755 (executable)
@@ -585,6 +585,45 @@ chxj_node_convert(
         if (handlers[tagDIV].end_tag_handler)
           handlers[tagDIV].end_tag_handler(pdoc, child);
       }
+      /*----------------------------------------------------------------------*/
+      /* <DL>                                                                 */
+      /*----------------------------------------------------------------------*/
+      else 
+      if (strcasecmp(name, "dl") == 0) {
+        if (handlers[tagDL].start_tag_handler) 
+          handlers[tagDL].start_tag_handler(pdoc, child);
+
+        chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+        if (handlers[tagDL].end_tag_handler)
+          handlers[tagDL].end_tag_handler(pdoc, child);
+      }
+      /*----------------------------------------------------------------------*/
+      /* <DT>                                                                 */
+      /*----------------------------------------------------------------------*/
+      else 
+      if (strcasecmp(name, "dt") == 0) {
+        if (handlers[tagDT].start_tag_handler) 
+          handlers[tagDT].start_tag_handler(pdoc, child);
+
+        chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+        if (handlers[tagDT].end_tag_handler)
+          handlers[tagDT].end_tag_handler(pdoc, child);
+      }
+      /*----------------------------------------------------------------------*/
+      /* <DD>                                                                 */
+      /*----------------------------------------------------------------------*/
+      else 
+      if (strcasecmp(name, "dd") == 0) {
+        if (handlers[tagDD].start_tag_handler) 
+          handlers[tagDD].start_tag_handler(pdoc, child);
+
+        chxj_node_convert(spec, r, pdoc, doc, child, indent+1);
+
+        if (handlers[tagDD].end_tag_handler)
+          handlers[tagDD].end_tag_handler(pdoc, child);
+      }
       break;
 
     case 'c':
index ad57c61..8d22e3e 100644 (file)
@@ -87,6 +87,8 @@ static char *s_xhtml_1_0_end_textarea_tag (void *pdoc, Node *node);
 static char *s_xhtml_1_0_start_b_tag      (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_b_tag        (void *pdoc, Node *node);
 static char *s_xhtml_1_0_chxjif_tag       (void *pdoc, Node *node);
+static char *s_xhtml_1_0_start_dl_tag     (void *pdoc, Node *node);
+static char *s_xhtml_1_0_end_dl_tag       (void *pdoc, Node *node);
 
 static void  s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
 static char* s_xhtml_1_0_text_tag(void *pdoc, Node *child);
@@ -318,6 +320,16 @@ tag_handler xhtml_handler[] = {
     NULL,
     NULL,
   },
+  /* tagDL */
+  {
+    s_xhtml_1_0_start_dl_tag,
+    s_xhtml_1_0_end_dl_tag,
+  },
+  /* tagDD */
+  {
+    NULL,
+    NULL,
+  },
 };
  
 
@@ -2421,6 +2433,46 @@ s_xhtml_1_0_text_tag(void *pdoc, Node *child)
 
   return xhtml->out;
 }
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML 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_xhtml_1_0_start_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t      *xhtml = GET_XHTML(pdoc);
+  Doc          *doc   = xhtml->doc;
+  request_rec  *r     = doc->r;
+  xhtml->out = apr_pstrcat(r->pool, xhtml->out, "<dl>", NULL);
+  return xhtml->out;
+}
+
+
+/**
+ * It is a handler who processes the DL tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML 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_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t      *xhtml = GET_XHTML(pdoc);
+  Doc          *doc   = xhtml->doc;
+  request_rec  *r     = doc->r;
+
+  xhtml->out = apr_pstrcat(r->pool, xhtml->out, "</dl>\n", NULL);
+
+  return xhtml->out;
+}
 /*
  * vim:ts=2 et
  */