--- parser3/tests/097.html 2007/03/01 10:33:58 1.4
+++ parser3/tests/097.html 2017/05/19 16:49:53 1.7
@@ -1,23 +1,87 @@
-$file[^file::load[binary;http://www.parser.ru/none/;
+@main[]
+$response:charset[UTF-8]
+$request:charset[UTF-8]
+
+$file[^file::load[binary;http://www.parser.ru/_/tests/none/;
$.headers[
$.USER-AGENT[paf]
]
+ $.timeout(10)
$.any-status(1)
]]
#server: $file.SERVER
$file.status
-
#$file.text
-$file[^file::load[binary;http://www.parser.ru/xmlview.xsl;
- $.timeout(10)
- $.any-status(1)
-]]
+
+^try{
+ $file[^file::load[binary;http://www.parser.ru/xmlview.xsl;
+ $.timeout(10)
+ $.any-status(1)
+ ]]
+ ^try{
+ $xdoc[^xdoc::create[$file]]
+ xdoc from file created successfully (documentElement: $xdoc.documentElement.nodeName)
+ }{
+ can't create xdoc from file.
+ $exception.handled(1)
+ }
+}{
+ can't load remote file.
+ $exception.handled(1)
+}
+
+
+^try{
+ $xdoc[^xdoc::load[http://www.parser.ru/xmlview.xsl]]
+ remote xdoc loaded successfully (documentElement: $xdoc.documentElement.nodeName)
+}{
+ can't load remote xdoc.
+ $exception.handled(1)
+}
+
+
+
+^try{
+ $xdoc[^xdoc::load[108.xsl]]
+ local xdoc loaded successfully (documentElement: $xdoc.documentElement.nodeName)
+}{
+ can't load local xdoc.
+ $exception.handled(1)
+}
+
+
+
+Loading remote file in windows-1251:
+^try{
+ $file[^file::load[text;http://www.parser.ru/_/tests/097.html;
+ $.charset[windows-1251]
+ $.timeout(10)
+ $.form[
+ $.charset[windows-1251]
+ $.title[Проверка]
+ ]
+ ]]
+ $file.text
+}{
+ $exception.handled(1)
+ can't load remote file.
+}
+
+
+
+Loading remote file in UTF-8:
^try{
- $xdoc[^xdoc::create[$file]]
- xdoc from file created successfully (documentElement: $xdoc.documentElement.nodeName)
+ $file[^file::load[text;http://www.parser.ru/_/tests/097.html;
+ $.timeout(10)
+ $.form[
+ $.charset[UTF-8]
+ $.title[Проверка]
+ ]
+ ]]
+ $file.text
}{
- can't create xdoc.
$exception.handled(1)
+ can't load remote file.
}