Ok, to take the discussion regarding XML to a new level here is a function that will load an XML document from a local file, from the internet, or from a string.

It uses Microsoft.XMLDOM, which is available with all versions of IE from ver 5 and up.

To learn more about XML DOM you can review the following resources:

http://www.w3schools.com/dom/default.asp
http://www.devguru.com/Technologies/xmldom/quickref/xmldom_index.html

Currently, this function returns a string value representing the XML document. This can then be loaded into another XML parser for further manipulation. I could also just return the object itself and then that object could be further manipulated.

Anyway, I'd like to post this for further comment.

Code:

Break On
$nul=SetOption("WrapAtEOL","on")

$sFromFile = "mycomputer.xml"
$sFromHttp = "http://www.nytimes.com/services/xml/rss/userland/Books.xml"
$sFromString = '
<remoteDir>
<dir>1394</dir>
<dir>backoffice</dir>
<dir>Clients</dir>
<dir>distapps</dir>
<dir>exchange</dir>
<dir>GEN_INFO</dir>
<dir>IIS</dir>
<dir>lanman</dir>
<dir>mail</dir>
<dir>mcis</dir>
<dir>mspress</dir>
<file>
<name>readme.txt</name>
<size>1715</size>
<lastModTime m="5" d="20" y="1996" hh="0" mm="0" ss="0" />
</file>
<file>
<name>ReadMe1.txt</name>
<size>2107</size>
<lastModTime m="7" d="2" y="2002" hh="0" mm="0" ss="0" />
</file>
<dir>sitesrv</dir>
<dir>sql</dir>
<dir>Sysmgrsrv</dir>
<dir>utilities</dir>
<dir>viper</dir>
<dir>winnt</dir>
<dir>WinSock</dir>
</remoteDir>'
$sFromError = '
<remoteDir>
<dir>1394</di>
</remoteDir>'


fnLoadXML($sFromFile,1) ?
@ERROR " | " @SERROR ?
Get $

fnLoadXML($sFromHttp,2) ?
@ERROR " | " @SERROR ?
Get $

fnLoadXML($sFromString,3) ?
@ERROR " | " @SERROR ?
Get $

fnLoadXML($sFromError,3) ?
@ERROR " | " @SERROR ?
Get $

Function fnLoadXML($sXML,$sFrom)
; $sFrom: 1 = File; 2 = HTTP; 3 = String
Dim $xmlDoc,$xmlHttp,$nul

$xmlDoc = CreateObject("Microsoft.XMLDOM")
If @ERROR Exit 10 EndIf
$xmlDoc.async = 0

Select
Case $sFrom = 1
$nul = $xmlDoc.load($sXML)
Case $sFrom = 2
$xmlHttp = CreateObject("Microsoft.XMLHTTP")
If @ERROR Exit 10 EndIf
$xmlHttp.open("GET",$sXML,0)
$xmlHttp.send()
$nul = $xmlDoc.loadXML($xmlHttp.responseText)
Case $sFrom = 3
$nul = $xmlDoc.loadXML($sXML)
Case 1 Exit 87
EndSelect

If $xmlDoc.parseError.errorCode
$fnLoadXML = $xmlDoc.parseError.reason + $xmlDoc.parseError.line
Exit $xmlDoc.parseError.errorCode
EndIf

$fnLoadXML = $xmlDoc.xml

EndFunction