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