Annotation of parser3/www/htdocs/index.html, revision 1.56
1.42 paf 1: @USE
2: t.p
1.15 paf 3:
4: @autoz[]
5: $request:charset[windows-1251]
6: $response:charset[windows-1251]
7: $response:content-type[$.value[text/html]$.charset[$response:charset]]
8:
1.51 paf 9: @postprocess[body]
1.55 paf 10: #=$env:HTTP_TEST=<br>
11: #=$env:REDIRECT_HTTP_TEST=<br>
12: #<hr>
1.51 paf 13: $body
14: <hr>
15: OK
1.37 paf 16:
1.15 paf 17: @main[]
1.51 paf 18: #^sqldefaults[]
1.49 paf 19: #^eval(2)
1.48 paf 20: #^tcrashlocaljunctionsv2[]
1.49 paf 21: #^tcrashlocaljunctions[]
1.50 paf 22: #^tjunctions[]
1.47 paf 23: #^replacetest[]
1.48 paf 24: #^matchoptionpp[]
1.46 paf 25: #^txdocxnodechild[]
1.44 paf 26: #^tclasses[]
1.43 paf 27: #$math:PI
28: #^b:method[]
1.42 paf 29: #^main[]
1.41 paf 30: #^errort[]
1.44 paf 31: #^tselectNumber[]
1.39 paf 32: #$result[hello]
1.36 paf 33: #^invaliddate2[]
34: #^process2[]
35: #^casehashtext[]
1.35 paf 36: #^subjvaltest[]
37: #^tableselect0[]
1.34 paf 38: #^memnotest1[]
1.33 paf 39: #^transparams[]
1.32 paf 40: #^voidparams[]
1.31 paf 41: #^rolls2[]
1.30 paf 42: #^cacheexpireschanging[]
1.29 paf 43: #^cacheexpiresfixed[]
44: #^dateoffsets[]
45: #^exceptionTypes[]
1.28 paf 46: #^roll2[]
1.27 paf 47: #^rolls[]
1.25 paf 48: #^exceptions1[]
1.22 paf 49: #^locate_by_expr[]
1.18 paf 50: #^method_junction_params{...}
1.17 paf 51: #^verifyCookie[paf]
1.37 paf 52: #^execlangs[]
1.16 paf 53: #$t[^tobjeresult[]]$t.a
54: #^xmlprobs[]
1.15 paf 55: #^doubleprobs[]
56: #^math:random(-10)
57: #^divnamestop[]
58: #^arrayclone[]
59: #^operator_tricks[]
60: #^xoutputrusattr[]
61: #^xdocset1[]
62: #^regexp3[]
63: #^exec2[]
64: #^tlock[]
65: #^xmloutattrwithoutvalue[]
66: #^precisionProblem[]
67: #^xpath[]
68: #^ttablesetlang[]
69: #^mail3[]
70: #^ttime[]
71: #^tupper[]
72: #^treplace[]
73: #^xslt2[]
74: #^tcache2[]
75: #$ORIGINS(1)
76: #$t[^table::set{a b} ^table::set{c d}]
77: #^ttaintuntaint[]
78: #^tappend2[]
79: #^badvsnprintf[]
80: #^badoracequoting[]
81: #^badconstructors[]
82: #^xloadwrongtable[]
83: #^xsetwrongtable[]
84: #^if($form:test){y}{n}
85: #^tablecolumnerror[]
86: #^roll[]
87: #^cookie2[]
88: #^tableset[]
89: #^math:PI.format{%.30f}
90: #^xchildren[]
91: #^thashforeach3[]
92: #^thashforeach2[]
93: #^thashforeach[]
94: #^thashdelete[]
95: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
96: #^tappend[]
97: #^sappend[]
98: #^eval(10\3)<br>
99: #^tform[]
100: #^formattest[]
101: #^filelist[]
102: #^connect[mysql://user:pass@host]{ }
103: #^безнадёжна_попытка_поправить_непоправимое[]
104: #^tcache[]
105: #^thashfileexp[]
106: #^tcounter[]
107: #^tablehash[]
108: #j^hashfile[]
109: #^formclass[]
110: #^hren[]
111: #^domedit[]
112: #^domxslt[]
113: #^lsplit2[]
114: #^faceesize[]
115: #^imageresize[]
116: #^ifassignhash[]
117: #^tintdefault[]
118: #$response:status[404]
119: #^ifpasshash[]
120: #^movedir[]
121: #^replace[]
122: #^set[]
123: #^hash[]<hr>
124: #$t[^methresult[]] ->$t
125: #^terror[]
126: #^ssave[]
127: #^calendar[]
128: #^thash[]
129: #^tdef[]
130: #^ford[]
131: #^tif[]
132: #^image[]
133: #^mail2[]
134: #^cookie[]
135: #^response[]
136: #^regexp2[]
137: #^ttablerem[]
138: #^pcre[]
139: #^regexp[]<hr>
140: #^mail[]
141: #^exec[]
142: #^fori[]
143: #^tconnect[]
144: #^xslt[]
145: #^xml[]
146: #^header[]
1.53 paf 147: #^tablehasht[]
1.56 ! paf 148:
1.54 paf 149: #^datecreatestring[]
1.56 ! paf 150: #^mssqltypes1[]
! 151: #^badthrows[]
! 152: ^xmlspace[]
! 153:
! 154: @xmlspace[]
! 155: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
! 156: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
! 157: <people>
! 158: <man id="1" имя="word слово">
! 159: <name>1 2</name>
! 160: </man>
! 161: </people>
! 162: }}]
! 163: $xdoc[^xdoc.transform[global.xsl]]
! 164: $string[^xdoc.string[$.method[html]]]
! 165: ^string.save[a]
! 166: ^untaint[html]{$string}
! 167:
! 168: @badthrows[]
! 169: #^throw[a;b;]
! 170: ^throw[a;]
1.54 paf 171:
172: @mssqltypes1[]
173: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 paf 174: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
175: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
176: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
177: $t[^table::sql{select a from paf}]
178: ^t.count[]
1.54 paf 179: }
1.51 paf 180:
1.53 paf 181: @datecreatestring[]
1.54 paf 182: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 183: ^d.sql-string[]
1.52 paf 184:
185: @method[hash]
186: $hash.key
187: @mainZ[]
188: ^method[
189: $.key{code}
190: ]
191:
1.51 paf 192: @tablehasht[]
193: $t[^table::create{p
194: 1
195: 3
196: 2
197: 4}]
198:
199: $h[^t.hash[p]]
200:
201: =^h._count[]=
202:
203:
204: @sqldefaults[]
205: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
206: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
207: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
208: }
1.48 paf 209:
210: @tcrashlocaljunctionsv2[]
211: $a[
212: $b{ $c[1] }
213: ]
214: $b
215: $c
216:
217: @tcrashlocaljunctions[]
218: $var[aaa]
219: ^if(1){
220: ^tcrashlocaljunctions1[]
221: }
222:
223: $j
224:
1.49 paf 225: @tcrashlocaljunctions1[][var]
226: $var[varvalue]
1.48 paf 227: $j{
228: $var
229: }
1.49 paf 230: $j
1.48 paf 231:
232: @tjunctions[][tl]
233: $t[^t::create[]]
234: ^tjunctionsi[]
235:
236: @tjunctionsi[][tl]
237: $tl[12345]
238: ^t.tjunctionsm[
239: $.key{
240: $tl
241: }
242: ]
1.46 paf 243:
1.47 paf 244: @replacetest[]
245: $b[b]
246: $s[
247: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
248: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
249: ]
250: ^s.replace[^table::create{from to
251: ba !_}]
252:
253:
1.46 paf 254: @matchoptionpp[]
1.47 paf 255: #$ORIGINS(1)
1.46 paf 256: $s[
257: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47 paf 258: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
259: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
260: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
261: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
262: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
263: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
264: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
265: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
266: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 267: ]
268: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
269:
1.44 paf 270:
271: @txdocxnodechild[]
272: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
273: $xdoc.nodeName
274: ^xdoc.selectNumber[2*2]
1.45 paf 275: $xdoc:ELEMENT_NODE
1.44 paf 276:
277:
278: @tclasses[]
279: $t[^t::create[]]
280: ^t.method[]
281: <hr>
282: ^t.base_method[]
283:
1.40 paf 284:
285: @errort[]
1.42 paf 286: ^xdoc::create[a]
1.40 paf 287: #^throw[user;here;this]
288:
289: @tselectNumber[]
290: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
291: ^d.selectString[string(d/@attr)]<br>
292: ^d.selectNumber[2*2]<br>
293: ^d.selectNumber[number(/d/@n)+1]<br>
294:
1.34 paf 295:
1.36 paf 296: @invaliddate2[]
297: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
298:
299: @process2[]
300: ^^process{
301: ^process{
302: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
303: }
304: }
305:
1.35 paf 306: @casehashtext[]
307: $tt[1]
308: $tmp[
309: ^switch[$tt]{
310: ^case[1]{
311: $.aaa[123]
312: }
313: ^case[DEFAULT]{
314: $.bbb[456]
315: }
316: }
1.36 paf 317: shit!
1.35 paf 318: ]
1.36 paf 319: #$tmp
1.35 paf 320: $tmp.aaa
321:
322: @subjvaltest[]
323: $a12[val]
324: $b[12]
325: $a$b
326:
1.34 paf 327: @tableselect0[]
328: $person[^table::create{name height
329: paf 1.77
330: шохин 2.07
331: moko 1.77
332: }]
333: $nottoohigh[^person.select($person.height<2)]
334: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 335:
336: @transparams[]
337: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
338: $odoc[^idoc.transform[global.xsl;
339: $.param1['1']
340: $.param2['2']
341: ]]
342: <pre>^taint[^odoc.string[$.method[html]]]
343:
344: @memnotest1[]
345: ^for[i](0;4000){
346:
347: $xxxx[$i]
348: $xxxx
349:
350: }
351:
352: @memnotest1notes[]
353: одна итерация цикла:
354: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 355: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 356: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
357: [Mon Apr 8 20:12:02 2002] "|| "
358: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
359: [Mon Apr 8 20:12:02 2002] 13:VALUE
360: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 361: [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 362: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
363: [Mon Apr 8 20:12:02 2002] 17:VALUE
364: [Mon Apr 8 20:12:02 2002] "i" string
365: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 366: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
367: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 368: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
369: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
370: [Mon Apr 8 20:12:02 2002] "| "
371: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
372: [Mon Apr 8 20:12:02 2002] 13:VALUE
373: [Mon Apr 8 20:12:02 2002] "xxxx" string
374: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
375: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
376: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 377: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 378: [Mon Apr 8 20:12:02 2002] <-ja returned
379: [Mon Apr 8 20:12:02 2002] ja->
380:
381: 201/328=0.612804878049 %%optimized
382:
383: 1.
384: CREATE_*POOL
385: сделать
386: *POOL_POOLED+CODE
387: где
388: wwrapper
389: и(возможно) wcodeframe
390: +string
391: стековая переменная
392:
393: 2.
394: избавиться от обёртки при возврате результата process [см. тело _for]
395:
396: 3.
397: сделать callback для process, чтобы вынести invariants из _for & co.
398:
399: 4.
400: @todo склеить get_element и write_value (при вставлении? write_value)
401:
402: 5.
403: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
404: обёртка сразу выбрасывается = не нужна]
405:
406: 6.
407: process вариант получить именно string, без VString обёртки [часто обёртка
408: сразу выбрасывается = не нужна]
409:
410: 7.
411: string head, убить 8 байт неправильной link
1.31 paf 412:
413: @voidparams[]
414: ^voidparamsm[$form:field]
415:
416: @voidparamsm[p]
417: ^p.int(123)
1.29 paf 418:
1.30 paf 419: @rolls2[]
420: $now[^date::now[]]
421: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
422: ^for[i](1;12){
423: ^d.roll[month](-1) ^d.sql-string[]<br>
424: }
425:
1.29 paf 426: @cacheexpireschanging[]
427: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
428: ^cache[^date::now(+4/24/60/60)]
429: # ^cache(2)
1.30 paf 430: # ^cache(0)
1.29 paf 431: ^math:random(100)
432: }
433:
434:
435:
436: @cacheexpiresfixed[]
437: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
438: ^math:random(100)
439: }
440:
441: @dateoffsets[]
442: $d[^date::create(^date::now[]+1/24/60)]
443: #$d[^date::now(+1/24/60)]
444: ^d.sql-string[]
445: #$d
1.26 paf 446:
1.28 paf 447: @exceptionTypes[]
448: # parser.compile ^test[} компиляция (непарная скобка, ...)
449: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
450: # number.zerodivision ^eval(1/0) ^eval(1%0)
451: # number.format ^eval(abc*5)
452: # file.missing ^file:delete[delme] not found
453: # file.access ^table::load[.] no rights
454: # image.format ^image::measure[index.html] not gif/jpg
455: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
456: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
457: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
458: # smtp.connect not found/timeout
459: # smtp.execute communication error
460:
1.26 paf 461: @roll2[]
462: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 463: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 464:
1.25 paf 465:
466: @rolls[]
467: $d[^date::create(2002;4;4)]
468: ^d.sql-string[]<br>
469: ^for[i](1;7){
470: ^d.roll[day](-1)
471: ^d.sql-string[]<br>
472: }
473: <hr>
474: $d[^date::create(2002;3;28)]
475: ^d.sql-string[]<br>
476: ^for[i](1;7){
477: ^d.roll[day](+1)
478: ^d.sql-string[]<br>
479: }
480: <hr>
481: $d[^date::create(2002;12;3)]
482: ^d.sql-string[]<br>
483: ^for[i](1;14){
484: ^d.roll[day](-1)
485: ^d.sql-string[]<br>
486: }
487: <hr>
488: $d[^date::create(2002;10;19)]
489: ^d.sql-string[]<br>
490: ^for[i](1;14){
491: ^d.roll[day](+1)
492: ^d.sql-string[]<br>
493: }
494:
495:
496:
497:
498:
1.22 paf 499:
500: @exceptions1[]
501: ^try{
502: aaa
1.24 paf 503: ^throw[custom1;paf;is stupid]
1.22 paf 504: }{
1.24 paf 505: ^if($exception.type eq custom1){
1.28 paf 506: # $exception.handled(1)
507: ^throw[$exception]
1.24 paf 508: type=$exception.type<br>
509: source=$exception.source<br>
510: file=$exception.file<br>
511: lineno=$exception.lineno<br>
512: comment=$exception.comment<br>
513: }
1.22 paf 514: }
1.21 paf 515:
516: @locate_by_expr[]
517: $t[^table::create{a b
518: 1 nok
519: 2 ok
520: 3 nok
521: }]
522: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 523:
524: @method_junction_params[param]
525: ^if($param is junction){junction}{ne junction}
526:
527: @verifyCookie[value]
528: ^if($cookie:dummyvote eq $value){
529: $result(1)
530: }{
531: $cookie:dummyvote[$value]
532: $result(0)
533: }
1.16 paf 534:
535: @execlangs[]
1.20 paf 536: $f[^file::exec[test.pl]]
1.36 paf 537: err:$f.stderr<br>
1.16 paf 538: ^process{$f.text}
539: #$c[^t.columns[]]
540: #^c.menu{
541: #* $c.column<br>
542: #}
1.36 paf 543: c:$t.c<br>
1.16 paf 544:
545: @tobjeresult[]
546: ^table::create{a
547: 12}
1.15 paf 548:
549: @xmlprobs[]
550: $xmlDataType[^xdoc::load[program.xml]]
551: #<pre>^taint[^xmlDataType.string[]]
552: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
553: #=^xmlDataTypes._count[]=
554: =^xmlDataTypes.0.getAttribute[type-id]=
555:
556: @doubleprobs[]
557: $1(^math:radians(180))
558: $2($math:PI)
559: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
560: ^if($1==$2){y;n}
561: ^if(^math:radians(180)==$math:PI){y;n}
562:
563:
564: @divnamestop[]
565: $a(10)
566: ^eval($a\3)
567:
568: @arrayclone[]
569: $t[^table::create{a b
570: 1 11
571: 2 22
572: }]
573: $c[^table::create[$t]]
574: ^c.append{2 33}
575: ^t.count[]
576: ^c.count[]
577:
578: @operator_tricks[]
579: ^if(1){$a[^t[]]}
580: $a!
581: $a($b)
582: ^if(1){y}{n}
583: $MAIN:a(^t[] eq OK)
584: #$MAIN:a(1)
585: ^if($a){y}{n}
586: #^if(1){y}{n}
587: $form:if
588: $a[$.n[1]]
589: $a.if
590:
591: @xoutputrusattr[]
592: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
593: ^show_xdoc2[$d]
594:
595: @xdocset1[]
596: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
597: ^show_xdoc2[$d]
598:
599: @regexp3[]
600: $s[abcАБВ]
601: ^if(^s.match[][i]){y}{n}
602:
603:
604: @exec2[]
605: $a[^file::exec[bin/t.cmd]]
606: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
607:
608:
609: @tlock[]
610: ^file:lock[lockfile]{
611: code
612: }
613:
614: @xmloutattrwithoutvalue[]
615: #$ORIGINS(1)
616: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
617: $doc[^doc.transform[global.xsl]]
618: =^taint[html][^doc.string[$.method[html]]]=
619:
620:
621:
622: @precisionProblem[]
623: $a[123456789012345678901234567890]
624: $b(^a.double[])
625: ^b.format{%.20E}
626: <hr>
627: ^eval(2*2)
628:
629: @xpath[]
630: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
631: <document><block><p>привет</p></block></document>
632: }]
633: #^show_xdoc2[$xdoc]
634: $node[^xdoc.selectSingle[/document/block/p]]
635: ^if(def $node){
636: ^if($node is string){
637: $node
638: }{
639: ^if($node is hash){
640: ^node._count[]
641: }{
642: $node.nodeType
643: }
644: }
645: #$node.firstChild.nodeValue
646: }{
647: node not found
648: }
649:
650:
651: @ttablesetlang[]
652: $a-tab-b[a b
653: 1 2]
654:
655: $t[^table::set{$a-tab-b}]
656: =$t.a=
657: <hr>
658:
659: $t[^table::set[nameless]{^taint[$a-tab-b]}]
660: =$t.0=
661: <hr>
662:
663: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
664: =$t.a=
665:
666: #^t.append{1 2}
667:
668: @mail3[]
669: ^mail:send[
670: $.from[Александр Петросян <paf@design.ru>]
671: $.to[Александр Петросян <paf@design.ru>]
672: $.subject[проверка4]
673: $.body[
674: $.text[
675: $.content-type[$.value[text/plain] $.charset[windows-1251]]
676: $.body[проверка]
677: ]
678: $.attachment[
679: $.value[^file::load[text;index.html]]
680: $.file-name[привет всем.html]
681: ]
682: ]
683: ]
684:
685:
686: @ttime[]
687: $now[^date::now[]]
688: $now.hour:$now.minute
689:
690: @tupper[]
691: $t[abcABCабвАБВ]
692: $t<br>
693: ^t.upper[]
694:
695: @treplace[]
696: $copy-paste-clean[^table::set{a b
697: . _
698: , _
699: + _
700: & _
701: ? _
702: = _}]
703:
704: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
705: # почему-то этот replace роняет апач в 500 ошибку :(
706: #^cache_key.replace[$copy-paste-clean]
707: $test[abc]
708: ^test.save[$cache_key]saved<br>
709: $cache[^file:list[.;\.cache^$]]
710: ^file:delete[$cache_key]deleted($cache.name)<br>
711:
712:
713:
714: @xslt2[]
715: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
716: <document><block><p>привет</p></block></document>
717: }]
718: ^show_xdoc2[$xdoc]
719: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
720: <hr>
721:
722:
723: @tcache2[]
724: ^cache[$DB_HOME/keyключ](2){
725: ^math:random(100)
726: }
727:
728: @ttaintuntaint[]
729: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
730:
731: ]zz
732: <hr>
733: ^untaint[html]{1^taint[ ]2 3}
734:
735:
736: @tappend2[]
737: $t[^table::set{a b}]^t.append{1 2}$t.a
738:
739: @badvsnprintf[]
740: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
741: }
742:
743:
744: @badoracequoting[]
745: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
746: ^connect[$SQL.connect-string]{
747: ^void:sql{delete from paf}
748: ^void:sql{insert into paf values (1, '$form:text')}
749: $paf[^table::sql{select * from paf}]
750: ^paf.menu{
751: $paf.id: ^untaint{$paf.block}<hr>
752:
753: }
754: <hr>
755:
756:
757: ^rem{
758: $news[^table::sql{select description from news}[$.limit(3)]]
759: ^news.menu{
760: ^untaint{$news.description}<hr>
761:
762: }
763: <hr>
764: }
765:
766: $tables[^table::sql{select table_name from user_tables}]
767: ^tables.menu{
768: $tables.table_name<br>
769: }
770:
771: }
772: <hr>
773: $env:PATH
774:
775: @badconstructors[]
776: $bred[^string::length[]]
777: $bred[^response::clear[]]
778: $bred[^int::int[]]
779:
780:
781: @xloadwrongtable[]
782: $constr[^xdoc::load[wrongtable.xml]]
783: ^show_xdoc2[$constr]
784:
785: @xsetwrongtable[]
786: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
787: <block-list>^untaint[as-is]{$constructor}</block-list>}]
788:
789:
790: @tablecolumnerror[]
791: $t[^table::set{a}]
792: $t.$a
793:
794: @roll[]
795: #$date[^date::set(1970;1;2)]
796: #^date.roll[month](-1)
797: $date[^date::set(2038;1;1)]
798: ^date.roll[month](+1)
799: $date.year $date.month $date.day
800:
801: @cookie2[]
802: #=$cookie:clientType[$.value[test]]=<br>
803: =$cookie:clientType=<br>
804:
805:
806: @tableset[]
807: $a[^table::set{a
808: 1
809: 2}]
810: ^eval(100\$a)
811:
812:
813:
814: @zzz[]
815:
816:
817: $constructor[
818: <block1 name="main_srvr" type="0" label="Основное тело" />
819: <block2 name="main_srvr2" type="0" label="Основное тело" />
820: ]
821:
822: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
823: <block-list>^untaint[as-is]{$constructor}</block-list>}]
824:
825: $children[$constr.documentElement.childNodes]
826: ^if($children){
827: ^for[i](1;^children._count[]){
828: $node[$children.$i]
829: $node.nodeName<br>
830: }
831: }
832:
833:
834: @thashforeach3[]
835: $h[
836: $.a[1]
837: $.b[2]
838: ]
839: $c[^table::set{a
840: ^h.foreach[key;value]{$value
841: }}]
842: $c.a
843:
844: @thashforeach2[]
845: $h[
846: $.a[1]
847: $.b[2]
848: ]
849: $c[
850: ^h.foreach[key;value]{
851: $.$key[$value]
852: }
853: ]
854: $c.b
855:
856: @thashforeach[]
857: $h[
858: $.a[1]
859: $.b[2]
860: ]
861: ^h.foreach[key;value]{
862: $key=$value<br>
863: }
864:
865: @thashdelete[]
866: $h[$.a[1] $.b[2]]
867: was:<br>
868: count=^h._count[] <br>
869: b='$h.b' <br>
870:
871: ^h.delete[b]
872:
873: now:<br>
874: count=^h._count[] <br>
875: b='$h.b'
876:
877: @sappend[]
878: $test[123]
879: ^test.save[test]
880: ^test.save[append;test]
881:
882: @tappend[]
883: $test[^table::set{a b
884: a1 b1}]
885: ^test.save[test]
886: $test[^table::set{a b
887: a2 b2}]
888: ^test.save[append;test]
889:
890:
891: @tform[]
892: ^if(def $form:new_file){y}{n}
893: <form method="post" enctype="multipart/form-data">
894: <input type="file" name="new_file" />
895: <input type=submit>
896: </input>
897:
898: @formattest[]
899: $size(15.124)
900:
901: ^size.format{%.2f}
902:
903: @filelist[]
904: $html[^file:list[.;\.html^$]]
905: ^html.menu{
906: $html.name<br>
907: }
908: <hr>
909:
910: @безнадёжна_попытка_поправить_непоправимое[]
911: $dom_from_disk[^xdoc::load[input.xml]]
912: $dom_created_in_air[^xdoc::create[doc]]
913: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
914: ^show_xdoc2[$dom_created_in_air]
915:
916:
917: @tcache[]
918: #^hashfile:clear[cache]
919: $code[^hashfile::open[$DB_HOME;cache]]
920: ^code.cache[key](2){
921: ^math:random(100)
922: # ^code.delete[]
923: }
924:
925: @thashfileexp[]
926: $hf[^hashfile::open[$DB_HOME;hashfile]]
927: $hf.paf[$.value[крут] $.expires(3)]
928: paf=$hf.paf
929: <hr>
930: ^hf.foreach[key;value]{
931: $key=$value<br>
932: }
933: <hr>
934: $hash[^hf.hash[]]
935: =$hash.paf=
936: <hr>
937:
938: @tcounter[]
939: ^tcounterone[$DB_HOME]
940: other root:
941: ^tcounterone[${DB_HOME}2]
942: again, first:
943: ^tcounterone[$DB_HOME]
944:
945: @tcounterone[DB_HOME]
946: $counter[^hashfile::open[$DB_HOME;counter]]
947: #^counter.clear[]
948: ^counter.transaction{
949: # $counter.value(10)
950: $counter.value($counter.value+1)
951: # ^counter.delete[value]
952: $counter.value
953: }
954: <hr>
955: ^rem{
956: $hash[^counter.hash[]]
957: =$hash.value=
958: <hr>
959: }
960:
961: @tablehash[]
962: $productList[^table::set{id name
963: 1 носки
964: 2 валенки
965: 3 ушанка
966: }]
967:
968: #скажем, у первого дилера
969: $firstPriceList[^table::set{id price
970: 1 0.3
971: 3 1000
972: }]
973:
974: $firstPriceHash[^firstPriceList.hash[id]]
975:
976: ^productList.menu{
977: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
978: }
979:
980:
981: @hashfile[]
982: $hf[^hashfile::assign[hashfile]]
983: #$hf.paf[крут5]
984: paf=$hf.paf
985:
986: @formclass[]
987: ^$form:CLASS.a=$form:CLASS.a
988:
989: @domdata[]
990: ^if(1){
991: # $a{^hren[]}
992: }
993: $a
994: $xdoc[^xdoc::create[doc]]
995: $doc[$xdoc.documentElement]
996: $name[^doc.appendChild[^xdoc.createElement[name]]]
997: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
998: ^untaint[as-is]{=$text.nodeValue=}
999:
1000: @domedit[]
1001: ^domdata[]
1002: #$paf.nodeName<br>
1003: #$doc.documentElement.nodeName<br>
1004:
1005: ^show_xnode1[$xdoc.documentElement;0;1]
1006: <hr>
1007: ^show_xdoc2[$xdoc]
1008: <hr>
1009:
1010: @domxslt[]
1011: ^domdata[]
1012: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1013: <hr>
1014:
1015: @lsplit2[]
1016: $path[/optics/]
1017: $pathTable[^path.lsplit[/]]
1018: ^pathTable.menu{
1019: ^if(def $pathTable.piece){
1020: =$pathTable.piece=
1021: }
1022: }
1023:
1024:
1025: @faceesize[]
1026: $k(2)
1027: $pict[^image::load[paf.gif]]
1028: $small[^image::create($pict.width/$k;$pict.height/$k)]
1029: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1030: $response:body[^small.gif[]]
1031:
1032: @imageresize[]
1033: $k(2)
1034: $pict[^image::create(400*$k;200*$k)]
1035: $pict.line-width(2)
1036: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1037: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1038: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1039: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
1040: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
1041: $response:body[^pict.gif[]]
1042:
1043: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1044: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1045: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1046:
1047: #$response:body[^small.gif[]]
1048:
1049:
1050: @tintdefault[]
1051: #$abc[abc]
1052: $abc[33]
1053: ^abc.int[z]
1054: #^abc.int(123)
1055:
1056: @ifassignhash[]
1057: $h[^if(1){$.a(1);$.a(2)}]
1058: $h.a
1059:
1060: @ifpasshash[]
1061: $a[$.e[a]]
1062: $b[$.e[b]]
1063: ^ifpasshashdest[^if(1){$a;$b}]
1064: #$x[^if(1){$a}{$b}]
1065: #^ifpasshashdest[$x]
1066:
1067: @ifpasshashdest[p]
1068: $p.e
1069:
1070: @movedir[]
1071: ^file:move[a;deeper/a]
1072:
1073: @replace[]
1074: $a[12^;3]
1075: ^a.replace[^table::set{from to
1076: 2^; !
1077: }]
1078:
1079:
1080: @set[]
1081: ^setdata[]
1082: ^a.add[$b]
1083: add:$a.3<br>
1084:
1085: ^setdata[]
1086: ^a.sub[$b]
1087: sub2:$a.2<br>
1088: sub1:$a.1<br>
1089:
1090: ^setdata[]
1091: $c[^a.union[$b]]
1092: union3:$c.3<br>
1093: union2:$c.2<br>
1094:
1095: ^setdata[]
1096: $c[^a.intersection[$b]]
1097: intersection3:$c.3<br>
1098: intersection2:$c.2<br>
1099:
1100: ^setdata[]
1101: intersects:^if(^a.intersects[$b]){y;n}<br>
1102: intersects2:^if(^a.intersects[ ]){y;n}<br>
1103:
1104:
1105: <hr>
1106:
1107: @setdata[]
1108: $a[$.1[a1] $.2[a2]]
1109: $b[ $.2[b2] $.3[b3]]
1110:
1111:
1112: @hash[]
1113: $h[^hash::create[$._default[123]]]
1114: $h.paf[not kretin]
1115: $h.paf<br>
1116: =$h.that=<br>
1117:
1118: @methresult[]
1119: $result[^table::set{1}]
1120:
1121: @terror[]
1122: ^error[method z must be called with z]
1123:
1124: @syntax1[]
1125: #^a[^b]
1126:
1127: @syntax2[]
1128: #^a[
1129:
1130: @ssave[]
1131: $abc[abc]
1132: ^abc.save[abc]
1133:
1134: @calendar[]
1135: 2001;11:<br>
1136: $week_days[^date:calendar[rus](2001;11)]
1137: <pre>
1138: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
1139: </pre>
1140:
1141: @thash[]
1142: $table[^table::set{id name age
1143: 1 paf 278
1144: 2 пиф 234
1145: }]
1146: $hash[^table.hash[id;^table::set[nameless]{id
1147: name}]]
1148: $hash.2.id $hash.2.name $hash.2.age
1149:
1150: @tdef[]
1151: $s[0]
1152: if 0=^if($s){}{n}<br>
1153: if def 0=^if(def $s){y}{}<br>
1154: <hr>
1155:
1156: @ford[]
1157: ^for[i](0;5){$i}{($i)}
1158:
1159: @tif[]
1160: ^if[def]{y;n}
1161:
1162: @image[]
1163: $pict[^image::create(400;200)]
1164: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1165: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
1166: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1167: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
1168: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1169: $response:body[^pict.gif[]]
1170:
1171:
1172:
1173: @mail2[]
1174: ^mail:send[
1175: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1176: $.from[Александр Петросян <paf@design.ru>]
1177: $.to[Александр Петросян <paf@design.ru>]
1178: $.subject[проверка]
1179: $.body[проверка]
1180: ]
1181:
1182: @cookie[]
1183: $env:HTTP_COOKIE<br>
1184:
1185: #$cookie:переменная[test тест ТЕСТ2]
1186: =$cookie:переменная=<br>
1187: #$cookie:переменная2[test тест ТЕСТ3]
1188: =$cookie:переменная2=<br>
1189: =$cookie:CLASS.переменная2=<br>
1190:
1191: @response[]
1192: #^if($form:reload){
1193: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1194: #}
1195:
1196: @xslt[]
1197: ^xdata[]
1198: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
1199: ^show_xdoc2[$transformed]
1200:
1201: @regexp2[]
1202: $s[ select]
1203: $s[^s.match[^^\s*][]{!}]
1204: $s
1205:
1206: @header[]
1207: $response:refresh[
1208: $.value[0]
1209: $.url[http://design.ru?a=^taint[123]]
1210: ]
1211:
1212: @ttablerem[]
1213: $table[^table::load[a.cfg]]
1214: ^table.menu{$table.a}
1215:
1216: @tconnect[]
1217: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1218: $tables[^table::sql{show tables}]
1219: #$cols[^tables.columns[]]
1220: #$cols.column
1221: ^tables.menu{
1222: $tables.[Tables_in_test]<br>
1223: }
1224: }
1225:
1226: @pcre[]
1227: $s[1 2]
1228: ^s.match[\s;ig]{!}
1229: #^s.match[\d;ig]{!}
1230:
1231:
1232: @regexp[]
1233: $s[abcАБВ]
1234: ^if(^s.match[б][i]){y}{n}
1235:
1236: @mail[]
1237: #$ORIGINS(1)
1238: ^mail:send[
1239: $.from[paf@design.ru]
1240: $.to[paf@design.ru]
1241: $.body[1
1242:
1243: 2
1244:
1245:
1246: 3]
1247: ]
1248:
1249: @exec[]
1250: $a[^file::exec[fc.exe;;a;b]]
1251: $a.status|$a.stderr<hr>
1252:
1253: @fori[][i]
1254: ^for[i](1;3){... =$i= ...}
1255:
1256: @xdata0[]
1257: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1258: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1259: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1260: <people>
1261: <man id="1" имя="word слово">
1262: <name>P«^;AF B</name>
1263: </man>
1264: <man id="2">
1265: <name>ПИФ^taint[&]</name>
1266: </man>
1267: </people>
1268: }]
1269:
1270: @xdata[]
1271: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1272: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1273: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1274: <people>
1275: <man id="1" имя="word слово">
1276: <name>P«^;AF B</name>
1277: </man>
1278: <man id="2">
1279: <name>ПИФ^taint[&]</name>
1280: </man>
1281: </people>
1282: }}]
1283:
1284: @xml[]
1285: ^xdata[]
1286:
1287: ^show_xdoc2[$xdoc]<hr>
1288: #^show_xnode1[$xdoc]<hr>
1289: $people[^xdoc.select[*/man]]
1290: #^show1[]
1291: ^show_xnodes1[$people]<hr>
1292: #^people.0.owner.hren[]
1293:
1294: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1295:
1296: by id:
1297: ^show_xnode1[^xdoc.getElementById[1];0;1]
1298: <hr>
1299:
1300: @show1[array]
1301: ^for[i](0;^array._count[]-1){
1302: $x[$array.$i]
1303: $x.firstChild.nodeValue:
1304: $pattributes[$x.parentNode.attributes]
1305: ^if(^pattributes._count[]){
1306: $pattributes.id.name=$pattributes.id.nodeValue
1307: }
1308: <br>
1309: }
1310:
1311: @show_xnodes1[array][i]
1312: ^for[i](0;^array._count[]-1){
1313: ^show_xnode1[$array.$i;0;1]
1314: }
1315:
1316: @show_xnode1[x;level;single][l]
1317: ^if(def $x){
1318: ^for[l](0;$level-1){ ^; ^; ^; ^;}
1319: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1320: <^;$x.nodeName
1321: $pairs[$x.attributes]
1322: ^if(def $pairs){
1323: $names[^pairs._keys[]]
1324: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
1325: }
1326: >^;
1327: }{
1328: [$x.nodeType]
1329: }
1330:
1331: ^if(def $x.nodeValue){$x.nodeValue}<br>
1332: ^show_xnode1[$x.firstChild]($level+1)
1333: ^if(!$single){
1334: ^show_xnode1[$x.nextSibling]($level)
1335: }
1336:
1337: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1338: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
1339: }
1340: }
1341:
1342: @show_xdoc2[xdoc]
1343: ^xdoc.save[out/save.xml;
1344: # $.encoding[utf-8]
1345: $.method[xml]
1346: ]
1347: $file[^xdoc.file[
1348: $.encoding[utf-8]
1349: $.method[html]
1350: ]]
1351: ^file.save[text;out/save_file.html]
1352: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
1353: <pre>^taint[html][^xdoc.string[
1354: $.method[html]
1355: # $.encoding[utF-8]
1356: # $.omit-xml-declaration[yes]
1357: # $.standalone[no]
1358: # -$.doctype-public[-//W3C//DTD XHTML]
1359: # -$.doctype-system[/a/b/c/]
1360: # $.indent[yes]
1361: # $.media-type[text/paf]
1362: ]]
1363: </pre>
E-mail: