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

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


Index: xml2lalg.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg.c,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- xml2lalg.c  8 Feb 2008 22:59:20 -0000       1.10.2.2
+++ xml2lalg.c  18 Feb 2008 16:21:38 -0000      1.10.2.3
@@ -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.6.2.3
retrieving revision 1.6.2.4
diff -u -d -r1.6.2.3 -r1.6.2.4
--- xml2lalg_converters.c       16 Feb 2008 01:02:20 -0000      1.6.2.3
+++ xml2lalg_converters.c       18 Feb 2008 16:21:38 -0000      1.6.2.4
@@ -1025,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