Annotation of parser3/tests/107.html, revision 1.2
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[]
! 15: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
! 16: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
! 17: <!--for getByID to work we need to enable doctype checking in pa_global.C :( <?DOCTYPE people SYSTEM "107.dtd"?>-->
! 18: <people>
! 19: <man id="1" èìÿ="word ñëîâî">
! 20: <name>P«^;AF B</name>
! 21: </man>
! 22: <man id="2">
! 23: <name>ÏÈÔ^taint[&]</name>
! 24: </man>
! 25: </people>
! 26: }]
! 27:
! 28: @show1[array]
! 29: ^for[i](0;$array-1){
! 30: $x[$array.$i]
! 31: $x.firstChild.nodeValue:
! 32: $pattributes[$x.parentNode.attributes]
! 33: ^if(^pattributes._count[]){
! 34: $pattributes.id.name=$pattributes.id.nodeValue
! 35: }
! 36: <br>
! 37: }
! 38:
! 39: @show_xnodes1[array][i]
! 40: ^for[i](0;^array._count[]-1){
! 41: ^show_xnode1[$array.$i;0;1]
! 42: }
! 43:
! 44: @show_xnode1[x;level;single][l]
! 45: ^if(def $x){
! 46: ^for[l](0;$level-1){ ^; ^; ^; ^;}
! 47: ^if($x.nodeType == $xnode:ELEMENT_NODE){
! 48: <^;$x.nodeName
! 49: $pairs[$x.attributes]
! 50: ^if(def $pairs){
! 51: $names[^pairs._keys[]]
! 52: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
! 53: }
! 54: >^;
! 55: }{
! 56: [$x.nodeType]
! 57: }
! 58:
! 59: ^if(def $x.nodeValue){$x.nodeValue}<br>
! 60: ^show_xnode1[$x.firstChild]($level+1)
! 61: ^if(!$single){
! 62: ^show_xnode1[$x.nextSibling]($level)
! 63: }
! 64:
! 65: ^if($x.nodeType == $xnode:ELEMENT_NODE){
! 66: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
! 67: }
! 68: }
! 69:
! 70: @show_xdoc2[xdoc]
! 71: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
! 72: <pre>^taint[html][^xdoc.string[
! 73: $.method[html]
! 74: # $.encoding[utF-8]
! 75: # $.omit-xml-declaration[yes]
! 76: # $.standalone[no]
! 77: # -$.doctype-public[-//W3C//DTD XHTML]
! 78: # -$.doctype-system[/a/b/c/]
! 79: # $.indent[yes]
! 80: # $.media-type[text/paf]
! 81: ]]
! 82: </pre>
E-mail: