Cannot Open an XML document through http on Win2K

Cannot Open an XML document through http on Win2K

Post by Anthony Youn » Sat, 01 Apr 2000 04:00:00



I am trying to open an XML document on a Win2K Advanced Server through ASP.
I am able to open it through the file system, but as soon as I try through
http request it fails with "The system cannot locate the object specified".
The http request is for the local machine.  Any help would be great!

Thanks,
Anthony Young

Sample Code:

XMLLoaded

 Sub XMLLoaded()
      Dim local_xmlparseerror
      Set global_xmldoc =  Server.CreateObject("Microsoft.XMLDOM.1.0")
      global_xmldoc.async = False
      global_xmldoc.validateOnParse = False
      global_xmldoc.resolveExternals = False

     ' It fails loading here and then the parseError object returns the
error message
      If Not global_xmldoc.load("http://localhost/personal/default.xml")
Then
           Set local_xmlparseerror = global_xmldoc.parseError
           Response.Write "<h1>Error Occurred</h1><b>" &
local_xmlparseerror.errorCode & "</b><br><b>"             &
local_xmlparseerror.url & "</b><br>" & local_xmlparseerror.reason & "<br>" &
local_xmlparseerror.srcText
      End If
 End Sub

 
 
 

Cannot Open an XML document through http on Win2K

Post by Chris Lovet » Sat, 01 Apr 2000 04:00:00


Loading URL's from an ASP page is broken.

Try changing this to
    global_xmldoc.load(Server.MapPath("default.xml"))


Quote:> I am trying to open an XML document on a Win2K Advanced Server through
ASP.
> I am able to open it through the file system, but as soon as I try through
> http request it fails with "The system cannot locate the object
specified".
> The http request is for the local machine.  Any help would be great!

> Thanks,
> Anthony Young

> Sample Code:

> XMLLoaded

>  Sub XMLLoaded()
>       Dim local_xmlparseerror
>       Set global_xmldoc =  Server.CreateObject("Microsoft.XMLDOM.1.0")
>       global_xmldoc.async = False
>       global_xmldoc.validateOnParse = False
>       global_xmldoc.resolveExternals = False

>      ' It fails loading here and then the parseError object returns the
> error message
>       If Not global_xmldoc.load("http://localhost/personal/default.xml")
> Then
>            Set local_xmlparseerror = global_xmldoc.parseError
>            Response.Write "<h1>Error Occurred</h1><b>" &
> local_xmlparseerror.errorCode & "</b><br><b>"             &
> local_xmlparseerror.url & "</b><br>" & local_xmlparseerror.reason & "<br>"
&
> local_xmlparseerror.srcText
>       End If
>  End Sub


 
 
 

1. Cannot access XML data island in Win2K

I have the following XML data island created:

<XML ID="ActivityTypeXML">
<ActivityTypes>
  <ActivityType>
    <ActivityTypeId>184</ActivityTypeId>
    <ProcessTypeId>1</ProcessTypeId>
    <ChangeTo_ProcessStatusId>0</ChangeTo_ProcessStatusId>
    <ActivityName>Need for Confirmation Letter Sent</ActivityName>
    <DetailASP></DetailASP>
    <CorrFolderName></CorrFolderName>
    <CorrTemplateName></CorrTemplateName>
    <SelectToCC>False</SelectToCC>
    <SelectStatus>False</SelectStatus>
    <DisplaySeq>2020</DisplaySeq>
  </ActivityType>
  ...
</ActivityTypes>
</XML>

I have sucessfully accessed this data using the following JavaScript:

currNode = ActivityTypeXML.XMLDocument.documentElement.selectSingleNode
("ActivityType[ActivityTypeId="+lActivityTypeId+"]");

However, when I ran this in Win2K, I get the error:
Error:'ActivityTypeXML.XMLDocument.documentElement' is null or not an
object.

I have tried going to Win2K SP1, as well as upgrading to IE5.5, bu
nothing seems to make a difference.  It still works fine on Win98 and
NT4 with IE5 (all versions).

Any Ideas???
--
Tim Dallmann
Westminster, CO
http://www.dallmann.com

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Upgrading to Palm III: Difference US/EUROPE ??

3. Loop thru XML with VB - cannot get Node Name

4. Esoteric Settings Plugin: info on setting Boring Headers

5. XMLHTTPRequest.open method NT4 vs. Win2k

6. FS: IIe motherboard

7. Changing XML file thru HTTP

8. Trojan IPs

9. Win2k clean install Vs NT$ Upgrade to Win2k

10. http Post thru xmlHttp

11. Newbie- Cannot open xml I am given this error?

12. MSXML3.dll cannot open XML file

13. document(URI) function - Opening a document relative to the XML