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