--- parser3/tests/107.html 2003/07/24 11:25:58 1.2
+++ parser3/tests/107.html 2007/03/12 18:58:09 1.4
@@ -1,33 +1,48 @@
@main[]
+$request:charset[UTF-8]
+$response:charset[UTF-8]
+$response:content-type[
+ $.value[text/html]
+ $.charset[$response:charset]
+]
^xdata[]
^show_xdoc2[$xdoc]
^show_xnode1[$xdoc]
-XPath1:
+XPath1 [*/man]:
$people[^xdoc.select[*/man]]
^show_xnodes1[$people]
-XPath2:
+XPath1 [//man]:
+$people[^xdoc.select[//man]]
+^show_xnodes1[$people]
+
+XPath2 [*/man[2]/name]:
^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]
+
@xdata[]
-#$response:content-type[$.value[text/html] $.charset[windows-1251]]
-$xdoc[^xdoc::create{
+$xdoc[^xdoc::create{
-
+
P«^;AF B
-
- ÏÈÔ^taint[&]
-
+
+ ПИФ^taint[&]
+
+
+
+ ПÐФ
+
+
}]
@show1[array]
^for[i](0;$array-1){
- $x[$array.$i]
+ $x[$array.$i]
$x.firstChild.nodeValue:
$pattributes[$x.parentNode.attributes]
^if(^pattributes._count[]){
@@ -41,30 +56,23 @@ $xdoc[^xdoc::create{
- ^show_xnode1[$x.firstChild]($level+1)
- ^if(!$single){
+ ^for[l](0;$level-1){ ^; ^; ^; ^;}
+ ^if($x.nodeType == $xnode:ELEMENT_NODE){
+ <^;$x.nodeName^if(def $x.attributes){^x.attributes.foreach[key;value]{ $key="$value.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>^;
- }
+ ^if($x.nodeType == $xnode:ELEMENT_NODE){
+ ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;
+ }
}
@show_xdoc2[xdoc]
@@ -72,7 +80,7 @@ $xdoc[^xdoc::create{^taint[html][^xdoc.string[
$.method[html]
# $.encoding[utF-8]
-# $.omit-xml-declaration[yes]
+# $.omit-xml-declaration[yes]
# $.standalone[no]
# -$.doctype-public[-//W3C//DTD XHTML]
# -$.doctype-system[/a/b/c/]