|
|
| version 1.3, 2010/07/25 06:14:46 | version 1.4, 2010/07/25 06:23:41 |
|---|---|
| Line 1 | Line 1 |
| @main[] | @main[] |
| $xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?> | $xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?> |
| <!DOCTYPE people> | <!DOCTYPE people> |
| <!--some comment--> | <!--some comment--> |
| <people xmlns:first="http://parser.ru/first" xmlns:second="http://parser.ru/second"> | <people xmlns:first="http://parser.ru/first" xmlns:second="http://parser.ru/second"> |
| <man first:attrname="attr value"> | <man first:attrname="attr value"> |
| <name>ПИФ^taint[&]</name> | <name>ПИФ^taint[&]</name> |
| </man> | </man> |
| <man id="1" имя="word слово"> | <man id="1" имя="word слово"> |
| <name>P«^;AF B</name> | <name>P«^;AF B</name> |
| <tst:findme xmlns:tst="http://parser.ru/tst">secret</tst:findme> | <tst:findme xmlns:tst="http://parser.ru/tst">secret</tst:findme> |
| </man> | </man> |
| </people> | </people> |
| }] | }] |
| ^dump[Origin;$xdoc] | ^dump[Origin;$xdoc] |
| ^xdoc.documentElement.firstChild.nextSibling.getAttributeNS[http://parser.ru/first;attrname] | ^xdoc.documentElement.firstChild.nextSibling.getAttributeNS[http://parser.ru/first;attrname] |
| ^xdoc.documentElement.lastChild.previousSibling.setAttributeNS[http://parser.ru/second;second:attrname2;value 2] | ^xdoc.documentElement.lastChild.previousSibling.setAttributeNS[http://parser.ru/second;second:attrname2;value 2] |
| ^dump[Added attrname2 for last 'man' element;$xdoc] | ^dump[Added attrname2 for last 'man' element;$xdoc] |
| ^xdoc.documentElement.firstChild.nextSibling.removeAttributeNS[http://parser.ru/first;attrname] | ^xdoc.documentElement.firstChild.nextSibling.removeAttributeNS[http://parser.ru/first;attrname] |
| ^dump[Removed attrname for first 'man' element;$xdoc] | ^dump[Removed attrname for first 'man' element;$xdoc] |
| ^^x.getAttrinuteNS[...;attrname2]='^xdoc.documentElement.lastChild.previousSibling.getAttributeNS[http://parser.ru/second;attrname2]'<br /> | ^^x.getAttrinuteNS[...;attrname2]='^xdoc.documentElement.lastChild.previousSibling.getAttributeNS[http://parser.ru/second;attrname2]'<br /> |
| $Attr[^xdoc.documentElement.lastChild.previousSibling.getAttributeNodeNS[http://parser.ru/second;attrname2]] | $Attr[^xdoc.documentElement.lastChild.previousSibling.getAttributeNodeNS[http://parser.ru/second;attrname2]] |
| ^$Attr.nodeValue='$Attr.nodeValue'<br /> | ^$Attr.nodeValue='$Attr.nodeValue'<br /> |
| $Attr.nodeValue[changed attribute value] | $Attr.nodeValue[changed attribute value] |
| ^dump[Changed attrname2 for last 'man' element;$xdoc] | ^dump[Changed attrname2 for last 'man' element;$xdoc] |
| #intentionally not predeclaring namespace. todo: think about that stuff | #intentionally not predeclaring namespace. todo: think about that stuff |
| $newAttr[^xdoc.createAttributeNS[http://parser.ru/third;third:attrname3]] | $newAttr[^xdoc.createAttributeNS[http://parser.ru/third;third:attrname3]] |
| $oldAttr[^xdoc.documentElement.lastChild.previousSibling.setAttributeNodeNS[$newAttr]] | $oldAttr[^xdoc.documentElement.lastChild.previousSibling.setAttributeNodeNS[$newAttr]] |
| ^if($oldAttr is xnode){wrong;right}<br /> | ^if($oldAttr is xnode){wrong;right}<br /> |
| $newAttr.nodeValue[value3] | $newAttr.nodeValue[value3] |
| ^dump[Added attrname3 for last 'man' element;$xdoc] | ^dump[Added attrname3 for last 'man' element;$xdoc] |
| $NodeList[^xdoc.getElementsByTagNameNS[http://parser.ru/tst;findme]] | $NodeList[^xdoc.getElementsByTagNameNS[http://parser.ru/tst;findme]] |
| ^show_xnodes1[$NodeList]<br /><br /> | ^show_xnodes1[$NodeList]<br /><br /> |
| $man1[^xdoc.selectSingle[/people/man[@id=1]]] | $man1[^xdoc.selectSingle[/people/man[@id=1]]] |
| ^if(^man1.hasAttribute[id]){right;wrong2!}<br /> | ^if(^man1.hasAttribute[id]){right;wrong2!}<br /> |
| ^if(^man1.hasAttributeNS[http://parser.ru/third;attrname3]){right;wrong3} | ^if(^man1.hasAttributeNS[http://parser.ru/third;attrname3]){right;wrong3} |
| <hr /> | <hr /> |
| /people/man[@id=1] ^if(^man1.hasAttributes[]){has;hasn't} attributes<br /> | /people/man[@id=1] ^if(^man1.hasAttributes[]){has;hasn't} attributes<br /> |
| $name2[^xdoc.selectSingle[/people/man[@id=1]/name]] | $name2[^xdoc.selectSingle[/people/man[@id=1]/name]] |
| /people/man[@id=1]/name ^if(^name2.hasAttributes[]){has;hasn't} attributes<br /> | /people/man[@id=1]/name ^if(^name2.hasAttributes[]){has;hasn't} attributes<br /> |
| @dump[sTitle;xdoc] | @dump[sTitle;xdoc] |
| ^if(def $sTitle){<h2>$sTitle</h2>} | ^if(def $sTitle){<h2>$sTitle</h2>} |
| ^show_xdoc2[$xdoc]<hr /> | ^show_xdoc2[$xdoc]<hr /> |
| ^show_xnode1[$xdoc]<hr /> | ^show_xnode1[$xdoc]<hr /> |
| <hr /> | <hr /> |
| @show1[array][i;x;pattributes] | @show1[array][i;x;pattributes] |
| ^for[i](0;$array-1){ | ^for[i](0;$array-1){ |
| $x[$array.$i] | $x[$array.$i] |
| $x.firstChild.nodeValue: | $x.firstChild.nodeValue: |
| $pattributes[$x.parentNode.attributes] | $pattributes[$x.parentNode.attributes] |
| ^if(^pattributes._count[]){ | ^if(^pattributes._count[]){ |
| $pattributes.id.name=$pattributes.id.nodeValue | $pattributes.id.name=$pattributes.id.nodeValue |
| } | } |
| <br /> | <br /> |
| } | } |
| @show_xnodes1[array][i] | @show_xnodes1[array][i] |
| ^for[i](0;^array._count[]-1){ | ^for[i](0;^array._count[]-1){ |
| ^show_xnode1[$array.$i;0;1] | ^show_xnode1[$array.$i;0;1] |
| } | } |
| @show_xnode1[x;level;single][l;pairs;names] | @show_xnode1[x;level;single][l;pairs;names] |
| ^if(def $x){ | ^if(def $x){ |
| ^for[l](0;$level-1){ ^; ^; ^; ^;} | ^for[l](0;$level-1){ ^; ^; ^; ^;} |
| ^if($x.nodeType == $xnode:ELEMENT_NODE){ | ^if($x.nodeType == $xnode:ELEMENT_NODE){ |
| <^;$x.nodeName | <^;$x.nodeName |
| $pairs[$x.attributes] | $pairs[$x.attributes] |
| ^if(def $pairs){ | ^if(def $pairs){ |
| $names[^pairs._keys[]] | $names[^pairs._keys[]] |
| ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"} | ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"} |
| } | } |
| >^; | >^; |
| }{ | }{ |
| [$x.nodeType] | [$x.nodeType] |
| } | } |
| ^if(def $x.nodeValue){$x.nodeValue}<br /> | ^if(def $x.nodeValue){$x.nodeValue}<br /> |
| ^show_xnode1[$x.firstChild]($level+1) | ^show_xnode1[$x.firstChild]($level+1) |
| ^if(!$single){ | ^if(!$single){ |
| ^show_xnode1[$x.nextSibling]($level) | ^show_xnode1[$x.nextSibling]($level) |
| } | } |
| ^if($x.nodeType == $xnode:ELEMENT_NODE){ | ^if($x.nodeType == $xnode:ELEMENT_NODE){ |
| ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br /> | ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br /> |
| } | } |
| } | } |
| @show_xdoc2[xdoc] | @show_xdoc2[xdoc] |
| #$response:body[^xdoc.file[ $.media-type[text/paf] ]] | #$response:body[^xdoc.file[ $.media-type[text/paf] ]] |
| <pre>^taint[html][^xdoc.string[ | <pre>^taint[html][^xdoc.string[ |
| # $.method[html] | # $.method[html] |
| # $.encoding[utF-8] | # $.encoding[utF-8] |
| # $.omit-xml-declaration[yes] | # $.omit-xml-declaration[yes] |
| # $.standalone[no] | # $.standalone[no] |
| # -$.doctype-public[-//W3C//DTD XHTML] | # -$.doctype-public[-//W3C//DTD XHTML] |
| # -$.doctype-system[/a/b/c/] | # -$.doctype-system[/a/b/c/] |
| # $.indent[yes] | # $.indent[yes] |
| # $.media-type[text/paf] | # $.media-type[text/paf] |
| ]] | ]] |
| </pre> | </pre> |