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