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