Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 03-04-2004, 06:17 PM   PM User | #1
Steveo31
New Coder

 
Join Date: Feb 2004
Location: California
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Steveo31 is an unknown quantity at this point
Macintosh VBscript the only way to selectNodes()?

Again at w3schools.com...

In the XPath tut, they had some "try it yourself" code that kinda irked me. I am unfamiliar with VB and ASP, which is what this looks like:
Code:
<html>
<body>
<script type="text/vbscript">

set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("cdcatalog.xml")

path="/catalog/cd/price"
set nodes=xmlDoc.selectNodes(path)

for each x in nodes
  document.write("<xmp>")
  document.write(x.xml)
  document.write("</xmp>")
next

</script>
</body>
</html>
More importantly, the "CreateObject("Microsoft.XMLDOM"). Is this ASP or VB or...? Will I have to learn this language to utilize XML, XSLT, XPath, etc?

-S

[edit]

I'm guessing that
Code:
set nodes=xmlDoc.selectNodes(path)
Sets up a function/variable, much like something to the effect of
Code:
function sayHi(message){
alert(message)
}
sayHi("Hello")
in JavaScript. However, the "path" is not defined anywhere. It's just... there.

Again, I'm new to this, so bear with me.

[edit]

Last edited by Steveo31; 03-04-2004 at 06:24 PM..
Steveo31 is offline   Reply With Quote
Old 03-12-2004, 02:54 PM   PM User | #2
mpjbrennan
Regular Coder

 
Join Date: Jun 2002
Location: Newcastle, England
Posts: 178
Thanks: 0
Thanked 0 Times in 0 Posts
mpjbrennan is an unknown quantity at this point
set xmlDoc=CreateObject("Microsoft.XMLDOM") is VBscript. The JScript (Microsoft's implementation of javascript) equivalent is xmlDoc = new ActiveXObject("Microsoft.XMLDOM"). Look this up in a JScript tutorial but bear in mind that it will only work in IE.

patrick
mpjbrennan is offline   Reply With Quote
Old 03-16-2004, 09:39 PM   PM User | #3
Steveo31
New Coder

 
Join Date: Feb 2004
Location: California
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Steveo31 is an unknown quantity at this point
Ah finally a response!

If it only works in IE... ferget it.

Thanks.

Steveo31 is offline   Reply With Quote
Old 03-30-2004, 07:00 AM   PM User | #4
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,104
Thanks: 1
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
Quote:
Originally Posted by mpjbrennan
set xmlDoc=CreateObject("Microsoft.XMLDOM") is VBscript. The JScript (Microsoft's implementation of javascript) equivalent is xmlDoc = new ActiveXObject("Microsoft.XMLDOM"). Look this up in a JScript tutorial but bear in mind that it will only work in IE.

patrick
you can use the CreateObject("Microsoft.XMLDOM") in VBscript and in (serverside) JScript both to be used in ASP pages. the New ActiveXObject("Microsoft.XMLDOM") is the clientside (javascript) way to get a xml-dom object and you are right, the activeX will only work in IE
__________________
I am the luckiest man in the world
Roelf is offline   Reply With Quote
Old 04-12-2004, 02:32 AM   PM User | #5
Luke Redpath
New to the CF scene

 
Join Date: May 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Luke Redpath is an unknown quantity at this point
Quote:
Originally Posted by Steveo31
However, the "path" is not defined anywhere. It's just... there.
Yes it is, its defined in the line right above the one you quoted:

Code:
path="/catalog/cd/price"
__________________
Luke Redpath
Luke Redpath is offline   Reply With Quote
Old 04-16-2004, 12:49 AM   PM User | #6
Steveo31
New Coder

 
Join Date: Feb 2004
Location: California
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Steveo31 is an unknown quantity at this point
Quote:
Originally Posted by Luke Redpath
Yes it is, its defined in the line right above the one you quoted:

Code:
path="/catalog/cd/price"
Wow, I'm pretty dumb.

</stoopid>
Steveo31 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:06 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.