Update of /cvsroot/monetdb/sql/src/test/xml
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12475

Modified Files:
        docload.sql publish.sql 
Log Message:
A few more thoughts on the code generation of SQL/XML publishing.


Index: publish.sql
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/xml/publish.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- publish.sql 18 Aug 2007 21:16:32 -0000      1.1
+++ publish.sql 19 Aug 2007 11:35:19 -0000      1.2
@@ -1,12 +1,37 @@
 -- The simple examples of SQL/XML publishing functions
+-- and an indication of the code to be derived from SQL
+-- assume simple string production and bottom up construction.
 
-select xmlelement(name "victim", V.name || ' ' V.dob ) as result
+select xmlelement(name "victim", V.name || ' ' || V.dob ) as result
 from victim V;
 
+-- SQL code snippet
+--    _15 := sql.resultSet(1,1,_14);
+--    sql.rsColumn(_15,"sys.","concat_concat_name","clob",1,0,_14);
+
+-- SQL/XML code snippet
+--       _98 := xml.element("victim",_14);
+--       _99 := xml.document(_14,"result",_98);
+--    _15 := sql.resultSet(1,1,_14);
+--    sql.rsColumn(_15,"sys.","result","xml",1,0,_99);
+
 select xmlelement(name "victim", 
                xmlattributes(V.name, V.dob ) )
 from victim V;
 
+-- SQL code snippet
+--    _12 := sql.resultSet(2,1,_9);
+--    sql.rsColumn(_12,"sys.v","name","clob",0,0,_9);
+--    sql.rsColumn(_12,"sys.v","dob","clob",0,0,_11);
+
+-- SQL/XML code snippet
+--       _96 := xml.attribute("name",_9);
+--       _97 := xml.attribute("dob",_11);
+--       _98 := xml.element("victim",_96,_97);
+--       _99 := xml.document(_9,"document",_98);
+--    _12 := sql.resultSet(1,1,_9);
+--    sql.rsColumn(_12,"sys","document","xml",0,0,_99);
+
 select xmlelement(name "victim", 
                xmlelement(name "name", V.name ),
                xmlelement(name "birthday", V.dob ) )
@@ -23,5 +48,24 @@
                xmlelement(name "birthday", V.dob ) )
 from victim V;
 
--- xmlforest
--- xmlagg
+select xmlelement(name "victims",
+       xmlforest( V.name, V.dob as "birthday")
+       )
+from victim V;
+
+-- group by hair color
+select xmlelement(name "jtr",
+       xmlattributes(V.hair as "hair"),
+       xmlagg( xmlelement("victim", V.name))
+       )
+from victim V;
+
+select xmlelment(name "jtr",
+               xmlforest(
+                       xmlelement(name="dossier",
+                               xmlattributes(V.hair as "hair"),
+                               xmlagg( xmlelement(name="person", V.name)),
+                       )
+                       xmlelement(name="total", (select count(*) from victim))
+               ))
+from victim V;

Index: docload.sql
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/xml/docload.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- docload.sql 18 Aug 2007 21:16:30 -0000      1.1
+++ docload.sql 19 Aug 2007 11:35:18 -0000      1.2
@@ -5,7 +5,7 @@
 
 copy into archive from 'JackTheRipper.xml';
 
-insert into archive values('JackTheRipper.xml');
+insert into archive values(XMLvalidate( document 'JackTheRipper.xml'));
 
 create table chapters( scene xml); -- to contain a tuple per scene (18)
 copy into archive from 'JackTheRipper.xml' delimiter 'scene';


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to