--- parser3/tests/149.html 2005/12/19 12:24:57 1.1
+++ parser3/tests/149.html 2010/07/25 06:23:41 1.4
@@ -4,7 +4,7 @@ $xdoc[^xdoc::create{
- ПИФ^taint[&]
+ ПИФ^taint[&]
P«^;AF B
@@ -13,88 +13,96 @@ $xdoc[^xdoc::create{
}]
-^dump[$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]
-^dump[$xdoc]
+^dump[Added attrname2 for last 'man' element;$xdoc]
+
^xdoc.documentElement.firstChild.nextSibling.removeAttributeNS[http://parser.ru/first;attrname]
-^dump[$xdoc]
+^dump[Removed attrname for first 'man' element;$xdoc]
-=^xdoc.documentElement.lastChild.previousSibling.getAttributeNS[http://parser.ru/second;attrname2]=
+
+^^x.getAttrinuteNS[...;attrname2]='^xdoc.documentElement.lastChild.previousSibling.getAttributeNS[http://parser.ru/second;attrname2]'
$Attr[^xdoc.documentElement.lastChild.previousSibling.getAttributeNodeNS[http://parser.ru/second;attrname2]]
-=$Attr.nodeValue=
+^$Attr.nodeValue='$Attr.nodeValue'
$Attr.nodeValue[changed attribute value]
-^dump[$xdoc]
+^dump[Changed attrname2 for last 'man' element;$xdoc]
#intentionally not predeclaring namespace. todo: think about that stuff
$newAttr[^xdoc.createAttributeNS[http://parser.ru/third;third:attrname3]]
$oldAttr[^xdoc.documentElement.lastChild.previousSibling.setAttributeNodeNS[$newAttr]]
-^if($oldAttr is xnode){wrong;right}
+^if($oldAttr is xnode){wrong;right}
$newAttr.nodeValue[value3]
-^dump[$xdoc]
+^dump[Added attrname3 for last 'man' element;$xdoc]
+
$NodeList[^xdoc.getElementsByTagNameNS[http://parser.ru/tst;findme]]
-^show_xnodes1[$NodeList]
+^show_xnodes1[$NodeList]
$man1[^xdoc.selectSingle[/people/man[@id=1]]]
-^if(^man1.hasAttribute[id]){right;wrong2!}
+^if(^man1.hasAttribute[id]){right;wrong2!}
^if(^man1.hasAttributeNS[http://parser.ru/third;attrname3]){right;wrong3}
-
+
-@dump[xdoc]
-^show_xdoc2[$xdoc]
-^show_xnode1[$xdoc]
-
+/people/man[@id=1] ^if(^man1.hasAttributes[]){has;hasn't} attributes
+$name2[^xdoc.selectSingle[/people/man[@id=1]/name]]
+/people/man[@id=1]/name ^if(^name2.hasAttributes[]){has;hasn't} attributes
+
+@dump[sTitle;xdoc]
+^if(def $sTitle){$sTitle
}
+^show_xdoc2[$xdoc]
+^show_xnode1[$xdoc]
+
-@show1[array]
+@show1[array][i;x;pattributes]
^for[i](0;$array-1){
- $x[$array.$i]
+ $x[$array.$i]
$x.firstChild.nodeValue:
$pattributes[$x.parentNode.attributes]
^if(^pattributes._count[]){
$pattributes.id.name=$pattributes.id.nodeValue
}
-
+
}
-
+
@show_xnodes1[array][i]
^for[i](0;^array._count[]-1){
^show_xnode1[$array.$i;0;1]
}
-@show_xnode1[x;level;single][l]
+@show_xnode1[x;level;single][l;pairs;names]
^if(def $x){
- ^for[l](0;$level-1){ ^; ^; ^; ^;}
- ^if($x.nodeType == $xnode:ELEMENT_NODE){
- <^;$x.nodeName
- $pairs[$x.attributes]
- ^if(def $pairs){
- $names[^pairs._keys[]]
- ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
- }
- >^;
- }{
- [$x.nodeType]
- }
-
- ^if(def $x.nodeValue){$x.nodeValue}
- ^show_xnode1[$x.firstChild]($level+1)
- ^if(!$single){
- ^show_xnode1[$x.nextSibling]($level)
- }
-
- ^if($x.nodeType == $xnode:ELEMENT_NODE){
- ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;
- }
+ ^for[l](0;$level-1){ ^; ^; ^; ^;}
+ ^if($x.nodeType == $xnode:ELEMENT_NODE){
+ <^;$x.nodeName
+ $pairs[$x.attributes]
+ ^if(def $pairs){
+ $names[^pairs._keys[]]
+ ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
+ }
+ >^;
+ }{
+ [$x.nodeType]
+ }
+
+ ^if(def $x.nodeValue){$x.nodeValue}
+ ^show_xnode1[$x.firstChild]($level+1)
+ ^if(!$single){
+ ^show_xnode1[$x.nextSibling]($level)
+ }
+
+ ^if($x.nodeType == $xnode:ELEMENT_NODE){
+ ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;
+ }
}
@show_xdoc2[xdoc]