Update of /cvsroot/monetdb/pathfinder/compiler/xmlimport
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14645/compiler/xmlimport

Modified Files:
      Tag: PF_ROX
        xml2lalg.c xml2lalg_converters.c 
Log Message:
propagated changes of Friday 15 Feb 2008 - Monday Feb 18 2008
from the development trunk to the PF_ROX branch


Index: xml2lalg.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg.c,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -u -d -r1.11.2.1 -r1.11.2.2
--- xml2lalg.c  9 Feb 2008 08:40:39 -0000       1.11.2.1
+++ xml2lalg.c  18 Feb 2008 16:57:51 -0000      1.11.2.2
@@ -199,6 +199,15 @@
                     PFxml2la_xpath_getNthNode(XPATH(xpath), 0)))
 
 /**              
+ * Macro return-type:  PFalg_node_kind_t 
+ * XPath return-type:  attribute(){1}
+ */
+#define PFLA_NODEKIND(xpath) \
+            PFxml2la_conv_2PFLA_nodekind( \
+                PFxml2la_xpath_getAttributeValueFromAttributeNode( \
+                    PFxml2la_xpath_getNthNode(XPATH(xpath), 0)))
+
+/**              
  * Macro return-type:  PFalg_simple_type_t 
  * XPath return-type:  attribute(){1}
  */
@@ -1453,16 +1462,19 @@
                <column name="COLNAME" function="item"/>
             </content>
             */
+            PFalg_step_spec_t spec;
+            spec.axis = PFLA_AXIS("/content/step/@axis");
+            spec.kind = PFLA_NODEKIND("/content/step/@kind");
+            spec.qname = PFqname (
+                             (PFns_t)
+                             { .prefix = A2STR_O("/content/step/@prefix", 
NULL),
+                               .uri    = A2STR_O("/content/step/@uri", NULL) },
+                             A2STR_O("/content/step/@name", NULL));
 
             newAlgNode = PFla_step
              (
              CHILDNODE(0), CHILDNODE(1), 
-             PFLA_AXIS("/content/step/@axis"), 
-             getPFLA_SeqTy (
-                 A2STR("/content/step/@kind"),
-                 A2STR_O("/content/step/@prefix", NULL),
-                 A2STR_O("/content/step/@uri", NULL),
-                 A2STR_O("/content/step/@name", NULL)),
+             spec,
              A2INT_O("/content/step/@level", -1), 
              PFLA_ATT("/content/[EMAIL PROTECTED]'iter']/@name"), 
              PFLA_ATT("/content/[EMAIL PROTECTED]'item']/@name"), 
@@ -1486,16 +1498,19 @@
                <column name="COLNAME" function="item"/>
              </content>
             */
+            PFalg_step_spec_t spec;
+            spec.axis = PFLA_AXIS("/content/step/@axis");
+            spec.kind = PFLA_NODEKIND("/content/step/@kind");
+            spec.qname = PFqname (
+                             (PFns_t)
+                             { .prefix = A2STR_O("/content/step/@prefix", 
NULL),
+                               .uri    = A2STR_O("/content/step/@uri", NULL) },
+                             A2STR_O("/content/step/@name", NULL));
 
             newAlgNode = PFla_step_join
              (
              CHILDNODE(0), CHILDNODE(1), 
-             PFLA_AXIS("/content/step/@axis"), 
-             getPFLA_SeqTy (
-                 A2STR("/content/step/@kind"),
-                 A2STR_O("/content/step/@prefix", NULL),
-                 A2STR_O("/content/step/@uri", NULL),
-                 A2STR_O("/content/step/@name", NULL)),
+             spec,
              A2INT_O("/content/step/@level", -1), 
              PFLA_ATT("/content/[EMAIL PROTECTED]'item']/@name"), 
              PFLA_ATT("/content/[EMAIL PROTECTED]'true']/@name")

Index: xml2lalg_converters.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg_converters.c,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- xml2lalg_converters.c       9 Feb 2008 08:40:40 -0000       1.8.2.1
+++ xml2lalg_converters.c       18 Feb 2008 16:57:52 -0000      1.8.2.2
@@ -729,26 +729,10 @@
     {
         return aat_anode;
     }
-    else if (strcmp(typeString, "attrID") == 0)
-    {
-        return aat_attr;
-    }
-    else if (strcmp(typeString, "afrag") == 0)
-    {
-        return aat_afrag;
-    }
     else if (strcmp(typeString, "pnode") == 0)
     {
         return aat_pnode;
     }
-    else if (strcmp(typeString, "pre") == 0)
-    {
-        return aat_pre;
-    }
-    else if (strcmp(typeString, "pfrag") == 0)
-    {
-        return aat_pfrag;
-    }
     else
     {
 
@@ -816,11 +800,7 @@
         }
     case aat_node:   
     case aat_anode:   
-    case aat_attr:   
-    case aat_afrag:  
     case aat_pnode:  
-    case aat_pre:    
-    case aat_pfrag:  
     case aat_charseq:
     default:       
         {
@@ -1045,6 +1025,30 @@
 
 
/******************************************************************************/
 
/******************************************************************************/
+PFalg_node_kind_t 
+PFxml2la_conv_2PFLA_nodekind(char* s) 
+{
+         if (strcmp (s, "element") == 0)                return node_kind_elem;
+    else if (strcmp (s, "attribute") == 0)              return node_kind_attr;
+    else if (strcmp (s, "text") == 0)                   return node_kind_text;
+    else if (strcmp (s, "processing-instruction") == 0) return node_kind_pi;
+    else if (strcmp (s, "comment") == 0)                return node_kind_comm;
+    else if (strcmp (s, "document-node") == 0)          return node_kind_doc;
+    else if (strcmp (s, "node") == 0)                   return node_kind_node;
+    else
+        PFoops (OOPS_FATAL, "don't know what to do (%s)", s);
+    
+    /* pacify picky compilers */
+    return node_kind_node;
+}
+
+
+
+
+
+
+/******************************************************************************/
+/******************************************************************************/
 
 PFalg_doc_t 
 PFxml2la_conv_2PFLA_docType(char* s) 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to