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