XML Script
The two area's that I need to get the values from are
<media:starRating count="92070"/> (The count)
<media:statistics views="2151299"/> (The Views)
@Nitin
>> Shooting in pitch black dark!
What do you mean? I provided all the source code, for you to compile together in order to give a working example for your answer.
So, why would you come in and say: Shooting in pitch black dark.
The only whay that would be true, is if I would have provided just information and no source code.
I tested out your code as well, and it gave me an error.
Expected end of statement
/test/asp/test.asp, line 10
sCount = Rating.GetAttribute[0].text
-------------------------------------------^
@mccarl
Your code gives me the following error.
Expected token 'eof' found '@'. media:group/media:community/media:starRating-->@<--count
@zc2
That is fine, in the actual project, that it already set.
I am wanting to find out how to get the COUNT and the VIEWS at this moment.
@Scott.
I will check out the link you provided.
Wayne Barron
ASKER
@Scott.
I looked at your code, and could not make sense of it. Sorry.
I tried this.
set Rating = xmlProduct.selectSingleNode("media:group/media:community/media:starRating")
sCount = Rating.Item(0).getAttribute("count")
It gives me the following error.
Object doesn't support this property or method: 'Rating.Item'
So, with the newly found knowledge from trying that.
I took the example from Nitin
And change the [] to ()
sCount = Rating.Attributes(0).text
And it worked.
I am good to go on this one.
Wayne Barron
ASKER
I have to add one last thing here.
I had to SET the Variable.
Be careful with the code that you have posted, in case the there can be more than one attribute on the starRating element and "count" is not the first one.
Wayne Barron
ASKER
@Nitin.
No problem, I was able to use your code, with some tweaking.
@mccarl.
I will test later on.
Right now, I have a working code.
Open in new window