Annotation of parser3/www/htdocs/index.html, revision 1.123
1.104 paf 1: @USE
1.105 paf 2: /derived.p
1.15 paf 3:
1.72 paf 4: @auto[filespec]
5: $selffilespec[$filespec]
1.63 paf 6: #$form:here
1.84 paf 7: #$request:charset[UTF-8]
8: #$response:charset[windows-1251]
1.112 paf 9: #$request:charset[windows-1251]
10: #$response:charset[UTF-8]
1.84 paf 11: #$response:content-type[$.value[text/html]$.charset[$response:charset]]
1.15 paf 12:
1.60 paf 13: #@postprocess[body]
14: #<b>$body</b>
15: #$result[123]
1.37 paf 16:
1.15 paf 17: @main[]
1.72 paf 18: #$a(123)
19: #^a.format[%.10u]
1.71 paf 20: #$result[111]
1.70 paf 21: #^f[a]
1.115 paf 22: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
1.88 paf 23: # ^int:sql{select news_id from news where news_id=-1}[
24: ## $.default{2}
25: # ]<br>
1.115 paf 26: # ^hash::sql{bad}
1.88 paf 27: # ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
1.109 paf 28: # ^file::load[text;^string:sql{select 'from sql server' }]
1.95 paf 29: # ^string:sql{select '^^hello[]' }] $ORIGINS(1)
1.96 paf 30: # ^process{ ^^h[]}
1.97 paf 31: # ^process{^string:sql{select '1
32: # ^^hello[]' }] }
1.115 paf 33: #}
1.49 paf 34: #^eval(2)
1.48 paf 35: #^tcrashlocaljunctionsv2[]
1.49 paf 36: #^tcrashlocaljunctions[]
1.50 paf 37: #^tjunctions[]
1.47 paf 38: #^replacetest[]
1.48 paf 39: #^matchoptionpp[]
1.46 paf 40: #^txdocxnodechild[]
1.44 paf 41: #^tclasses[]
1.43 paf 42: #$math:PI
43: #^b:method[]
1.42 paf 44: #^main[]
1.41 paf 45: #^errort[]
1.44 paf 46: #^tselectNumber[]
1.39 paf 47: #$result[hello]
1.36 paf 48: #^invaliddate2[]
49: #^process2[]
50: #^casehashtext[]
1.35 paf 51: #^subjvaltest[]
52: #^tableselect0[]
1.34 paf 53: #^memnotest1[]
1.32 paf 54: #^voidparams[]
1.31 paf 55: #^rolls2[]
1.30 paf 56: #^cacheexpireschanging[]
1.29 paf 57: #^cacheexpiresfixed[]
58: #^dateoffsets[]
59: #^exceptionTypes[]
1.28 paf 60: #^roll2[]
1.27 paf 61: #^rolls[]
1.25 paf 62: #^exceptions1[]
1.22 paf 63: #^locate_by_expr[]
1.18 paf 64: #^method_junction_params{...}
1.17 paf 65: #^verifyCookie[paf]
1.37 paf 66: #^execlangs[]
1.16 paf 67: #$t[^tobjeresult[]]$t.a
68: #^xmlprobs[]
1.15 paf 69: #^doubleprobs[]
70: #^math:random(-10)
71: #^divnamestop[]
72: #^arrayclone[]
73: #^operator_tricks[]
74: #^xoutputrusattr[]
75: #^xdocset1[]
76: #^regexp3[]
77: #^exec2[]
78: #^tlock[]
79: #^xmloutattrwithoutvalue[]
80: #^precisionProblem[]
81: #^xpath[]
82: #^ttablesetlang[]
83: #^ttime[]
84: #^tupper[]
85: #^treplace[]
86: #^xslt2[]
87: #^tcache2[]
88: #$ORIGINS(1)
89: #$t[^table::set{a b} ^table::set{c d}]
90: #^ttaintuntaint[]
91: #^tappend2[]
92: #^badvsnprintf[]
93: #^badoracequoting[]
94: #^badconstructors[]
95: #^xloadwrongtable[]
96: #^xsetwrongtable[]
97: #^if($form:test){y}{n}
98: #^tablecolumnerror[]
99: #^roll[]
100: #^cookie2[]
101: #^tableset[]
102: #^math:PI.format{%.30f}
103: #^xchildren[]
104: #^thashforeach3[]
105: #^thashforeach2[]
106: #^thashforeach[]
107: #^thashdelete[]
108: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
109: #^tappend[]
110: #^sappend[]
111: #^eval(10\3)<br>
112: #^tform[]
113: #^formattest[]
114: #^filelist[]
115: #^connect[mysql://user:pass@host]{ }
116: #^безнадёжна_попытка_поправить_непоправимое[]
117: #^tcache[]
118: #^thashfileexp[]
119: #^tcounter[]
120: #^tablehash[]
121: #j^hashfile[]
122: #^formclass[]
123: #^hren[]
124: #^domedit[]
125: #^domxslt[]
126: #^lsplit2[]
127: #^faceesize[]
128: #^imageresize[]
129: #^ifassignhash[]
130: #^tintdefault[]
131: #$response:status[404]
132: #^ifpasshash[]
133: #^movedir[]
134: #^replace[]
135: #^set[]
136: #^hash[]<hr>
137: #$t[^methresult[]] ->$t
138: #^terror[]
139: #^ssave[]
140: #^thash[]
141: #^tdef[]
142: #^ford[]
143: #^tif[]
1.84 paf 144: #^image[]
1.15 paf 145: #^mail2[]
146: #^response[]
147: #^regexp2[]
148: #^ttablerem[]
149: #^pcre[]
150: #^regexp[]<hr>
151: #^mail[]
152: #^exec[]
153: #^fori[]
154: #^tconnect[]
155: #^xslt[]
156: #^xml[]
157: #^header[]
1.53 paf 158: #^tablehasht[]
1.54 paf 159: #^datecreatestring[]
1.56 paf 160: #^mssqltypes1[]
161: #^badthrows[]
1.57 paf 162: #^xmlspace[]
163: #^counter[main.counter]
164: #^xpath2[]
165: #^callindirect[]
166: #^junctionprob[]
1.59 paf 167: #^datecreatestring2[]
168: #^tstoredproc[]
169: #^tstoredproc2[]
170: #^forkeys[]
1.60 paf 171: #^pngsize[]
1.61 paf 172: #^checkList[]
1.63 paf 173: #^datetest[]
1.65 paf 174: #^tserge[]
1.69 paf 175: #^envt[]
1.67 paf 176: #^selectt[]
177: #^select2[]
178: #^selectSingle2[]
179: #^selectString2[]
180: #^selectNumber2[]
181: #^selectBool2[]
182: #^xdoccreate[]
183: #^xdoccreatetag[]
1.70 paf 184: #^xdocload[]
1.67 paf 185: #^xdocstring[]
186: #^xdocsave[]
1.68 paf 187: #^div[]
188: #^datecreatestring3[]
1.73 paf 189: #^tfilespec[]
1.77 paf 190: #^tcrypt[]
1.74 paf 191: #^cryptdocsample[]
1.78 paf 192: #^tnormalize[]
1.83 paf 193: #^xmltransformbyxdoc[]
1.81 paf 194: #^sergestrandef[]
1.83 paf 195: #^tstdin[]
196: #^tfind[]
1.86 paf 197: #^mimet[]
1.88 paf 198: #^cgit[]
1.92 paf 199: #^joinlimit[]
1.89 paf 200: #^tableclonelimit[]
1.91 paf 201: #^transparams[]
202: #^sendtests[]
1.93 paf 203: #^wwrapperpass[]
1.95 paf 204: #^badpos[]
1.98 paf 205: #^processtest[]
206: #^mail3[]
1.99 paf 207: #^mail4[]
1.100 paf 208: #^datesaving[]
1.101 paf 209: #^badconstructor[]
1.103 paf 210: #^calendar[]
1.104 paf 211: #^monthdays(8)
212: #^xdoctypetest[]
1.105 paf 213: #^xtabletest[]
1.117 paf 214: #^staticstest[]
1.108 paf 215: #^staticstest2[]
1.115 paf 216: #^rbodytest[]
217: #^cookie[]
1.116 paf 218: #^cookieexpirestest[]
1.119 paf 219: #^postest[]
1.120 paf 220: #^voidpostest[]
1.123 ! paf 221: #^virtualtest[]
1.122 paf 222: #^badcolumntest[]
1.123 ! paf 223: ^delimiters[]
1.77 paf 224: <hr>
1.74 paf 225: OK
1.123 ! paf 226:
! 227: @delimiters[]
! 228: $a#1[1]<br>
! 229: $a#1=<br>
! 230:
1.121 paf 231:
232: @badcolumntest[]
233: $table[^table::load[ext.cfg]]
234: $table.b
235:
1.120 paf 236:
237: @virtualtest[]
238: $derived[^derived::create[derived create actual param]]
239: ^derived.test[]
240:
1.119 paf 241:
242: @voidpostest[]
243: $s[]
244: ^s.pos[$nothing]
1.118 paf 245:
246: @postest[]
247: $s[$nothing]
248: ^s.pos[$nothing]
1.113 paf 249:
1.115 paf 250: @cookieexpirestest[]
251: #$cookie:exptest[1]
252: #$cookie:exptest[$.value[2] $.expires(+1)]
253: $response:xxxx[^date::now(+10)]
254: $response:yyy[$.value[^date::now(+20)]]
255: $response:yyy[$.value[vvv] $.aaaa[^date::now(+20)]]
256:
1.113 paf 257: @rbodytest[]
258: $request:body=
259: <form method=post>
260: <input type=submit name=paf value=123>
261: </form>
1.107 paf 262:
263: @staticstest2[]
264: ^$derived:derived_var=$derived:derived_var<br>
265: ^$derived:a=$derived:a<br>
1.108 paf 266: $derived:a[changed] ^$derived:a=$derived:a<br>
1.107 paf 267: $derived:derived_var[changed]
268: ^$derived:derived_var=$derived:derived_var<br>
269:
1.105 paf 270: @staticstest[]
271: $derived[^derived::create[]]
272: ^derived.test[]
1.110 paf 273: <hr>
1.106 paf 274: ^$derived.a=$derived.a<br>
275: ^$derived.x=$derived.x<br>
1.110 paf 276: <hr>
277: ^if($derived is derived){derived is derived}{error: derived is not derived}<br>
278: ^if($derived is table){derived is table}{error:derived is not table}<br>
1.111 paf 279: <hr>
280: ^^eval(^$derived)=^eval($derived)<br>
281: ^^if(^$derived)=^if($derived){y}{n}<br>
1.106 paf 282:
1.105 paf 283:
1.104 paf 284: @xdoctypetest[]
285: $xdoc[^xdoc::create[x]]
286: ^if($xdoc is xdoc){y}{n}
287:
288: @xtabletest[]
289: $xtableo[^xtable::create[]]
290: ^if($xtableo is table){y}{n}
1.105 paf 291: #^xtableo.columns[]
1.100 paf 292:
1.103 paf 293: @monthdays[month]
294: $from[^date::create(2000;$month;1)]
295: $to[^date::create($from)] ^to.roll[month](+1)
296: $result($to-$from)
297:
1.100 paf 298: @badconstructor[]
299: ^date::now[]
1.99 paf 300:
301: @datesaving[]
302: $now[^date::now[]]
303: $now.daylightsaving<br>
304: $now.yearday<br>
305: #
306: $date[^date::create(2002;1;3)]
307: $date.daylightsaving<br>
308: $date.yearday
1.97 paf 309:
1.98 paf 310: @mail4[]
311: ^mail:send[
312: $.from[paf@mail.design.ru]
313: $.to[paf@mail.design.ru]
314: $.subject[^taint[uri][москва]=2]
315: $.text[^taint[uri][москва]=]
316: $.html{<a href=http://there.ru/?city=^taint[uri][Москва]>link</a>}
317: ]
1.97 paf 318: @processtest[]
319: $f[^file::load[text;piece.p]] ^process{$f.text}
320: $ORIGINS(1)
1.93 paf 321:
322:
323: @badpos[]
324: $s[123]
1.94 paf 325: ^s.mid(0;2)
1.92 paf 326:
327: @wwrapperpass[]
328: $h[^hash::create[]]
329: $h.a(1)
330: ^my_method[^if(1){$h}]
331: работает. так и должно быть?
332:
333: @my_method[p]
334: ^p._count[]
335:
1.88 paf 336:
337: @tableclonelimit[]
338: $source[^table::create{a
339: aa
340: bb
341: cc}]
342: ^source.offset(1)
343: #$dest[^table::create[$source]]
344: $dest[^table::create[$source;$.offset(2)]]
345: $dest[^table::create[$source;$.limit(2)]]
346: $dest[^table::create[$source;$.offset(1)$.limit(1)]]
347: $dest[^table::create[$source;$.offset(1)$.limit(2)]]
348: $dest[^table::create[$source;$.offset[cur]$.limit(2)]]
349:
350: ^dest.menu{$dest.a}[,]<br>
351:
352: @joinlimit[]
353: $source[^table::create{a
354: aa
355: bb
356: cc}]
357: ^source.offset(2)
358: $dest[^table::create{a
359: xx
360: }]
361: #^dest.join[$source]
362: #^dest.join[$source;$.offset(2)]
363: #^dest.join[$source;$.limit(2)]
364: #^dest.join[$source;$.offset(1)$.limit(1)]
365: #^dest.join[$source;$.offset(1)$.limit(2)]
1.91 paf 366: #^dest.join[$source;$.offset[cur]$.limit(1)]
367: ^dest.join[$source;$.limit(0)]
1.88 paf 368:
369: ^dest.menu{$dest.a}[,]<br>
1.86 paf 370:
371: @cgit[]
372: $f[^file::cgi[showenv.cmd]]
373: $f.HELLO=<br>
374: $f.CONTENT-TYPE=<br>
375: $f.content-type=<br>
376:
1.83 paf 377:
1.84 paf 378: @mimet[]
1.85 paf 379: $f[^file::stat[a.GIF]]
380: $f.content-type
1.84 paf 381:
382:
1.83 paf 383: @tfind[]
384: ^file:find[index.html]
385:
386: @tstdin[]
387: $f[^file::exec[test.pl;$.stdin[проверка stdin потока]]]
388: <pre>$f.text</pre>
1.80 paf 389:
390: @sergestrandef[]
391: $sQuantity[ ]
392: ^sQuantity.int(10)
1.78 paf 393:
394: @xmltransformbyxdoc[]
395: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
396: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
397: <people>
398: <man id="1" имя="word слово">
399: <name>1 2</name>
400: </man>
401: </people>
402: }}]
403: $sheet[^xdoc::create{<?xml version="1.0"?>
1.79 paf 404: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
405:
406: >
1.78 paf 407: <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
408:
1.79 paf 409: <!--<xsl:import href="http://localhost/html.xsl"/>-->
410: <xsl:import href="html.xsl"/>
411:
1.78 paf 412: <xsl:param name="param1">defparam1</xsl:param>
413: <xsl:param name="param2">defparam2</xsl:param>
1.79 paf 414:
1.78 paf 415:
416: <xsl:template match="doc">
417: param1=<xsl:value-of select="^$param1"/><br/>
418: param2=<xsl:value-of select="^$param2"/><br/>
419:
420: test return <something background=""/>
421: </xsl:template>
422:
423: <xsl:template name="test">
1.81 paf 424: test return3
1.78 paf 425: </xsl:template>
426:
427: <xsl:template match="people">
428: <html>
429: <head>z</head>
430: para1=<xsl:copy-of select="^$param1"/>
431: <xsl:apply-templates/>
432: <hr/>
433: <xsl:call-template name="test"/>
434: </html>
435: </xsl:template>
436:
437: <xsl:template match="name">
438: <b><xsl:value-of select="."/></b>
439: </xsl:template>
440: </xsl:stylesheet>
441: }]
442:
443:
444: $xdoc[^xdoc.transform[$sheet]]
445: $string[^xdoc.string[$.method[html]]]
446: ^string.save[a]
447: ^untaint[html]{$string}
448:
449:
1.77 paf 450:
451: @tnormalize[]
452: #s состоит из 1000 фрагментов
453: $s[^for[i](0;999){фрагмент }]
454: #это займет много ресурсов
455: ^s.match[фраг][g]{перга}
456: #это займет меньше ресурсов
457: #$normalized[^s.normalize[]]
458: #^normalized.match[фраг][g]{перга}
1.74 paf 459:
460: @sendtests[]
1.89 paf 461: ^text[]
1.74 paf 462: #^html[]
463: #^text-n-html[]
464: #^file[]
465: #^text-n-file[]
1.89 paf 466: #^text-n-html-n-file[]
1.74 paf 467: #^backwardcomp[]
468:
469: @backwardcomp[]
470: ^mail:send[
471: $.from[paf]
472: $.to[paf]
473: $.body[this is text value]
474: ]
475:
476: @text[]
477: ^mail:send[
478: $.from[paf]
1.90 paf 479: $.to[paf]
1.74 paf 480: $.text[
481: $.value[this is text value]
482: ]
483: ]
484:
485: @html[]
486: ^mail:send[
487: $.from[paf]
488: $.to[paf]
489: $.html{this is <b>html</b> value ^taint[<] 10}
490: ]
491:
492: @text-n-html[]
493: ^mail:send[
494: $.from[paf]
495: $.to[paf]
496: $.text[
497: $.value[this is text value]
498: ]
499: $.html[
500: $.value{this is <b>html</b> value ^taint[<] 10}
501: ]
502: ]
503:
504: @file[]
505: ^mail:send[
506: $.from[paf]
507: $.to[paf]
508: $.file[^file::load[binary;image.jpg]]
509: ]
510:
511: @text-n-file[]
512: ^mail:send[
513: $.from[paf]
514: $.to[paf]
515: $.text[
516: $.value[this is text value]
517: ]
518: $.file[^file::load[binary;image.jpg]]
519: ]
520:
521: @text-n-html-n-file[]
522: ^mail:send[
523: $.from[paf]
524: $.to[paf]
525: $.text[
526: $.value[this is text value]
527: ]
528: $.html[
529: $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
530: $.value{this is <b>html</b> value ^taint[<] 10}
531: ]
532: $.file[^file::load[binary;image.jpg]]
533: ]
534:
535:
536:
537: @md5salt[]
538: 1234
539:
540: @cryptdocsample[]
541: $users[^table::create{name password
542: alice ***
543: bob ***
544: }]
545:
546: $htpasswd[^table::create[nameless]{}]
547: ^users.menu{
548: ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
549: }
550:
551: ^htpasswd.save[nameless;.htpasswd-parser-test]
552:
1.73 paf 553:
554: @tcrypt[]
1.76 paf 555: #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
556: ^math:crypt[123;^$apr1^$]<br>
1.72 paf 557:
558: @tfilespec[]
559: src=$selffilespec<br>
560: dirname=^file:dirname[$selffilespec]<br>
561: basename=^file:basename[$selffilespec]<br>
562: justname=^file:justname[$selffilespec]<br>
563: justext=^file:justext[$selffilespec]<br>
1.68 paf 564:
565: @datecreatestring3[]
566: $new_after[^date::now(-3)]
567: $articles[^table::create{id title last_update
568: 1 привет 2002-07-03}]
569: ^articles.menu{
570: $last_update[^date::create[$articles.last_update]]
571: <a href=${articles.id}.html>$articles.title</a>
572: ^if($last_update > $new_after){новая}
573: <br>
574: }
1.67 paf 575:
576: @div[]
577: $var(5)
578: ^var.inc(7)
579: ^var.dec(3)
580: ^var.div(4)
581: ^var.mul(2)
582: $var
583:
584:
585: @xdocsave[]
586: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
587: <document>
588: строка1<br/>
589: строка2<br/>
590: </document>}]
591: ^document.save[test.xml]
592:
593: @xdocstring[]
594: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
595: <document>
596: строка1<br/>
597: строка2<br/>
598: </document>}]
599: ^document.string[
600: $.method[html]
601: ]
602:
603:
604: @xdocload[]
605: $document[^xdoc::load[article.xml]]
606: $response:body[^document.file[$.media-type[text/xml]]]
607:
608:
609: @xdoccreatetag[]
610: $document[^xdoc::create[document]]
611: $paraNode[^document.createElement[para]]
612: $dummy[^document.documentElement.appendChild[$paraNode]]
613: $response:body[^document.file[$.media-type[text/xml]]]
614:
615:
616: @xdoccreate[]
617: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
618: <document>
619: текст
620: </document>}]
621: $response:body[^document.file[$.media-type[text/xml]]]
622:
623: @selectBool2[]
624: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
625: <t attr="привет" n="123"/>}]
626: ^if(^d.selectBool[/t/@n > 10]){
627: /t/@n больше 10
628: }{
629: не больше
630: }
631:
632:
633: @selectNumber2[]
634: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
635: <t attr="привет" n="123"/>}]
636: ^d.selectNumber[number(/t/@n)+1]<br>
637: ^d.selectNumber[2*2]<br>
638:
639:
640: @selectString2[]
641: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
642: <t attr="привет" n="123"/>}]
643: # результат=привет
644: ^d.selectString[string(t/@attr)]
645:
646:
647: @selectSingle2[]
648: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
649: <t attr="привет" n="123"/>}]
650: # результат=один элемент "t"
651: $element[^d.selectSingle[t]]
652: # результат=2 (количество атрибутов <t>)
653: Количество атрибутов: ^element.attributes._count[]<br>
654: # результат=не существует (нет <x>)
655: ^if(^d.select[x]){
656: x существует
657: }{
658: x не существует
659: }
660:
661: @select2[]
662: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
663: # результат: список из одного элемента "t"
664: $list[^d.select[t]]
665: # результат: 2 = количество атрибутов <t>
666: ^list.0.attributes._count[]<br>
667: ^for[i](0;$list-1){
668: $attr[$list.$i]
669: $attr.nodeName = $attr.nodeType<br>
670: }
671:
672:
673: @selectt[]
674: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
675: $list[^d.select[t]]
676: ^list.0.attributes._count[]
1.65 paf 677:
678: @envt[]
1.66 paf 679: $f[^file::exec[showenv.cmd;
680: $.bad[value]
681: $.CGI_good[value]
682: ]]
1.65 paf 683: $f.status<br>
684: $f.stderr<br>
685: <pre>$f.text</pre>
686:
1.63 paf 687:
688: @tserge[]
1.64 paf 689: ^if(" 09 "){y}
1.61 paf 690:
691: @datetest[]
692: $f[^file::stat[some.zip]]
693: Размер в байтах: $f.size<br>
694: Год создания: $f.cdate.year<br>
695: $now[^date::now[]]
696: $DAYS_CONSIDERED_NEW(3)
697: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
698:
1.60 paf 699:
700: @checkList[]
701: ...^oneOf[a;a,b,c]...<br>
702: #...^oneOf[a;ax,b,c]...<br>
703: ...^oneWord[word]...<br>
704: #...^oneWord[wo rd]...<br>
705:
706:
707: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
708: $t[^list.lsplit[,]]
709: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
710: $result[$s]
711:
712: @oneWord[s]
713: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59 paf 714:
715: @pngsize[]
716: $i[^image::measure[test.png]]
717: ^i.html[]
718:
719:
720: @forkeys[]
721: $text[^form:fields.foreach[key;val]{$key=$val
722: }]
723: ^text.save[ttt.txt]
724: =$text=
725:
726:
727: @tstoredproc2[]
728: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
729: ^void:sql{exec pafvoid}
730: }
731:
732: @tstoredproc[]
733: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
734: $t[^table::sql{exec pafproc}]
735: # $t[^table::sql{{call pafproc}}]
736: $c[^t.columns[]]
737: ^c.menu{$c.column}[<br>]
738: }
1.57 paf 739:
740: @datecreatestring2[]
1.58 paf 741: <table border=1>
742: ^datecreatestring2show[2000]
743: ^datecreatestring2show[2000-02]
1.59 paf 744: ^datecreatestring2show[2000-2-03]
1.58 paf 745: ^datecreatestring2show[2000-02-03 15]
746: ^datecreatestring2show[2000-02-03 15:30]
747: ^datecreatestring2show[2000-02-03 15:30:04]
748: ^datecreatestring2show[2000-02-03 15:30:04 hren]
749: ^datecreatestring2show[15:30]
750: ^datecreatestring2show[15:30:05]
751: ^datecreatestring2show[15:30:05 hren]
752: </table>
753:
754: @datecreatestring2show[s]
755: $date[^date::create[$s]]
756: <tr>
757: <td>$s</td><td align=right>^date.sql-string[]</td>
758: </tr>
759:
1.57 paf 760:
761: @junctionprob[][l]
762: $l[123]
763: $a{$l}
764: ^junctionprobnested[$a]
765: @junctionprobnested[p]
766: $p
767:
768:
769: @callindirecttarget[]
770: callindirecttarget called
771: @callindirect[]
772: $f[$callindirecttarget]
773: ^f[]
774:
775: @xpath2[]
776: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
777: <doc>
778: <field-list>
779: <field name="aa"/>
780: <field name="bb"/>
781: </field-list>
782: </doc>
783: }]
784:
785: #^xdoc.string[]
786:
787: $fieldList[^xdoc.selectSingle[/doc/field-list]]
788: #^fieldList.childNodes._count[]
789: $fields[^fieldList.select[field]]
790: #^fields._count[]
791: ^fields.foreach[k;node]{
792: $node.nodeName<br>
793: }
794: @counter[filespec][f;s]
795: ^file:lock[$filespec]{
796: $f[^file::load[text;$filespec]]
797: $s[^eval($f.text+1)]
798: ^s.save[$filespec]
799: }
800: $s
1.56 paf 801:
802: @xmlspace[]
803: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
804: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
805: <people>
806: <man id="1" имя="word слово">
807: <name>1 2</name>
808: </man>
809: </people>
810: }}]
811: $xdoc[^xdoc.transform[global.xsl]]
812: $string[^xdoc.string[$.method[html]]]
813: ^string.save[a]
814: ^untaint[html]{$string}
815:
816: @badthrows[]
817: #^throw[a;b;]
818: ^throw[a;]
1.54 paf 819:
820: @mssqltypes1[]
821: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 paf 822: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
823: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
824: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
825: $t[^table::sql{select a from paf}]
826: ^t.count[]
1.54 paf 827: }
1.51 paf 828:
1.53 paf 829: @datecreatestring[]
1.54 paf 830: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 831: ^d.sql-string[]
1.52 paf 832:
833: @method[hash]
834: $hash.key
835: @mainZ[]
836: ^method[
837: $.key{code}
838: ]
839:
1.51 paf 840: @tablehasht[]
841: $t[^table::create{p
842: 1
843: 3
844: 2
845: 4}]
846:
847: $h[^t.hash[p]]
848:
849: =^h._count[]=
850:
851:
852: @sqldefaults[]
853: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
854: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
855: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
856: }
1.60 paf 857: =======
858: <hr>
859: OK
860: >>>>>>> 1.50
1.48 paf 861:
862: @tcrashlocaljunctionsv2[]
863: $a[
864: $b{ $c[1] }
865: ]
866: $b
867: $c
868:
869: @tcrashlocaljunctions[]
870: $var[aaa]
871: ^if(1){
872: ^tcrashlocaljunctions1[]
873: }
874:
875: $j
876:
1.49 paf 877: @tcrashlocaljunctions1[][var]
878: $var[varvalue]
1.48 paf 879: $j{
880: $var
881: }
1.49 paf 882: $j
1.48 paf 883:
884: @tjunctions[][tl]
885: $t[^t::create[]]
886: ^tjunctionsi[]
887:
888: @tjunctionsi[][tl]
889: $tl[12345]
890: ^t.tjunctionsm[
891: $.key{
892: $tl
893: }
894: ]
1.46 paf 895:
1.47 paf 896: @replacetest[]
897: $b[b]
898: $s[
899: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
900: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
901: ]
902: ^s.replace[^table::create{from to
903: ba !_}]
904:
905:
1.46 paf 906: @matchoptionpp[]
1.47 paf 907: #$ORIGINS(1)
1.46 paf 908: $s[
909: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47 paf 910: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
911: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
912: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
913: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
914: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
915: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
916: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
917: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
918: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 919: ]
920: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
921:
1.44 paf 922:
923: @txdocxnodechild[]
924: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
925: $xdoc.nodeName
926: ^xdoc.selectNumber[2*2]
1.45 paf 927: $xdoc:ELEMENT_NODE
1.44 paf 928:
929:
930: @tclasses[]
931: $t[^t::create[]]
932: ^t.method[]
933: <hr>
934: ^t.base_method[]
935:
1.40 paf 936:
937: @errort[]
1.42 paf 938: ^xdoc::create[a]
1.40 paf 939: #^throw[user;here;this]
940:
941: @tselectNumber[]
942: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
943: ^d.selectString[string(d/@attr)]<br>
944: ^d.selectNumber[2*2]<br>
945: ^d.selectNumber[number(/d/@n)+1]<br>
946:
1.34 paf 947:
1.36 paf 948: @invaliddate2[]
949: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
950:
951: @process2[]
952: ^^process{
953: ^process{
954: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
955: }
956: }
957:
1.35 paf 958: @casehashtext[]
959: $tt[1]
960: $tmp[
961: ^switch[$tt]{
962: ^case[1]{
963: $.aaa[123]
964: }
965: ^case[DEFAULT]{
966: $.bbb[456]
967: }
968: }
1.36 paf 969: shit!
1.35 paf 970: ]
1.36 paf 971: #$tmp
1.35 paf 972: $tmp.aaa
973:
974: @subjvaltest[]
975: $a12[val]
976: $b[12]
977: $a$b
978:
1.34 paf 979: @tableselect0[]
980: $person[^table::create{name height
981: paf 1.77
982: шохин 2.07
983: moko 1.77
984: }]
985: $nottoohigh[^person.select($person.height<2)]
986: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 987:
988: @transparams[]
989: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
990: $odoc[^idoc.transform[global.xsl;
991: $.param1['1']
992: $.param2['2']
993: ]]
994: <pre>^taint[^odoc.string[$.method[html]]]
995:
996: @memnotest1[]
997: ^for[i](0;4000){
998:
999: $xxxx[$i]
1000: $xxxx
1001:
1002: }
1003:
1004: @memnotest1notes[]
1005: одна итерация цикла:
1006: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 1007: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 1008: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1009: [Mon Apr 8 20:12:02 2002] "|| "
1010: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
1011: [Mon Apr 8 20:12:02 2002] 13:VALUE
1012: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 1013: [Mon Apr 8 20:12:02 2002] 14:CREATE_EWPOOL'469377+=24 wcodeframe -> 0 !optimize[1]''469401+=49 string -> 41 !optimize[7]'
1.32 paf 1014: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
1015: [Mon Apr 8 20:12:02 2002] 17:VALUE
1016: [Mon Apr 8 20:12:02 2002] "i" string
1017: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 1018: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
1019: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 1020: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
1021: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1022: [Mon Apr 8 20:12:02 2002] "| "
1023: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
1024: [Mon Apr 8 20:12:02 2002] 13:VALUE
1025: [Mon Apr 8 20:12:02 2002] "xxxx" string
1026: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
1027: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
1028: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 1029: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 1030: [Mon Apr 8 20:12:02 2002] <-ja returned
1031: [Mon Apr 8 20:12:02 2002] ja->
1032:
1033: 201/328=0.612804878049 %%optimized
1034:
1035: 1.
1036: CREATE_*POOL
1037: сделать
1038: *POOL_POOLED+CODE
1039: где
1040: wwrapper
1041: и(возможно) wcodeframe
1042: +string
1043: стековая переменная
1044:
1045: 2.
1046: избавиться от обёртки при возврате результата process [см. тело _for]
1047:
1048: 3.
1049: сделать callback для process, чтобы вынести invariants из _for & co.
1050:
1051: 4.
1052: @todo склеить get_element и write_value (при вставлении? write_value)
1053:
1054: 5.
1055: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
1056: обёртка сразу выбрасывается = не нужна]
1057:
1058: 6.
1059: process вариант получить именно string, без VString обёртки [часто обёртка
1060: сразу выбрасывается = не нужна]
1061:
1062: 7.
1063: string head, убить 8 байт неправильной link
1.31 paf 1064:
1065: @voidparams[]
1066: ^voidparamsm[$form:field]
1067:
1068: @voidparamsm[p]
1069: ^p.int(123)
1.29 paf 1070:
1.30 paf 1071: @rolls2[]
1072: $now[^date::now[]]
1073: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
1074: ^for[i](1;12){
1075: ^d.roll[month](-1) ^d.sql-string[]<br>
1076: }
1077:
1.29 paf 1078: @cacheexpireschanging[]
1079: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
1080: ^cache[^date::now(+4/24/60/60)]
1081: # ^cache(2)
1.30 paf 1082: # ^cache(0)
1.29 paf 1083: ^math:random(100)
1084: }
1085:
1086:
1087:
1088: @cacheexpiresfixed[]
1089: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
1090: ^math:random(100)
1091: }
1092:
1093: @dateoffsets[]
1094: $d[^date::create(^date::now[]+1/24/60)]
1095: #$d[^date::now(+1/24/60)]
1096: ^d.sql-string[]
1097: #$d
1.26 paf 1098:
1.28 paf 1099: @exceptionTypes[]
1100: # parser.compile ^test[} компиляция (непарная скобка, ...)
1101: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
1102: # number.zerodivision ^eval(1/0) ^eval(1%0)
1103: # number.format ^eval(abc*5)
1104: # file.missing ^file:delete[delme] not found
1105: # file.access ^table::load[.] no rights
1106: # image.format ^image::measure[index.html] not gif/jpg
1107: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
1108: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
1109: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
1110: # smtp.connect not found/timeout
1111: # smtp.execute communication error
1112:
1.26 paf 1113: @roll2[]
1114: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 1115: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 1116:
1.25 paf 1117:
1118: @rolls[]
1119: $d[^date::create(2002;4;4)]
1120: ^d.sql-string[]<br>
1121: ^for[i](1;7){
1122: ^d.roll[day](-1)
1123: ^d.sql-string[]<br>
1124: }
1125: <hr>
1126: $d[^date::create(2002;3;28)]
1127: ^d.sql-string[]<br>
1128: ^for[i](1;7){
1129: ^d.roll[day](+1)
1130: ^d.sql-string[]<br>
1131: }
1132: <hr>
1133: $d[^date::create(2002;12;3)]
1134: ^d.sql-string[]<br>
1135: ^for[i](1;14){
1136: ^d.roll[day](-1)
1137: ^d.sql-string[]<br>
1138: }
1139: <hr>
1140: $d[^date::create(2002;10;19)]
1141: ^d.sql-string[]<br>
1142: ^for[i](1;14){
1143: ^d.roll[day](+1)
1144: ^d.sql-string[]<br>
1145: }
1146:
1147:
1148:
1149:
1150:
1.22 paf 1151:
1152: @exceptions1[]
1153: ^try{
1154: aaa
1.24 paf 1155: ^throw[custom1;paf;is stupid]
1.22 paf 1156: }{
1.24 paf 1157: ^if($exception.type eq custom1){
1.28 paf 1158: # $exception.handled(1)
1159: ^throw[$exception]
1.24 paf 1160: type=$exception.type<br>
1161: source=$exception.source<br>
1162: file=$exception.file<br>
1163: lineno=$exception.lineno<br>
1164: comment=$exception.comment<br>
1165: }
1.22 paf 1166: }
1.21 paf 1167:
1168: @locate_by_expr[]
1169: $t[^table::create{a b
1170: 1 nok
1171: 2 ok
1172: 3 nok
1173: }]
1174: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 1175:
1176: @method_junction_params[param]
1177: ^if($param is junction){junction}{ne junction}
1178:
1179: @verifyCookie[value]
1180: ^if($cookie:dummyvote eq $value){
1181: $result(1)
1182: }{
1183: $cookie:dummyvote[$value]
1184: $result(0)
1185: }
1.16 paf 1186:
1187: @execlangs[]
1.20 paf 1188: $f[^file::exec[test.pl]]
1.36 paf 1189: err:$f.stderr<br>
1.16 paf 1190: ^process{$f.text}
1191: #$c[^t.columns[]]
1192: #^c.menu{
1193: #* $c.column<br>
1194: #}
1.36 paf 1195: c:$t.c<br>
1.16 paf 1196:
1197: @tobjeresult[]
1198: ^table::create{a
1199: 12}
1.15 paf 1200:
1201: @xmlprobs[]
1202: $xmlDataType[^xdoc::load[program.xml]]
1203: #<pre>^taint[^xmlDataType.string[]]
1204: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
1205: #=^xmlDataTypes._count[]=
1206: =^xmlDataTypes.0.getAttribute[type-id]=
1207:
1208: @doubleprobs[]
1209: $1(^math:radians(180))
1210: $2($math:PI)
1211: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
1212: ^if($1==$2){y;n}
1213: ^if(^math:radians(180)==$math:PI){y;n}
1214:
1215:
1216: @divnamestop[]
1217: $a(10)
1218: ^eval($a\3)
1219:
1220: @arrayclone[]
1221: $t[^table::create{a b
1222: 1 11
1223: 2 22
1224: }]
1225: $c[^table::create[$t]]
1226: ^c.append{2 33}
1227: ^t.count[]
1228: ^c.count[]
1229:
1230: @operator_tricks[]
1231: ^if(1){$a[^t[]]}
1232: $a!
1233: $a($b)
1234: ^if(1){y}{n}
1235: $MAIN:a(^t[] eq OK)
1236: #$MAIN:a(1)
1237: ^if($a){y}{n}
1238: #^if(1){y}{n}
1239: $form:if
1240: $a[$.n[1]]
1241: $a.if
1242:
1243: @xoutputrusattr[]
1244: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
1245: ^show_xdoc2[$d]
1246:
1247: @xdocset1[]
1248: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
1249: ^show_xdoc2[$d]
1250:
1251: @regexp3[]
1252: $s[abcАБВ]
1253: ^if(^s.match[][i]){y}{n}
1254:
1255:
1256: @exec2[]
1257: $a[^file::exec[bin/t.cmd]]
1258: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
1259:
1260:
1261: @tlock[]
1262: ^file:lock[lockfile]{
1263: code
1264: }
1265:
1266: @xmloutattrwithoutvalue[]
1267: #$ORIGINS(1)
1268: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
1269: $doc[^doc.transform[global.xsl]]
1270: =^taint[html][^doc.string[$.method[html]]]=
1271:
1272:
1273:
1274: @precisionProblem[]
1275: $a[123456789012345678901234567890]
1276: $b(^a.double[])
1277: ^b.format{%.20E}
1278: <hr>
1279: ^eval(2*2)
1280:
1281: @xpath[]
1282: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1283: <document><block><p>привет</p></block></document>
1284: }]
1285: #^show_xdoc2[$xdoc]
1286: $node[^xdoc.selectSingle[/document/block/p]]
1287: ^if(def $node){
1288: ^if($node is string){
1289: $node
1290: }{
1291: ^if($node is hash){
1292: ^node._count[]
1293: }{
1294: $node.nodeType
1295: }
1296: }
1297: #$node.firstChild.nodeValue
1298: }{
1299: node not found
1300: }
1301:
1302:
1303: @ttablesetlang[]
1304: $a-tab-b[a b
1305: 1 2]
1306:
1307: $t[^table::set{$a-tab-b}]
1308: =$t.a=
1309: <hr>
1310:
1311: $t[^table::set[nameless]{^taint[$a-tab-b]}]
1312: =$t.0=
1313: <hr>
1314:
1315: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
1316: =$t.a=
1317:
1318: #^t.append{1 2}
1319:
1320: @mail3[]
1321: ^mail:send[
1.98 paf 1322: $.from[Александр Петросян <paf@mail.design.ru>]
1323: $.to[Александр Петросян <paf@mail.design.ru>]
1324: $.subject[проверка2]
1.15 paf 1325: $.body[
1326: $.text[
1327: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1.98 paf 1328: $.body[проверка^taint[uri][москва]=]
1.15 paf 1329: ]
1330: $.attachment[
1331: $.value[^file::load[text;index.html]]
1332: $.file-name[привет всем.html]
1333: ]
1334: ]
1335: ]
1336:
1337:
1338: @ttime[]
1339: $now[^date::now[]]
1340: $now.hour:$now.minute
1341:
1342: @tupper[]
1343: $t[abcABCабвАБВ]
1344: $t<br>
1345: ^t.upper[]
1346:
1347: @treplace[]
1348: $copy-paste-clean[^table::set{a b
1349: . _
1350: , _
1351: + _
1352: & _
1353: ? _
1354: = _}]
1355:
1356: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
1357: # почему-то этот replace роняет апач в 500 ошибку :(
1358: #^cache_key.replace[$copy-paste-clean]
1359: $test[abc]
1360: ^test.save[$cache_key]saved<br>
1361: $cache[^file:list[.;\.cache^$]]
1362: ^file:delete[$cache_key]deleted($cache.name)<br>
1363:
1364:
1365:
1366: @xslt2[]
1367: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1368: <document><block><p>привет</p></block></document>
1369: }]
1370: ^show_xdoc2[$xdoc]
1371: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
1372: <hr>
1373:
1374:
1375: @tcache2[]
1376: ^cache[$DB_HOME/keyключ](2){
1377: ^math:random(100)
1378: }
1379:
1380: @ttaintuntaint[]
1381: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
1382:
1383: ]zz
1384: <hr>
1385: ^untaint[html]{1^taint[ ]2 3}
1386:
1387:
1388: @tappend2[]
1389: $t[^table::set{a b}]^t.append{1 2}$t.a
1390:
1391: @badvsnprintf[]
1392: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
1393: }
1394:
1395:
1396: @badoracequoting[]
1397: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
1398: ^connect[$SQL.connect-string]{
1399: ^void:sql{delete from paf}
1400: ^void:sql{insert into paf values (1, '$form:text')}
1401: $paf[^table::sql{select * from paf}]
1402: ^paf.menu{
1403: $paf.id: ^untaint{$paf.block}<hr>
1404:
1405: }
1406: <hr>
1407:
1408:
1409: ^rem{
1410: $news[^table::sql{select description from news}[$.limit(3)]]
1411: ^news.menu{
1412: ^untaint{$news.description}<hr>
1413:
1414: }
1415: <hr>
1416: }
1417:
1418: $tables[^table::sql{select table_name from user_tables}]
1419: ^tables.menu{
1420: $tables.table_name<br>
1421: }
1422:
1423: }
1424: <hr>
1425: $env:PATH
1426:
1427: @badconstructors[]
1428: $bred[^string::length[]]
1429: $bred[^response::clear[]]
1430: $bred[^int::int[]]
1431:
1432:
1433: @xloadwrongtable[]
1434: $constr[^xdoc::load[wrongtable.xml]]
1435: ^show_xdoc2[$constr]
1436:
1437: @xsetwrongtable[]
1438: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
1439: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1440:
1441:
1442: @tablecolumnerror[]
1443: $t[^table::set{a}]
1444: $t.$a
1445:
1446: @roll[]
1447: #$date[^date::set(1970;1;2)]
1448: #^date.roll[month](-1)
1449: $date[^date::set(2038;1;1)]
1450: ^date.roll[month](+1)
1451: $date.year $date.month $date.day
1452:
1453: @cookie2[]
1454: #=$cookie:clientType[$.value[test]]=<br>
1455: =$cookie:clientType=<br>
1456:
1457:
1458: @tableset[]
1459: $a[^table::set{a
1460: 1
1461: 2}]
1462: ^eval(100\$a)
1463:
1464:
1465:
1466: @zzz[]
1467:
1468:
1469: $constructor[
1470: <block1 name="main_srvr" type="0" label="Основное тело" />
1471: <block2 name="main_srvr2" type="0" label="Основное тело" />
1472: ]
1473:
1474: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1475: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1476:
1477: $children[$constr.documentElement.childNodes]
1478: ^if($children){
1479: ^for[i](1;^children._count[]){
1480: $node[$children.$i]
1481: $node.nodeName<br>
1482: }
1483: }
1484:
1485:
1486: @thashforeach3[]
1487: $h[
1488: $.a[1]
1489: $.b[2]
1490: ]
1491: $c[^table::set{a
1492: ^h.foreach[key;value]{$value
1493: }}]
1494: $c.a
1495:
1496: @thashforeach2[]
1497: $h[
1498: $.a[1]
1499: $.b[2]
1500: ]
1501: $c[
1502: ^h.foreach[key;value]{
1503: $.$key[$value]
1504: }
1505: ]
1506: $c.b
1507:
1508: @thashforeach[]
1509: $h[
1510: $.a[1]
1511: $.b[2]
1512: ]
1513: ^h.foreach[key;value]{
1514: $key=$value<br>
1515: }
1516:
1517: @thashdelete[]
1518: $h[$.a[1] $.b[2]]
1519: was:<br>
1520: count=^h._count[] <br>
1521: b='$h.b' <br>
1522:
1523: ^h.delete[b]
1524:
1525: now:<br>
1526: count=^h._count[] <br>
1527: b='$h.b'
1528:
1529: @sappend[]
1530: $test[123]
1531: ^test.save[test]
1532: ^test.save[append;test]
1533:
1534: @tappend[]
1535: $test[^table::set{a b
1536: a1 b1}]
1537: ^test.save[test]
1538: $test[^table::set{a b
1539: a2 b2}]
1540: ^test.save[append;test]
1541:
1542:
1543: @tform[]
1544: ^if(def $form:new_file){y}{n}
1545: <form method="post" enctype="multipart/form-data">
1546: <input type="file" name="new_file" />
1547: <input type=submit>
1548: </input>
1549:
1550: @formattest[]
1551: $size(15.124)
1552:
1553: ^size.format{%.2f}
1554:
1555: @filelist[]
1556: $html[^file:list[.;\.html^$]]
1557: ^html.menu{
1558: $html.name<br>
1559: }
1560: <hr>
1561:
1562: @безнадёжна_попытка_поправить_непоправимое[]
1563: $dom_from_disk[^xdoc::load[input.xml]]
1564: $dom_created_in_air[^xdoc::create[doc]]
1565: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
1566: ^show_xdoc2[$dom_created_in_air]
1567:
1568:
1569: @tcache[]
1570: #^hashfile:clear[cache]
1571: $code[^hashfile::open[$DB_HOME;cache]]
1572: ^code.cache[key](2){
1573: ^math:random(100)
1574: # ^code.delete[]
1575: }
1576:
1577: @thashfileexp[]
1578: $hf[^hashfile::open[$DB_HOME;hashfile]]
1579: $hf.paf[$.value[крут] $.expires(3)]
1580: paf=$hf.paf
1581: <hr>
1582: ^hf.foreach[key;value]{
1583: $key=$value<br>
1584: }
1585: <hr>
1586: $hash[^hf.hash[]]
1587: =$hash.paf=
1588: <hr>
1589:
1590: @tcounter[]
1591: ^tcounterone[$DB_HOME]
1592: other root:
1593: ^tcounterone[${DB_HOME}2]
1594: again, first:
1595: ^tcounterone[$DB_HOME]
1596:
1597: @tcounterone[DB_HOME]
1598: $counter[^hashfile::open[$DB_HOME;counter]]
1599: #^counter.clear[]
1600: ^counter.transaction{
1601: # $counter.value(10)
1602: $counter.value($counter.value+1)
1603: # ^counter.delete[value]
1604: $counter.value
1605: }
1606: <hr>
1607: ^rem{
1608: $hash[^counter.hash[]]
1609: =$hash.value=
1610: <hr>
1611: }
1612:
1613: @tablehash[]
1614: $productList[^table::set{id name
1615: 1 носки
1616: 2 валенки
1617: 3 ушанка
1618: }]
1619:
1620: #скажем, у первого дилера
1621: $firstPriceList[^table::set{id price
1622: 1 0.3
1623: 3 1000
1624: }]
1625:
1626: $firstPriceHash[^firstPriceList.hash[id]]
1627:
1628: ^productList.menu{
1629: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
1630: }
1631:
1632:
1633: @hashfile[]
1634: $hf[^hashfile::assign[hashfile]]
1635: #$hf.paf[крут5]
1636: paf=$hf.paf
1637:
1638: @formclass[]
1639: ^$form:CLASS.a=$form:CLASS.a
1640:
1641: @domdata[]
1642: ^if(1){
1643: # $a{^hren[]}
1644: }
1645: $a
1646: $xdoc[^xdoc::create[doc]]
1647: $doc[$xdoc.documentElement]
1648: $name[^doc.appendChild[^xdoc.createElement[name]]]
1649: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1650: ^untaint[as-is]{=$text.nodeValue=}
1651:
1652: @domedit[]
1653: ^domdata[]
1654: #$paf.nodeName<br>
1655: #$doc.documentElement.nodeName<br>
1656:
1657: ^show_xnode1[$xdoc.documentElement;0;1]
1658: <hr>
1659: ^show_xdoc2[$xdoc]
1660: <hr>
1661:
1662: @domxslt[]
1663: ^domdata[]
1664: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1665: <hr>
1666:
1667: @lsplit2[]
1668: $path[/optics/]
1669: $pathTable[^path.lsplit[/]]
1670: ^pathTable.menu{
1671: ^if(def $pathTable.piece){
1672: =$pathTable.piece=
1673: }
1674: }
1675:
1676:
1677: @faceesize[]
1678: $k(2)
1679: $pict[^image::load[paf.gif]]
1680: $small[^image::create($pict.width/$k;$pict.height/$k)]
1681: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1682: $response:body[^small.gif[]]
1683:
1684: @imageresize[]
1685: $k(2)
1686: $pict[^image::create(400*$k;200*$k)]
1687: $pict.line-width(2)
1688: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1689: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1690: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1691: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
1692: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
1693: $response:body[^pict.gif[]]
1694:
1695: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1696: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1697: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1698:
1699: #$response:body[^small.gif[]]
1700:
1701:
1702: @tintdefault[]
1703: #$abc[abc]
1704: $abc[33]
1705: ^abc.int[z]
1706: #^abc.int(123)
1707:
1708: @ifassignhash[]
1709: $h[^if(1){$.a(1);$.a(2)}]
1710: $h.a
1711:
1712: @ifpasshash[]
1713: $a[$.e[a]]
1714: $b[$.e[b]]
1715: ^ifpasshashdest[^if(1){$a;$b}]
1716: #$x[^if(1){$a}{$b}]
1717: #^ifpasshashdest[$x]
1718:
1719: @ifpasshashdest[p]
1720: $p.e
1721:
1722: @movedir[]
1723: ^file:move[a;deeper/a]
1724:
1725: @replace[]
1726: $a[12^;3]
1727: ^a.replace[^table::set{from to
1728: 2^; !
1729: }]
1730:
1731:
1732: @set[]
1733: ^setdata[]
1734: ^a.add[$b]
1735: add:$a.3<br>
1736:
1737: ^setdata[]
1738: ^a.sub[$b]
1739: sub2:$a.2<br>
1740: sub1:$a.1<br>
1741:
1742: ^setdata[]
1743: $c[^a.union[$b]]
1744: union3:$c.3<br>
1745: union2:$c.2<br>
1746:
1747: ^setdata[]
1748: $c[^a.intersection[$b]]
1749: intersection3:$c.3<br>
1750: intersection2:$c.2<br>
1751:
1752: ^setdata[]
1753: intersects:^if(^a.intersects[$b]){y;n}<br>
1754: intersects2:^if(^a.intersects[ ]){y;n}<br>
1755:
1756:
1757: <hr>
1758:
1759: @setdata[]
1760: $a[$.1[a1] $.2[a2]]
1761: $b[ $.2[b2] $.3[b3]]
1762:
1763:
1764: @hash[]
1765: $h[^hash::create[$._default[123]]]
1766: $h.paf[not kretin]
1767: $h.paf<br>
1768: =$h.that=<br>
1769:
1770: @methresult[]
1771: $result[^table::set{1}]
1772:
1773: @terror[]
1774: ^error[method z must be called with z]
1775:
1776: @syntax1[]
1777: #^a[^b]
1778:
1779: @syntax2[]
1780: #^a[
1781:
1782: @ssave[]
1783: $abc[abc]
1784: ^abc.save[abc]
1785:
1786: @calendar[]
1.103 paf 1787: $year(2002)
1788: $month(12)
1.84 paf 1789: ${year}-${month}:<br>
1790: $week_days[^date:calendar[rus]($year;$month)]
1.15 paf 1791: <pre>
1.101 paf 1792: ^week_days.menu{^for[wday](0;6){^if($week_days.$wday){$week_days.$wday; ^; ^;} }=$week_days.week,$week_days.year=<br>}
1.15 paf 1793: </pre>
1794:
1795: @thash[]
1796: $table[^table::set{id name age
1797: 1 paf 278
1798: 2 пиф 234
1799: }]
1800: $hash[^table.hash[id;^table::set[nameless]{id
1801: name}]]
1802: $hash.2.id $hash.2.name $hash.2.age
1803:
1804: @tdef[]
1805: $s[0]
1806: if 0=^if($s){}{n}<br>
1807: if def 0=^if(def $s){y}{}<br>
1808: <hr>
1809:
1810: @ford[]
1811: ^for[i](0;5){$i}{($i)}
1812:
1813: @tif[]
1814: ^if[def]{y;n}
1815:
1816: @image[]
1817: $pict[^image::create(400;200)]
1818: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1819: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
1820: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1821: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
1822: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1823: $response:body[^pict.gif[]]
1824:
1825:
1826:
1827: @mail2[]
1828: ^mail:send[
1829: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1830: $.from[Александр Петросян <paf@design.ru>]
1831: $.to[Александр Петросян <paf@design.ru>]
1832: $.subject[проверка]
1833: $.body[проверка]
1834: ]
1835:
1836: @cookie[]
1.115 paf 1837: #$env:HTTP_COOKIE<br>
1.15 paf 1838:
1839: #$cookie:переменная[test тест ТЕСТ2]
1840: =$cookie:переменная=<br>
1841: #$cookie:переменная2[test тест ТЕСТ3]
1842: =$cookie:переменная2=<br>
1843: =$cookie:CLASS.переменная2=<br>
1844:
1845: @response[]
1846: #^if($form:reload){
1847: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1848: #}
1849:
1850: @xslt[]
1851: ^xdata[]
1852: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
1853: ^show_xdoc2[$transformed]
1854:
1855: @regexp2[]
1856: $s[ select]
1857: $s[^s.match[^^\s*][]{!}]
1858: $s
1859:
1860: @header[]
1861: $response:refresh[
1862: $.value[0]
1863: $.url[http://design.ru?a=^taint[123]]
1864: ]
1865:
1866: @ttablerem[]
1867: $table[^table::load[a.cfg]]
1868: ^table.menu{$table.a}
1869:
1870: @tconnect[]
1871: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1872: $tables[^table::sql{show tables}]
1873: #$cols[^tables.columns[]]
1874: #$cols.column
1875: ^tables.menu{
1876: $tables.[Tables_in_test]<br>
1877: }
1878: }
1879:
1880: @pcre[]
1881: $s[1 2]
1882: ^s.match[\s;ig]{!}
1883: #^s.match[\d;ig]{!}
1884:
1885:
1886: @regexp[]
1887: $s[abcАБВ]
1888: ^if(^s.match[б][i]){y}{n}
1889:
1890: @mail[]
1891: #$ORIGINS(1)
1892: ^mail:send[
1893: $.from[paf@design.ru]
1894: $.to[paf@design.ru]
1895: $.body[1
1896:
1897: 2
1898:
1899:
1900: 3]
1901: ]
1902:
1903: @exec[]
1904: $a[^file::exec[fc.exe;;a;b]]
1905: $a.status|$a.stderr<hr>
1906:
1907: @fori[][i]
1908: ^for[i](1;3){... =$i= ...}
1909:
1910: @xdata0[]
1911: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1912: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1913: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1914: <people>
1915: <man id="1" имя="word слово">
1916: <name>P«^;AF B</name>
1917: </man>
1918: <man id="2">
1919: <name>ПИФ^taint[&]</name>
1920: </man>
1921: </people>
1922: }]
1923:
1924: @xdata[]
1925: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1926: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1927: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1928: <people>
1929: <man id="1" имя="word слово">
1930: <name>P«^;AF B</name>
1931: </man>
1932: <man id="2">
1933: <name>ПИФ^taint[&]</name>
1934: </man>
1935: </people>
1936: }}]
1937:
1938: @xml[]
1939: ^xdata[]
1940:
1941: ^show_xdoc2[$xdoc]<hr>
1942: #^show_xnode1[$xdoc]<hr>
1943: $people[^xdoc.select[*/man]]
1944: #^show1[]
1945: ^show_xnodes1[$people]<hr>
1946: #^people.0.owner.hren[]
1947:
1948: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1949:
1950: by id:
1951: ^show_xnode1[^xdoc.getElementById[1];0;1]
1952: <hr>
1953:
1954: @show1[array]
1955: ^for[i](0;^array._count[]-1){
1956: $x[$array.$i]
1957: $x.firstChild.nodeValue:
1958: $pattributes[$x.parentNode.attributes]
1959: ^if(^pattributes._count[]){
1960: $pattributes.id.name=$pattributes.id.nodeValue
1961: }
1962: <br>
1963: }
1964:
1965: @show_xnodes1[array][i]
1966: ^for[i](0;^array._count[]-1){
1967: ^show_xnode1[$array.$i;0;1]
1968: }
1969:
1970: @show_xnode1[x;level;single][l]
1971: ^if(def $x){
1972: ^for[l](0;$level-1){ ^; ^; ^; ^;}
1973: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1974: <^;$x.nodeName
1975: $pairs[$x.attributes]
1976: ^if(def $pairs){
1977: $names[^pairs._keys[]]
1978: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
1979: }
1980: >^;
1981: }{
1982: [$x.nodeType]
1983: }
1984:
1985: ^if(def $x.nodeValue){$x.nodeValue}<br>
1986: ^show_xnode1[$x.firstChild]($level+1)
1987: ^if(!$single){
1988: ^show_xnode1[$x.nextSibling]($level)
1989: }
1990:
1991: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1992: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
1993: }
1994: }
1995:
1996: @show_xdoc2[xdoc]
1997: ^xdoc.save[out/save.xml;
1998: # $.encoding[utf-8]
1999: $.method[xml]
2000: ]
2001: $file[^xdoc.file[
2002: $.encoding[utf-8]
2003: $.method[html]
2004: ]]
2005: ^file.save[text;out/save_file.html]
2006: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
2007: <pre>^taint[html][^xdoc.string[
2008: $.method[html]
2009: # $.encoding[utF-8]
2010: # $.omit-xml-declaration[yes]
2011: # $.standalone[no]
2012: # -$.doctype-public[-//W3C//DTD XHTML]
2013: # -$.doctype-system[/a/b/c/]
2014: # $.indent[yes]
2015: # $.media-type[text/paf]
2016: ]]
2017: </pre>
E-mail: