J
John Smith
Hi,
I'm trying to write a piece of ASP that will allow me to display only one
element of a XML file. I am new to XML and wanted to find out what I am
doing wrong. I think it may be to do with the nodes ? When this is currently
run it comes up with the error "Overflow" ('800a0006').
Any pointers or solutions ?
Thanks
J.
This is the XML (page.xml) :
<stocklist>
<stock tidm="VOD">
<exchange>LSE</exchange>
<symbol>VOD</symbol>
<fullname>VODAFONE GRP.</fullname>
<currency>GBX</currency>
<midprice>143.5 (28OCT)</midprice>
<bidprice>143.5</bidprice>
<offerprice>143.75</offerprice>
<valuechange>+2.5</valuechange>
<percentchange>+1.77</percentchange>
<yearhigh>156.5</yearhigh>
<yearlow>132.75</yearlow>
<dayhighmid>0</dayhighmid>
<daylowmid>0</daylowmid>
<volume>0</volume>
<tradecount>0</tradecount>
<previouscloseprice>141</previouscloseprice>
<timestamp>Sun Oct 30 13:46:01 2005</timestamp>
</stock>
</stocklist>
And this is the code that should output the "midprice" :
<%
Option Explicit
Response.Buffer = True
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("page.xml"))
Dim midprice,stocklist
Set midprice = xml.documentElement.selectNodes(stocklist/midprice).text
%>
<%= midprice %>
I'm trying to write a piece of ASP that will allow me to display only one
element of a XML file. I am new to XML and wanted to find out what I am
doing wrong. I think it may be to do with the nodes ? When this is currently
run it comes up with the error "Overflow" ('800a0006').
Any pointers or solutions ?
Thanks
J.
This is the XML (page.xml) :
<stocklist>
<stock tidm="VOD">
<exchange>LSE</exchange>
<symbol>VOD</symbol>
<fullname>VODAFONE GRP.</fullname>
<currency>GBX</currency>
<midprice>143.5 (28OCT)</midprice>
<bidprice>143.5</bidprice>
<offerprice>143.75</offerprice>
<valuechange>+2.5</valuechange>
<percentchange>+1.77</percentchange>
<yearhigh>156.5</yearhigh>
<yearlow>132.75</yearlow>
<dayhighmid>0</dayhighmid>
<daylowmid>0</daylowmid>
<volume>0</volume>
<tradecount>0</tradecount>
<previouscloseprice>141</previouscloseprice>
<timestamp>Sun Oct 30 13:46:01 2005</timestamp>
</stock>
</stocklist>
And this is the code that should output the "midprice" :
<%
Option Explicit
Response.Buffer = True
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("page.xml"))
Dim midprice,stocklist
Set midprice = xml.documentElement.selectNodes(stocklist/midprice).text
%>
<%= midprice %>