Annotation of parser3/src/www/htdocs/index.html, revision 1.532
1.510 paf 1: @auto[]
1.503 paf 2: $request:charset[windows-1251]
3: $response:charset[windows-1251]
1.514 paf 4: $response:content-type[$.value[text/html]$.charset[$response:charset]]
1.510 paf 5:
6: @main[]
1.532 ! paf 7: $cost_value(2500001)
! 8: ^cost_value.format{%.2f}
! 9:
1.528 paf 10:
1.521 paf 11: #^xpath[]
1.515 paf 12: #^ttablesetlang[]
1.513 paf 13: #^mail3[]
1.511 paf 14: #^ttime[]
1.506 paf 15: #^tupper[]
1.499 paf 16: #^treplace[]
1.522 paf 17: ^xslt2[]
1.507 paf 18: #^tcache2[]
1.489 paf 19: #$ORIGINS(1)
1.488 paf 20: #$t[^table::set{a b} ^table::set{c d}]
1.486 paf 21: #^ttaintuntaint[]
1.493 paf 22: #^tappend2[]
1.480 paf 23: #^badvsnprintf[]
1.479 paf 24: #^badoracequoting[]
1.477 paf 25: #^badconstructors[]
1.514 paf 26: #^xloadwrongtable[]
1.476 paf 27: #^xsetwrongtable[]
1.473 paf 28: #^if($form:test){y}{n}
1.472 paf 29: #^tablecolumnerror[]
30: #^roll[]
1.471 paf 31: #^cookie2[]
1.470 paf 32: #^tableset[]
1.469 paf 33: #^math:PI.format{%.30f}
1.462 paf 34: #^xchildren[]
35: #^thashforeach3[]
1.461 paf 36: #^thashforeach2[]
37: #^thashforeach[]
1.458 paf 38: #^thashdelete[]
1.456 paf 39: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
1.454 paf 40: #^tappend[]
1.453 paf 41: #^sappend[]
1.452 paf 42: #^eval(10\3)<br>
1.450 paf 43: #^tform[]
1.448 paf 44: #^formattest[]
1.447 paf 45: #^filelist[]
1.443 paf 46: #^connect[mysql://user:pass@host]{ }
1.431 paf 47: #^безнадёжна_попытка_поправить_непоправимое[]
1.493 paf 48: #^tcache[]
1.460 paf 49: #^thashfileexp[]
1.468 paf 50: #^tcounter[]
1.423 parser 51: #^tablehash[]
1.443 paf 52: #j^hashfile[]
1.417 parser 53: #^formclass[]
1.415 parser 54: #^hren[]
1.485 paf 55: #^domedit[]
1.475 paf 56: #^domxslt[]
1.402 parser 57: #^lsplit2[]
1.401 parser 58: #^faceesize[]
1.445 paf 59: #^imageresize[]
1.399 parser 60: #^ifassignhash[]
61: #^tintdefault[]
62: #$response:status[404]
1.390 parser 63: #^ifpasshash[]
1.387 parser 64: #^movedir[]
65: #^replace[]
1.416 parser 66: #^set[]
1.385 parser 67: #^hash[]<hr>
1.384 parser 68: #$t[^methresult[]] ->$t
1.382 parser 69: #^terror[]
1.378 parser 70: #^ssave[]
1.377 parser 71: #^calendar[]
1.376 parser 72: #^thash[]
1.373 parser 73: #^tdef[]
1.375 parser 74: #^ford[]
1.371 parser 75: #^tif[]
1.383 parser 76: #^image[]
1.369 parser 77: #^mail2[]
1.413 parser 78: #^cookie[]
1.365 parser 79: #^response[]
1.364 parser 80: #^regexp2[]
81: #^ttablerem[]
82: #^pcre[]
83: #^regexp[]<hr>
84: #^mail[]
85: #^exec[]
86: #^fori[]
1.468 paf 87: #^tconnect[]
1.509 paf 88: #^xslt[]
1.470 paf 89: #^xml[]
1.364 parser 90: #^header[]
1.477 paf 91: <hr>
1.364 parser 92: OK
1.517 paf 93:
94: @xpath[]
95: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
96: <document><block><p>привет</p></block></document>
97: }]
98: #^show-xdoc2[$xdoc]
1.520 paf 99: $node[^xdoc.selectSingle[/document/block/p]]
1.519 paf 100: ^if(def $node){
1.520 paf 101: ^if($node is string){
102: $node
103: }{
104: ^if($node is hash){
105: ^node._count[]
106: }{
107: $node.nodeType
108: }
1.519 paf 109: }
1.518 paf 110: #$node.firstChild.nodeValue
1.519 paf 111: }{
112: node not found
113: }
1.517 paf 114:
1.514 paf 115:
116: @ttablesetlang[]
117: $a-tab-b[a b
118: 1 2]
119:
120: $t[^table::set{$a-tab-b}]
121: =$t.a=
122: <hr>
123:
124: $t[^table::set[nameless]{^taint[$a-tab-b]}]
125: =$t.0=
126: <hr>
127:
128: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
129: =$t.a=
130:
131: #^t.append{1 2}
1.511 paf 132:
133: @mail3[]
134: ^mail:send[
135: $.from[Александр Петросян <paf@design.ru>]
136: $.to[Александр Петросян <paf@design.ru>]
1.512 paf 137: $.subject[проверка4]
1.511 paf 138: $.body[
139: $.text[
140: $.content-type[$.value[text/plain] $.charset[windows-1251]]
141: $.body[проверка]
1.512 paf 142: ]
143: $.attachment[
144: $.value[^file::load[text;index.html]]
145: $.file-name[привет всем.html]
1.511 paf 146: ]
147: ]
148: ]
149:
1.504 paf 150:
1.510 paf 151: @ttime[]
152: $now[^date::now[]]
153: $now.hour:$now.minute
154:
1.504 paf 155: @tupper[]
156: $t[abcABCабвАБВ]
157: $t<br>
158: ^t.upper[]
1.497 paf 159:
160: @treplace[]
161: $copy-paste-clean[^table::set{a b
162: . _
163: , _
164: + _
165: & _
166: ? _
167: = _}]
168:
1.498 paf 169: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
1.497 paf 170: # почему-то этот replace роняет апач в 500 ошибку :(
1.498 paf 171: #^cache_key.replace[$copy-paste-clean]
172: $test[abc]
173: ^test.save[$cache_key]saved<br>
174: $cache[^file:list[.;\.cache^$]]
175: ^file:delete[$cache_key]deleted($cache.name)<br>
176:
1.497 paf 177:
178:
179: @xslt2[]
1.527 paf 180: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1.516 paf 181: <document><block><p>привет</p></block></document>
1.497 paf 182: }]
1.516 paf 183: ^show-xdoc2[$xdoc]
1.522 paf 184: ^show-xdoc2[^xdoc.transform[templates/_document.xslt]]
1.497 paf 185: <hr>
186:
1.495 paf 187:
1.496 paf 188: @tcache2[]
189: ^cache[$DB_HOME/keyключ](2){
190: ^math:random(100)
191: }
1.485 paf 192:
1.486 paf 193: @ttaintuntaint[]
194: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
195: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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
206: }
207:
208:
1.477 paf 209: @badoracequoting[]
210: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
211: ^connect[$SQL.connect-string]{
1.478 paf 212: ^void:sql{delete from paf}
1.479 paf 213: ^void:sql{insert into paf values (1, '$form:text')}
1.478 paf 214: $paf[^table::sql{select * from paf}]
215: ^paf.menu{
1.479 paf 216: $paf.id: ^untaint{$paf.block}<hr>
1.478 paf 217:
1.477 paf 218: }
1.478 paf 219: <hr>
220:
1.477 paf 221:
1.478 paf 222: ^rem{
1.477 paf 223: $news[^table::sql{select description from news}[$.limit(3)]]
224: ^news.menu{
225: ^untaint{$news.description}<hr>
226:
227: }
1.478 paf 228: <hr>
229: }
230:
231: $tables[^table::sql{select table_name from user_tables}]
232: ^tables.menu{
233: $tables.table_name<br>
234: }
235:
1.477 paf 236: }
237: <hr>
238: $env:PATH
1.476 paf 239:
240: @badconstructors[]
241: $bred[^string::length[]]
242: $bred[^response::clear[]]
243: $bred[^int::int[]]
244:
1.475 paf 245:
246: @xloadwrongtable[]
247: $constr[^xdoc::load[wrongtable.xml]]
1.513 paf 248: ^show-xdoc2[$constr]
1.475 paf 249:
250: @xsetwrongtable[]
251: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
252: <block-list>^untaint[as-is]{$constructor}</block-list>}]
253:
1.471 paf 254:
1.472 paf 255: @tablecolumnerror[]
256: $t[^table::set{a}]
257: $t.$a
258:
1.471 paf 259: @roll[]
1.472 paf 260: #$date[^date::set(1970;1;2)]
261: #^date.roll[month](-1)
262: $date[^date::set(2038;1;1)]
1.471 paf 263: ^date.roll[month](+1)
264: $date.year $date.month $date.day
1.470 paf 265:
266: @cookie2[]
267: #=$cookie:clientType[$.value[test]]=<br>
268: =$cookie:clientType=<br>
269:
1.469 paf 270:
271: @tableset[]
272: $a[^table::set{a
273: 1
274: 2}]
275: ^eval(100\$a)
276:
277:
278:
279: @zzz[]
280:
1.462 paf 281:
282: $constructor[
283: <block1 name="main_srvr" type="0" label="Основное тело" />
284: <block2 name="main_srvr2" type="0" label="Основное тело" />
285: ]
286:
287: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
288: <block-list>^untaint[as-is]{$constructor}</block-list>}]
289:
290: $children[$constr.documentElement.childNodes]
291: ^if($children){
292: ^for[i](1;^children._count[]){
293: $node[$children.$i]
294: $node.nodeName<br>
295: }
296: }
297:
1.461 paf 298:
299: @thashforeach3[]
300: $h[
301: $.a[1]
302: $.b[2]
303: ]
304: $c[^table::set{a
305: ^h.foreach[key;value]{$value
306: }}]
307: $c.a
308:
309: @thashforeach2[]
310: $h[
311: $.a[1]
312: $.b[2]
313: ]
314: $c[
315: ^h.foreach[key;value]{
316: $.$key[$value]
317: }
318: ]
319: $c.b
1.458 paf 320:
321: @thashforeach[]
322: $h[
323: $.a[1]
324: $.b[2]
325: ]
326: ^h.foreach[key;value]{
327: $key=$value<br>
328: }
1.457 paf 329:
330: @thashdelete[]
331: $h[$.a[1] $.b[2]]
332: was:<br>
333: count=^h._count[] <br>
334: b='$h.b' <br>
335:
336: ^h.delete[b]
337:
338: now:<br>
339: count=^h._count[] <br>
340: b='$h.b'
1.452 paf 341:
342: @sappend[]
343: $test[123]
344: ^test.save[test]
345: ^test.save[append;test]
346:
1.453 paf 347: @tappend[]
348: $test[^table::set{a b
349: a1 b1}]
350: ^test.save[test]
351: $test[^table::set{a b
352: a2 b2}]
353: ^test.save[append;test]
1.452 paf 354:
1.448 paf 355:
356: @tform[]
1.449 paf 357: ^if(def $form:new_file){y}{n}
358: <form method="post" enctype="multipart/form-data">
359: <input type="file" name="new_file" />
1.448 paf 360: <input type=submit>
361: </input>
1.447 paf 362:
363: @formattest[]
364: $size(15.124)
365:
366: ^size.format{%.2f}
1.446 paf 367:
368: @filelist[]
369: $html[^file:list[.;\.html^$]]
370: ^html.menu{
371: $html.name<br>
372: }
373: <hr>
1.431 paf 374:
375: @безнадёжна_попытка_поправить_непоправимое[]
376: $dom_from_disk[^xdoc::load[input.xml]]
377: $dom_created_in_air[^xdoc::create[doc]]
378: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
379: ^show-xdoc2[$dom_created_in_air]
380:
1.426 parser 381:
1.428 parser 382: @tcache[]
383: #^hashfile:clear[cache]
1.459 paf 384: $code[^hashfile::open[$DB_HOME;cache]]
1.496 paf 385: ^code.cache[key](2){
1.430 parser 386: ^math:random(100)
387: # ^code.delete[]
1.496 paf 388: }
1.428 parser 389:
1.426 parser 390: @thashfileexp[]
1.459 paf 391: $hf[^hashfile::open[$DB_HOME;hashfile]]
1.428 parser 392: $hf.paf[$.value[крут] $.expires(3)]
393: paf=$hf.paf
1.459 paf 394: <hr>
395: ^hf.foreach[key;value]{
396: $key=$value<br>
397: }
1.427 parser 398: <hr>
399: $hash[^hf.hash[]]
400: =$hash.paf=
401: <hr>
1.420 parser 402:
1.423 parser 403: @tcounter[]
1.440 paf 404: ^tcounterone[$DB_HOME]
1.466 paf 405: other root:
406: ^tcounterone[${DB_HOME}2]
407: again, first:
408: ^tcounterone[$DB_HOME]
1.432 paf 409:
410: @tcounterone[DB_HOME]
411: $counter[^hashfile::open[$DB_HOME;counter]]
1.440 paf 412: #^counter.clear[]
1.423 parser 413: ^counter.transaction{
414: # $counter.value(10)
415: $counter.value($counter.value+1)
416: # ^counter.delete[value]
417: $counter.value
418: }
1.424 parser 419: <hr>
1.432 paf 420: ^rem{
1.424 parser 421: $hash[^counter.hash[]]
1.425 parser 422: =$hash.value=
1.424 parser 423: <hr>
1.432 paf 424: }
1.423 parser 425:
426: @tablehash[]
427: $productList[^table::set{id name
428: 1 носки
429: 2 валенки
430: 3 ушанка
431: }]
432:
433: #скажем, у первого дилера
434: $firstPriceList[^table::set{id price
435: 1 0.3
436: 3 1000
437: }]
438:
439: $firstPriceHash[^firstPriceList.hash[id]]
440:
441: ^productList.menu{
442: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
443: }
444:
445:
1.420 parser 446: @hashfile[]
447: $hf[^hashfile::assign[hashfile]]
1.423 parser 448: #$hf.paf[крут5]
1.420 parser 449: paf=$hf.paf
1.402 parser 450:
1.417 parser 451: @formclass[]
452: ^$form:CLASS.a=$form:CLASS.a
453:
1.406 parser 454: @domdata[]
1.418 parser 455: ^if(1){
1.422 parser 456: # $a{^hren[]}
1.418 parser 457: }
1.419 parser 458: $a
1.408 parser 459: $xdoc[^xdoc::create[doc]]
460: $doc[$xdoc.documentElement]
1.473 paf 461: $name[^doc.appendChild[^xdoc.createElement[name]]]
1.474 paf 462: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1.435 paf 463: ^untaint[as-is]{=$text.nodeValue=}
1.406 parser 464:
465: @domedit[]
466: ^domdata[]
1.404 parser 467: #$paf.nodeName<br>
468: #$doc.documentElement.nodeName<br>
469:
1.406 parser 470: ^show-xnode1[$xdoc.documentElement;0;1]
471: <hr>
472: ^show-xdoc2[$xdoc]
1.411 parser 473: <hr>
1.406 parser 474:
475: @domxslt[]
476: ^domdata[]
1.405 parser 477: ^show-xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1.411 parser 478: <hr>
1.401 parser 479:
480: @lsplit2[]
481: $path[/optics/]
482: $pathTable[^path.lsplit[/]]
483: ^pathTable.menu{
484: ^if(def $pathTable.piece){
485: =$pathTable.piece=
486: }
487: }
488:
1.395 parser 489:
1.397 parser 490: @faceesize[]
491: $k(2)
492: $pict[^image::load[paf.gif]]
493: $small[^image::create($pict.width/$k;$pict.height/$k)]
1.398 parser 494: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1.397 parser 495: $response:body[^small.gif[]]
496:
1.395 parser 497: @imageresize[]
498: $k(2)
499: $pict[^image::create(400*$k;200*$k)]
500: $pict.line-width(2)
1.444 paf 501: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
502: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1.395 parser 503: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1.444 paf 504: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
505: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
506: $response:body[^pict.gif[]]
1.395 parser 507:
1.443 paf 508: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1.396 parser 509: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1.443 paf 510: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1.395 parser 511:
1.443 paf 512: #$response:body[^small.gif[]]
1.395 parser 513:
1.388 parser 514:
515: @tintdefault[]
516: #$abc[abc]
517: $abc[33]
518: ^abc.int[z]
519: #^abc.int(123)
1.390 parser 520:
521: @ifassignhash[]
522: $h[^if(1){$.a(1);$.a(2)}]
523: $h.a
1.387 parser 524:
525: @ifpasshash[]
526: $a[$.e[a]]
527: $b[$.e[b]]
1.389 parser 528: ^ifpasshashdest[^if(1){$a;$b}]
1.387 parser 529: #$x[^if(1){$a}{$b}]
530: #^ifpasshashdest[$x]
531:
532: @ifpasshashdest[p]
533: $p.e
534:
535: @movedir[]
536: ^file:move[a;deeper/a]
1.386 parser 537:
538: @replace[]
539: $a[12^;3]
540: ^a.replace[^table::set{from to
541: 2^; !
542: }]
543:
1.385 parser 544:
545: @set[]
546: ^setdata[]
547: ^a.add[$b]
548: add:$a.3<br>
549:
550: ^setdata[]
551: ^a.sub[$b]
552: sub2:$a.2<br>
553: sub1:$a.1<br>
554:
555: ^setdata[]
556: $c[^a.union[$b]]
557: union3:$c.3<br>
558: union2:$c.2<br>
559:
560: ^setdata[]
561: $c[^a.intersection[$b]]
562: intersection3:$c.3<br>
563: intersection2:$c.2<br>
564:
565: ^setdata[]
566: intersects:^if(^a.intersects[$b]){y;n}<br>
567: intersects2:^if(^a.intersects[ ]){y;n}<br>
568:
569:
570: <hr>
571:
572: @setdata[]
573: $a[$.1[a1] $.2[a2]]
574: $b[ $.2[b2] $.3[b3]]
575:
1.383 parser 576:
1.384 parser 577: @hash[]
578: $h[^hash::create[$._default[123]]]
579: $h.paf[not kretin]
580: $h.paf<br>
581: =$h.that=<br>
582:
583: @methresult[]
584: $result[^table::set{1}]
1.377 parser 585:
1.381 parser 586: @terror[]
587: ^error[method z must be called with z]
588:
1.380 parser 589: @syntax1[]
590: #^a[^b]
591:
592: @syntax2[]
1.381 parser 593: #^a[
1.379 parser 594:
1.377 parser 595: @ssave[]
596: $abc[abc]
597: ^abc.save[abc]
1.376 parser 598:
599: @calendar[]
600: 2001;11:<br>
601: $week_days[^date:calendar[rus](2001;11)]
602: <pre>
603: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
604: </pre>
1.372 parser 605:
1.375 parser 606: @thash[]
607: $table[^table::set{id name age
608: 1 paf 278
609: 2 пиф 234
610: }]
611: $hash[^table.hash[id;^table::set[nameless]{id
612: name}]]
613: $hash.2.id $hash.2.name $hash.2.age
614:
1.372 parser 615: @tdef[]
616: $s[0]
617: if 0=^if($s){}{n}<br>
618: if def 0=^if(def $s){y}{}<br>
619: <hr>
1.371 parser 620:
621: @ford[]
1.374 parser 622: ^for[i](0;5){$i}{($i)}
1.368 parser 623:
1.370 parser 624: @tif[]
625: ^if[def]{y;n}
626:
1.368 parser 627: @image[]
628: $pict[^image::create(400;200)]
1.379 parser 629: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
630: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
631: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
632: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
633: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1.368 parser 634: $response:body[^pict.gif[]]
635:
636:
1.366 parser 637:
1.369 parser 638: @mail2[]
1.367 parser 639: ^mail:send[
1.369 parser 640: $.content-type[$.value[text/plain] $.charset[windows-1251]]
641: $.from[Александр Петросян <paf@design.ru>]
1.367 parser 642: $.to[Александр Петросян <paf@design.ru>]
1.369 parser 643: $.subject[проверка]
644: $.body[проверка]
1.367 parser 645: ]
646:
1.366 parser 647: @cookie[]
1.367 parser 648: $env:HTTP_COOKIE<br>
649:
650: #$cookie:переменная[test тест ТЕСТ2]
651: =$cookie:переменная=<br>
652: #$cookie:переменная2[test тест ТЕСТ3]
653: =$cookie:переменная2=<br>
1.412 parser 654: =$cookie:CLASS.переменная2=<br>
1.365 parser 655:
656: @response[]
657: #^if($form:reload){
658: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
659: #}
1.364 parser 660:
661: @xslt[]
662: ^xdata[]
1.407 parser 663: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
664: ^show-xdoc2[$transformed]
1.364 parser 665:
666: @regexp2[]
667: $s[ select]
668: $s[^s.match[^^\s*][]{!}]
669: $s
670:
671: @header[]
672: $response:refresh[
673: $.value[0]
674: $.url[http://design.ru?a=^taint[123]]
675: ]
676:
677: @ttablerem[]
678: $table[^table::load[a.cfg]]
679: ^table.menu{$table.a}
680:
681: @tconnect[]
682: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
683: $tables[^table::sql{show tables}]
684: #$cols[^tables.columns[]]
685: #$cols.column
686: ^tables.menu{
687: $tables.[Tables_in_test]<br>
688: }
689: }
690:
691: @pcre[]
692: $s[1 2]
693: ^s.match[\s;ig]{!}
694: #^s.match[\d;ig]{!}
695:
696:
697: @regexp[]
698: $s[abcАБВ]
699: ^if(^s.match[б][i]){y}{n}
700:
701: @mail[]
702: #$ORIGINS(1)
703: ^mail:send[
704: $.from[paf@design.ru]
705: $.to[paf@design.ru]
706: $.body[1
707:
708: 2
709:
710:
711: 3]
712: ]
713:
714: @exec[]
1.370 parser 715: $a[^file::exec[fc.exe;;a;b]]
1.364 parser 716: $a.status|$a.stderr<hr>
717:
718: @fori[][i]
719: ^for[i](1;3){... =$i= ...}
720:
1.489 paf 721: @xdata0[]
1.364 parser 722: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1.468 paf 723: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
724: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
725: <people>
726: <man id="1" имя="word слово">
727: <name>P«^;AF B</name>
728: </man>
729: <man id="2">
730: <name>ПИФ^taint[&]</name>
731: </man>
732: </people>
733: }]
1.489 paf 734:
735: @xdata[]
736: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1.490 paf 737: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1.489 paf 738: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
739: <people>
740: <man id="1" имя="word слово">
741: <name>P«^;AF B</name>
742: </man>
743: <man id="2">
744: <name>ПИФ^taint[&]</name>
745: </man>
746: </people>
747: }}]
1.364 parser 748:
749: @xml[]
750: ^xdata[]
751:
752: ^show-xdoc2[$xdoc]<hr>
753: #^show-xnode1[$xdoc]<hr>
754: $people[^xdoc.select[*/man]]
755: #^show1[]
756: ^show-xnodes1[$people]<hr>
757: #^people.0.owner.hren[]
758:
1.393 parser 759: ^show-xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1.364 parser 760:
761: by id:
762: ^show-xnode1[^xdoc.getElementById[1];0;1]
763: <hr>
764:
765: @show1[array]
766: ^for[i](0;^array._count[]-1){
767: $x[$array.$i]
768: $x.firstChild.nodeValue:
769: $pattributes[$x.parentNode.attributes]
770: ^if(^pattributes._count[]){
771: $pattributes.id.name=$pattributes.id.nodeValue
772: }
773: <br>
774: }
775:
776: @show-xnodes1[array][i]
777: ^for[i](0;^array._count[]-1){
778: ^show-xnode1[$array.$i;0;1]
779: }
780:
781: @show-xnode1[x;level;single][l]
782: ^if(def $x){
783: ^for[l](0;$level-1){ ^; ^; ^; ^;}
784: ^if($x.nodeType == $xnode:ELEMENT_NODE){
785: <^;$x.nodeName
786: $pairs[$x.attributes]
787: ^if(def $pairs){
788: $names[^pairs._keys[]]
789: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
790: }
791: >^;
792: }{
793: [$x.nodeType]
794: }
795:
796: ^if(def $x.nodeValue){$x.nodeValue}<br>
797: ^show-xnode1[$x.firstChild]($level+1)
798: ^if(!$single){
799: ^show-xnode1[$x.nextSibling]($level)
800: }
801:
802: ^if($x.nodeType == $xnode:ELEMENT_NODE){
803: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
804: }
805: }
806:
807: @show-xdoc2[xdoc]
1.473 paf 808: ^xdoc.save[out/save.xml;
1.525 paf 809: # $.encoding[utf-8]
1.364 parser 810: $.method[xml]
811: ]
812: $file[^xdoc.file[
1.525 paf 813: $.encoding[utf-8]
1.364 parser 814: $.method[html]
815: ]]
1.473 paf 816: ^file.save[text;out/save_file.html]
1.487 paf 817: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
818: <pre>^taint[html][^xdoc.string[
1.526 paf 819: $.method[html]
820: # $.encoding[utF-8]
1.487 paf 821: # $.omit-xml-declaration[yes]
1.523 paf 822: # $.standalone[no]
823: # -$.doctype-public[-//W3C//DTD XHTML]
824: # -$.doctype-system[/a/b/c/]
825: # $.indent[yes]
826: # $.media-type[text/paf]
1.486 paf 827: ]]
1.413 parser 828: </pre>
E-mail: