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