SQL4 itself make HTTP-connection. Input data is XML-text (with so indulgence, that if xml-element has not enclosed elements, then he can have no sign slash before closing angular bracket), output data is XML-text. Client gets picture from database by its URL and separately from XML-data.
DBMS execute the following after getting of input data:
enter into DBMS | DDL | entered |
<formdata> <x data1="Larry" data2="oid_in_traffic"> </formdata> |
create table formdata ( id num primary key, sal varchar, san num4, sp num2, ral varchar, ran num4, rp num2, ru varchar, rs varchar, g varchar, su varchar ); create table x ( id num primary key, srv num references formdata, data1 varchar, data2 blob ); |
insert into formdata values (1, asker.org, 111.111.111.111, 80, distination.org, 222.222.222.222, 80, tomson, car-celler, BrowserName ); insert into x values (10, 1, Larry, file_content); |
Success of writing of xml-trees into database depends of, is scheme of database corresponds to entering tree (some xml-sub-trees are ignored at discrepancy). It's possible to provide congruence by determination in xml-tree in disputable cases. It's supposed in example below, that all primary keys have sequences, values from which are entered into these keys by default.
enter into DBMS | DDL | entered |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); insert into b values (101, 10, 23.4); insert into b values (102, 10, 34.5); insert into b values (103, 10, 45.6); -- section "b" is set |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref1 num references a(id), ref2 num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); |
<formdata> <a/ref1 data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, data float ); create table b ( id num primary key, ref1 num references a(id), ref2 num references a(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 12.3); insert into b values (101, 10, null, 23.4); insert into b values (102, 10, null, 34.5); insert into b values (103, 10, null, 45.6); |
<formdata> <a data=12.3> <b data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, 100, 12.3); insert into b values (100, 23.4); -- section "b" is relay-race |
<formdata> <a data=12.3> <b data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref1 num references b(id), ref2 num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, null, null, 12.3); |
<formdata> <a data=12.3> <b/ref1 data=23.4> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref1 num references b(id), ref2 num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, 100, null, 12.3); insert into b values (100, 23.4); |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, data float ); |
insert into formdata values (1); insert into a values (10, 1, null, 12.3); -- section "b" is not entered (all tags together!), -- because scheme of database contain -- no set and no list for it |
<formdata> <a data=12.3> <b data=23.4> <b data=34.5> <b data=45.6> </a> </formdata> |
create table a ( id num primary key, srv num references formdata, ref num references b(id), data float ); create table b ( id num primary key, ref num references b(id), data float ); |
insert into formdata values (1); insert into a values (10, 1, 101, 12.3); insert into b values (101, 102, 23.4); insert into b values (102, 103, 34.5); insert into b values (103, null, 45.6); -- section "b" is list |
It's necessary to put sign "#" before names of some tables and fields to prevent output of them.
a[data10.1].#b.c[#data] ; |
<a id=1 data=10.1> <c id=100 /> <c id=101 /> <c id=200 /> <c id=201 /> <c id=200 /> </a> |
a[data10.1].#b.c#[id] ; |
<a id=1 data=10.1> <c id=100 /> <c id=101 /> <c id=200 /> <c id=201 /> <c id=200 /> </a> |
If section is list, then it's possible to sort output of its elements (records) by increasing or decreasing of values of some fields. For this purpose, it's necessary to put integer and mark "" before names of these fields (we shall name this number as factor. Factor may not be equal to zero). Fields will be used for sorting in sequence, in which modules of their factors grow. Positive factor means sorting by increasing, negative factor - by decreasing. Thus TML-expression
a.b.c ; |
<a id=1 data=12.3> <b id=10 data=23.4> <c id=100 data=56.7/> <c id=101 data=67.8/> </b> <b id=20 data=34.5> <c id=200 data=78.9/> <c id=201 data=89.1/> </b> <b id=30 data=45.6> <c id=200 data=91.2/> </b> </a> |
a.b[-1data].c[-1data] ; |
<a id=1 data=12.3> <b id=30 data=45.6> <c id=200 data=91.2/> </b> <b id=20 data=34.5> <c id=201 data=89.1/> <c id=200 data=78.9/> </b> <b id=10 data=23.4> <c id=101 data=67.8/> <c id=100 data=56.7/> </b> </a> |
It's possible to request no all unsorted records, but only records, beginning from some certain record, about which we know values of all its fields. For this purpose, it's necessary to put mark "" before names of all fields, and sign "=" and value of field after names. Thus TML-expression
It's possible to request no all sorted records, but only records, beginning from some certain record - it's necessary to apply simultaneously sorting and starting for this. Thus TML-expression
Picture can be value of database field, but its URL is sent as value of field instead of it at TML-request for separate HTTP-request of browser. In HTML4 browser can use this attribute (field) only if its name is "src" and it is in tag (table) "IMG". In HTML5 browser can use it in attribute "src" of any tag, it last has property "display: img".
x ; |
<x id="10" data1="Larry" data2="http://distination.org/?file_id=6382503452"> |
It's possible to send any text
'<?xml-stylesheet type="text/xsl" href="a.xsl"?>' ; |
<?xml-stylesheet type="text/xsl" href="a.xsl"?> |
'text' ; |
text |
'<anytag>' ; |
<anytag> |
'</anytag>' ; |
</anytag> |
a[data10.1].b.c ; |
<a id=1 data=10.1> <b id=10 data=23.4> <c id=100 data=56.7/> <c id=101 data=67.8/> </b> <b id=20 data=34.5> <c id=200 data=78.9/> <c id=201 data=89.1/> </b> <b id=30 data=45.6> <c id=200 data=91.2/> </b> </a> |
Data is send to destination, which is specified in fields ral and ru of table sys at moment of sending. These values point to browser, sent request, at start of trigger of table 'formdata', but it's possible to change them in any moment (thus database itself can make request into other databases to create answer for browser).
If you want to duplicate a tree in a database, then send it to youself - ran=0 for that.