load. Loading XML from disk or HTTP-server or other source

^xdoc::load[filename]

This constructor loads XML-code from a file or document on HTTP-server and creates a new object of class xdoc based on it.
Parser can load XML from arbitrary source, see "Reading XML from arbitrary source".

filename - path and filename or URL of document on HTTP-serve.

Example of loading a file from disk
$document[^xdoc::load[article.xml]]
$
response:body[^document.string[]]

Example of loading an XML document from HTTP-server:
$xdoc[^xdoc::load[http://www.cbr.ru/scripts/XML_daily.asp]]
Rate exchange of
    $node[^xdoc.selectSingle[/ValCurs/Valute[CharCode='USD']]]
    "^node.selectString[string(Name)]"
for
    ^xdoc.selectString[string(/ValCurs/@Date)]
is
    ^node.selectString[string(Value)]
<hr />
<pre>
^taint[^xdoc.
string[]]</pre>


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 21.09.2007