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