Update of /cvsroot/monetdb/sql/src/test/xml
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4905
Modified Files:
publish.sql
Log Message:
The next step is to manually construct the desired code.
Index: publish.sql
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/xml/publish.sql,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- publish.sql 20 Aug 2007 06:08:38 -0000 1.3
+++ publish.sql 20 Aug 2007 19:03:29 -0000 1.4
@@ -12,10 +12,11 @@
-- SQL/XML code snippet
--- _98 := xml.element("victim",_14);
--- _99 := xml.document(_14,"result",_98);
+-- _97 := xml.xml(_14); # coercion to xml value
+-- _98 := xml.element("victim",nil:bat,nil:bat,_97);
+-- _99 := xml.str(_98); # coercion to string for export
-- _15 := sql.resultSet(1,1,_14);
--- sql.rsColumn(_15,"sys.","result","xml",1,0,_99);
+-- sql.rsColumn(_15,"sys.","result","str",1,0,_99);
select xmlelement(name "victim",
xmlattributes(V.name, V.dob ) )
@@ -29,31 +30,58 @@
-- 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);
+-- _98 := xml.attributes(_96,_97);
+-- _99 := xml.element("victim",nil:bat,_98,nil:bat);
+-- _00 := xml.str(_99);
-- _12 := sql.resultSet(1,1,_9);
--- sql.rsColumn(_12,"sys","document","xml",0,0,_99);
+-- sql.rsColumn(_12,"sys","result","str",0,0,_00);
select xmlelement(name "victim",
xmlelement(name "name", V.name ),
xmlelement(name "birthday", V.dob ) )
from victim V;
+-- _94:= xml.xml(_8);
+-- _95:= xml.xml(_9);
+-- _96:= xml.element("name",nil:bat,nil:bat,_94);
+-- _97:= xml.element("birthday",nil:bat,nil:bat,_95);
+-- _98:= xml.element("victim",nil:bat,nil:bat, _96, _97);
+-- _99:= xml.str(_98);
+-- sql.rsColumn(_12,"sys","result","str",0,0,_99);
+
select xmlelement(name "victim",
xmlelement(name "name", V.name ),
xmlelement(name "hairtype",
(select hair from victims where name=V.name)))
from victim V;
+-- identical to previous one after evaluatoin of subquery
+-- it may produce multiple answers though
+
select xmlconcat(
xmlelement(name "name", V.name ),
xmlelement(name "birthday", V.dob ) )
from victim V;
+-- _94 := xml.xml(_8);
+-- _95 := xml.xml(_9);
+-- _96 := xml.element("name",nil:bat,nil:bat,_94);
+-- _97 := xml.element("birthday",nil:bat,nil:bat,_95);
+-- _98 := xml.concat(_96,97);
+-- _99 := xml.str(_98);
+-- sql.rsColumn(_12,"sys","result","str",0,0,_99);
+
select xmlelement(name "victims",
xmlforest( V.name, V.dob as "birthday")
)
from victim V;
+-- _94 := xml.xml(_8);
+-- _95 := xml.xml(_9);
+-- _96 := xml.trunk("birthday",_95);
+-- _97 := xml.forest(_95,96);
+-- _98 := xml.element("victims",nil:bat,nil:bat,_97);
+-- _99 := xml.str(_98);
+-- sql.rsColumn(_12,"sys","result","str",0,0,_99);
-- group by hair color
select xmlelement(name "jtr",
-------------------------------------------------------------------------
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