Annotation of parser3/tests/107.html, revision 1.5

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

E-mail: