OSDN Git Service

* Added <dt> tag for au XHTML converter.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 13 Apr 2008 10:14:56 +0000 (10:14 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 13 Apr 2008 10:14:56 +0000 (10:14 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_11_0@2192 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/chxj_xhtml_mobile_1_0.c
test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c

index cc2c41e..4ff1948 100644 (file)
@@ -86,8 +86,8 @@ static char *s_xhtml_1_0_start_select_tag (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_select_tag   (void *pdoc, Node *node);
 static char *s_xhtml_1_0_start_option_tag (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_option_tag   (void *pdoc, Node *node);
-static char *s_xhtml_1_0_start_div_tag    (void *pdoc, Node *node);
-static char *s_xhtml_1_0_end_div_tag      (void *pdoc, Node *node);
+static char *s_xhtml_1_0_start_div_tag       (void *pdoc, Node *node);
+static char *s_xhtml_1_0_end_div_tag         (void *pdoc, Node *node);
 static char *s_xhtml_1_0_start_textarea_tag  (void *pdoc, Node *node);
 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);
@@ -99,6 +99,8 @@ static char *s_xhtml_1_0_start_dir_tag       (void *pdoc, Node *node);
 static char *s_xhtml_1_0_end_dir_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 char *s_xhtml_1_0_start_dt_tag        (void *pdoc, Node *node);
+static char *s_xhtml_1_0_end_dt_tag          (void *pdoc, Node *node);
 
 static void  s_init_xhtml(xhtml_t *xhtml, Doc *doc, request_rec *r, device_table *spec);
 static int   s_xhtml_search_emoji(xhtml_t *xhtml, char *txt, char **rslt);
@@ -318,8 +320,8 @@ tag_handler xhtml_handler[] = {
   },
   /* tagDT */
   {
-    NULL,
-    NULL,
+    s_xhtml_1_0_start_dt_tag,
+    s_xhtml_1_0_end_dt_tag,
   },
   /* tagLEGEND */
   {
@@ -2495,6 +2497,40 @@ s_xhtml_1_0_end_dl_tag(void *pdoc, Node *UNUSED(child))
   W_L("</dl>");
   return xhtml->out;
 }
+
+
+/**
+ * It is a handter who processes the DT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML 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_xhtml_1_0_start_dt_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t *xhtml = GET_XHTML(pdoc);
+  Doc     *doc   = xhtml->doc;
+  W_L("<dt>");
+  return xhtml->out;
+}
+
+
+/**
+ * It is a handter who processes the DT tag.
+ *
+ * @param pdoc  [i/o] The pointer to the XHTML 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_xhtml_1_0_end_dt_tag(void *pdoc, Node *UNUSED(child))
+{
+  xhtml_t *xhtml = GET_XHTML(pdoc);
+  return xhtml->out;
+}
 /*
  * vim:ts=2 et
  */
index 30dcd83..77e95cb 100644 (file)
@@ -513,8 +513,9 @@ main()
   CU_add_test(xhtml_suite, "test <dir> with no <li>.",                          test_xhtml_dir_tag_002);
 
   CU_add_test(xhtml_suite, "test <dl>.",                                        test_xhtml_dl_tag_001);
-#if 0
+
   CU_add_test(xhtml_suite, "test <dt>.",                                        test_xhtml_dt_tag_001);
+#if 0
   CU_add_test(xhtml_suite, "test <dt> with void value.",                        test_xhtml_dt_tag_002);
 
   CU_add_test(xhtml_suite, "test <dd>.",                                        test_xhtml_dd_tag_001);
@@ -2430,6 +2431,7 @@ void test_xhtml_dl_tag_001()
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);