Annotation of parser3/tests/149.html, revision 1.1

1.1     ! paf         1: @main[]
        !             2: $xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?>
        !             3: <!DOCTYPE people>
        !             4: <!--some comment-->
        !             5: <people xmlns:first="http://parser.ru/first" xmlns:second="http://parser.ru/second">
        !             6:                <man first:attrname="attr value">
        !             7:             <name>ПИФ^taint[&]</name>
        !             8:                </man>
        !             9:        <man id="1" имя="word слово">
        !            10:                <name>P&#171^;AF        B</name>
        !            11:                <tst:findme xmlns:tst="http://parser.ru/tst">secret</tst:findme>
        !            12:        </man>
        !            13: </people>
        !            14: }]
        !            15: 
        !            16: ^dump[$xdoc]
        !            17: 
        !            18: ^xdoc.documentElement.firstChild.nextSibling.getAttributeNS[http://parser.ru/first;attrname]
        !            19: 
        !            20: ^xdoc.documentElement.lastChild.previousSibling.setAttributeNS[http://parser.ru/second;second:attrname2;value 2]
        !            21: 
        !            22: ^dump[$xdoc]
        !            23: 
        !            24: ^xdoc.documentElement.firstChild.nextSibling.removeAttributeNS[http://parser.ru/first;attrname]
        !            25: 
        !            26: ^dump[$xdoc]
        !            27: 
        !            28: =^xdoc.documentElement.lastChild.previousSibling.getAttributeNS[http://parser.ru/second;attrname2]=
        !            29: $Attr[^xdoc.documentElement.lastChild.previousSibling.getAttributeNodeNS[http://parser.ru/second;attrname2]]
        !            30: =$Attr.nodeValue=
        !            31: $Attr.nodeValue[changed attribute value]
        !            32: 
        !            33: ^dump[$xdoc]
        !            34: 
        !            35: 
        !            36: #intentionally not predeclaring namespace. todo: think about that stuff
        !            37: $newAttr[^xdoc.createAttributeNS[http://parser.ru/third;third:attrname3]]
        !            38: $oldAttr[^xdoc.documentElement.lastChild.previousSibling.setAttributeNodeNS[$newAttr]]
        !            39: ^if($oldAttr is xnode){wrong;right}<br>
        !            40: $newAttr.nodeValue[value3]
        !            41: 
        !            42: ^dump[$xdoc]
        !            43: 
        !            44: $NodeList[^xdoc.getElementsByTagNameNS[http://parser.ru/tst;findme]]
        !            45: ^show_xnodes1[$NodeList]<hr><hr>
        !            46: 
        !            47: $man1[^xdoc.selectSingle[/people/man[@id=1]]]
        !            48: ^if(^man1.hasAttribute[id]){right;wrong2!}<br>
        !            49: ^if(^man1.hasAttributeNS[http://parser.ru/third;attrname3]){right;wrong3}
        !            50: 
        !            51: <hr>
        !            52: 
        !            53: @dump[xdoc]
        !            54: ^show_xdoc2[$xdoc]<hr>
        !            55: ^show_xnode1[$xdoc]<hr>
        !            56: <hr>
        !            57: 
        !            58: @show1[array]
        !            59: ^for[i](0;$array-1){
        !            60:     $x[$array.$i]
        !            61:        $x.firstChild.nodeValue: 
        !            62:                $pattributes[$x.parentNode.attributes]
        !            63:                ^if(^pattributes._count[]){
        !            64:                        $pattributes.id.name=$pattributes.id.nodeValue
        !            65:                }
        !            66:        <br>
        !            67: }
        !            68:        
        !            69: @show_xnodes1[array][i]
        !            70: ^for[i](0;^array._count[]-1){
        !            71:        ^show_xnode1[$array.$i;0;1]
        !            72: }
        !            73: 
        !            74: @show_xnode1[x;level;single][l]
        !            75: ^if(def $x){
        !            76:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}
        !            77:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
        !            78:        &lt^;$x.nodeName
        !            79:            $pairs[$x.attributes]
        !            80:            ^if(def $pairs){
        !            81:                $names[^pairs._keys[]]
        !            82:                ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
        !            83:            }
        !            84:            &gt^;
        !            85:     }{
        !            86:        [$x.nodeType]
        !            87:     }
        !            88:     
        !            89:     ^if(def $x.nodeValue){$x.nodeValue}<br>
        !            90:     ^show_xnode1[$x.firstChild]($level+1)
        !            91:     ^if(!$single){
        !            92:            ^show_xnode1[$x.nextSibling]($level)
        !            93:     }
        !            94: 
        !            95:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
        !            96:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}&lt^;/$x.nodeName&gt^;<br>
        !            97:     }
        !            98: }
        !            99: 
        !           100: @show_xdoc2[xdoc]
        !           101: #$response:body[^xdoc.file[    $.media-type[text/paf]  ]]
        !           102: <pre>^taint[html][^xdoc.string[
        !           103: #      $.method[html]
        !           104: #      $.encoding[utF-8]
        !           105: #      $.omit-xml-declaration[yes]
        !           106: #      $.standalone[no]
        !           107: #      -$.doctype-public[-//W3C//DTD XHTML]
        !           108: #      -$.doctype-system[/a/b/c/]
        !           109: #      $.indent[yes]
        !           110: #      $.media-type[text/paf]
        !           111: ]]
        !           112: </pre>

E-mail: