Browse Source

adding samples

pypackage
Volker Birk 3 years ago
parent
commit
f82be44c62
4 changed files with 34 additions and 0 deletions
  1. +1
    -0
      .hgignore
  2. +12
    -0
      samples/adresslist.yml2
  3. +6
    -0
      samples/gen.bas
  4. +15
    -0
      samples/gen_addr_sql.ysl2

+ 1
- 0
.hgignore View File

@ -1,2 +1,3 @@
syntax: glob
*.pyc
*.html

+ 12
- 0
samples/adresslist.yml2 View File

@ -0,0 +1,12 @@
list {
address {
name "Meier";
street "Uhlmannstrasse 42";
village "Laupheim";
}
address {
name "Schmidt";
street "Haupstrasse 23";
village "Bad Waldsee";
}
}

+ 6
- 0
samples/gen.bas View File

@ -0,0 +1,6 @@
110 DATA "Meier", "Uhlmannstrasse 42", "Laupheim"
120 DATA "Schmidt", "Haupstrasse 23", "Bad Waldsee"
1000 FOR I=1 TO 2 STEP 1
1010 READ NAME$, STREET$, VILLAGE$
1020 PRINT "INSERT INTO address (name, street, village) VALUES ('" + NAME$ + "', '" + STREET$ + "', '" + VILLAGE$ + "');"
1030 NEXT I

+ 15
- 0
samples/gen_addr_sql.ysl2 View File

@ -0,0 +1,15 @@
include yslt.yml2
tstylesheet {
template "/list" {
apply "address", 0;
| 1000 FOR I=1 TO 2 STEP 1
| 1010 READ NAME$, STREET$, VILLAGE$
| 1020 PRINT "INSERT INTO address (name, street, village) VALUES ('" + NAME$ + "', '" + STREET$ + "', '" + VILLAGE$ + "');"
| 1030 NEXT I
}
template "address" {
| «position() * 10 + 100» DATA "«name»", "«street»", "«village»"
}
}

Loading…
Cancel
Save