Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open XML file

Status
Not open for further replies.

emms

Programmer
Jan 11, 2001
55
GB
Is there any reason I can't do this is Jscript?

XMLDoc = CreateObject("Microsoft.XMLDOM");
XMLDoc.async = False;
XMLDoc.load("c:\aspnet\" & Request.Form("FileLocat"));
Set rootNode = XMLDoc.documentElement;

I get this error back:

Expected ')'
/home/ViewXML.asp, line 65, column 41
XMLDoc.load("c:\aspnet\" & Request.Form("FileLocat"));


If there's a better way please let me know!

Emma
 
this looks fishy
XMLDoc.load("c:\aspnet\" & Request.Form("FileLocat"));

maybe suppose to be
XMLDoc.load("c:\aspnet\" + Request.Form("FileLocat") + ")";
or simply
XMLDoc.load(Server.MapPath(Request.Form("FileLocat"));

not sure on jscript using the eval function but you may also need this in there.

_________________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
thanks, I've taken that bit out (moved the file to the same folder).

now I've got:

XMLDoc = Server.CreateObject("Microsoft.XMLDOM"); XMLDoc.async = false;
XMLDoc.Load(Request.Form("FileLocat"));
rootNode = XMLDoc.documentElement;

and it's telling me "Object doesn't support this property or method" on the XMLDoc.Load() line...

do you know anywhere that could give me examples of how to open xml files in asp using JScript. had a search but i can't find anything!

thanks for your help

Emma
 

a few



_________________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
that's great thanks!

just solved my own problem (well that one anyway).

I needed to put the Server.MapPath that you suggested in!

thanks for your time

Emma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top