Annotation of parser3/tests/107.html, revision 1.3
1.2 paf 1: @main[]
2: ^xdata[]
3:
4: ^show_xdoc2[$xdoc]<hr>
5: ^show_xnode1[$xdoc]<hr>
6:
7: XPath1:<br>
8: $people[^xdoc.select[*/man]]
9: ^show_xnodes1[$people]<hr>
10:
11: XPath2:<br>
12: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
13:
14: @xdata[]
1.3 ! paf 15: $xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?>
1.2 paf 16: <!--for getByID to work we need to enable doctype checking in pa_global.C :( <?DOCTYPE people SYSTEM "107.dtd"?>-->
17: <people>
1.3 ! paf 18: <man id="1" имя="word слово">
1.2 paf 19: <name>P«^;AF B</name>
20: </man>
21: <man id="2">
1.3 ! paf 22: <name>ПИФ^taint[&]</name>
1.2 paf 23: </man>
24: </people>
25: }]
26:
27: @show1[array]
28: ^for[i](0;$array-1){
29: $x[$array.$i]
30: $x.firstChild.nodeValue:
31: $pattributes[$x.parentNode.attributes]
32: ^if(^pattributes._count[]){
33: $pattributes.id.name=$pattributes.id.nodeValue
34: }
35: <br>
36: }
37:
38: @show_xnodes1[array][i]
39: ^for[i](0;^array._count[]-1){
40: ^show_xnode1[$array.$i;0;1]
41: }
42:
43: @show_xnode1[x;level;single][l]
44: ^if(def $x){
45: ^for[l](0;$level-1){ ^; ^; ^; ^;}
46: ^if($x.nodeType == $xnode:ELEMENT_NODE){
47: <^;$x.nodeName
48: $pairs[$x.attributes]
49: ^if(def $pairs){
50: $names[^pairs._keys[]]
51: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
52: }
53: >^;
54: }{
55: [$x.nodeType]
56: }
57:
58: ^if(def $x.nodeValue){$x.nodeValue}<br>
59: ^show_xnode1[$x.firstChild]($level+1)
60: ^if(!$single){
61: ^show_xnode1[$x.nextSibling]($level)
62: }
63:
64: ^if($x.nodeType == $xnode:ELEMENT_NODE){
65: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
66: }
67: }
68:
69: @show_xdoc2[xdoc]
70: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
71: <pre>^taint[html][^xdoc.string[
72: $.method[html]
73: # $.encoding[utF-8]
74: # $.omit-xml-declaration[yes]
75: # $.standalone[no]
76: # -$.doctype-public[-//W3C//DTD XHTML]
77: # -$.doctype-system[/a/b/c/]
78: # $.indent[yes]
79: # $.media-type[text/paf]
80: ]]
81: </pre>
E-mail: