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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML with Jscript

Status
Not open for further replies.

emms

Programmer
Jan 11, 2001
55
0
0
GB
Hi,

I'm having trouble finding any resources to help me with this.

I need to open an XML document and display it to the screen using JSCRIPT. The web seems full of info for VBscript but unfortunately that's no good.

Any help would be great!

Emma
 
The objects and methods that you would use for server-side VBScript are going to have the same names and methods if you use server-side JScript, you just have to be more careful about capitalization.
That means you could take a server-side VBScript example and modify it to JScript by just changing the syntax, ie putting semi-colons on the end of every line, using +'s instead of &'s etc.

-Tarwn

[sub]01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101 [/sub]
[sup]29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19[/sup]
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
I assume you want to run some Javascript ASP to open a server-side XML document?

Just use the MSXML2.FreeThreadedDOMDocument object.

e.g. (from memory)

<%
var str_DocName = &quot;myxmldoc.xml&quot;;
var obj_xml = Server.CreateObject(&quot;MSXML2.FreeThreadedDOMDocument&quot;);
var bln_Parsed = obj_xml.load(Server.MapPath(str_DocName));
if (bln_Parsed) {//do stuff}
else Response.write(obj_xml.ParseError.Reason);
%>

You can add proper try/catches yerself :p

codestorm
Newbie Life Member.
Fire bad. Tree pretty. - Buffy
<insert witticism here>
 
thanks guys,

managed to get it working using mostly the VB stuff...

finally!

thanks again for your help

Emma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top