XML help needed

M

Mike Mueller

I am trying to pull weather information for my website. The
error I receive is that the information is:

error '8000000a'
The data necessary to complete this operation is not yet
available.
/Developement/Weather.asp, line 11

Source code here, StyleWeather.xsl follows:

<html><head>
<%
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.load("http://www.ejse.com/WeatherService/Service.asmx/GetWeatherInfo?zipCode=53046")
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.load(Server.MapPath("StyleWeather.xsl"))
%>
</head>
<body>
<%
Response.Write(xml.transformNode(xsl))
xsl = nothing
xml = nothing
%>
</body>
</html>

stylesheet:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">

<xsl:for-each select="WeatherInfo">
<br/><b><xsl:value-of select="@title"/></b>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>
 
P

Peter Aitken

Mike Mueller said:
I am trying to pull weather information for my website. The
error I receive is that the information is:

error '8000000a'
The data necessary to complete this operation is not yet
available.
/Developement/Weather.asp, line 11

Source code here, StyleWeather.xsl follows:

<html><head>
<%
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.load("http://www.ejse.com/WeatherService/Service.asmx/GetWeatherInfo?zip
Code=53046")
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.load(Server.MapPath("StyleWeather.xsl"))
%>
</head>
<body>
<%
Response.Write(xml.transformNode(xsl))
xsl = nothing
xml = nothing
%>
</body>
</html>

stylesheet:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">

<xsl:for-each select="WeatherInfo">
<br/><b><xsl:value-of select="@title"/></b>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

The load method is by default aynchronous which means it can return control
to your script before the XML file has actually been loaded. I think that's
what's happening. Your program can set up a loop to test the readystate
property. When it is 4 then the load has completed. You should also test the
return value of load which will be true if the load was successful.

BTW your code is missing a couple of Sets.
 
M

Mike Mueller

Thank you Peter,
I have cured that problem by adding in xml.asynch =
"false" which holds up the production until the data is in.
Now I just get a blank page returned to me. I would guess
that is a problem with the stylesheet. You had mentioned I
was missing some sets. Can you elaborate on this?


message
: : > I am trying to pull weather information for my website.
The
: > error I receive is that the information is:
: >
: > error '8000000a'
: > The data necessary to complete this operation is not yet
: > available.
: > /Developement/Weather.asp, line 11
: >
: > Source code here, StyleWeather.xsl follows:
: >
: > <html><head>
: > <%
: > set xml = Server.CreateObject("Microsoft.XMLDOM")
: >
:
xml.load("http://www.ejse.com/WeatherService/Service.asmx/GetWeatherInfo?zip
: Code=53046")
: > set xsl = Server.CreateObject("Microsoft.XMLDOM")
: > xsl.load(Server.MapPath("StyleWeather.xsl"))
: > %>
: > </head>
: > <body>
: > <%
: > Response.Write(xml.transformNode(xsl))
: > xsl = nothing
: > xml = nothing
: > %>
: > </body>
: > </html>
: >
: > stylesheet:
: >
: > <?xml version='1.0'?>
: > <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
: > <xsl:template match="/">
: >
: > <xsl:for-each select="WeatherInfo">
: > <br/><b><xsl:value-of select="@title"/></b>
: > </xsl:for-each>
: >
: > </xsl:template>
: > </xsl:stylesheet>
: >
: >
:
: The load method is by default aynchronous which means it
can return control
: to your script before the XML file has actually been
loaded. I think that's
: what's happening. Your program can set up a loop to test
the readystate
: property. When it is 4 then the load has completed. You
should also test the
: return value of load which will be true if the load was
successful.
:
: BTW your code is missing a couple of Sets.
:
:
: --
: Peter Aitken
:
: Remove the crap from my email address before using.
:
:
 
P

Peter Aitken

Mike Mueller said:
Thank you Peter,
I have cured that problem by adding in xml.asynch =
"false" which holds up the production until the data is in.
Now I just get a blank page returned to me. I would guess
that is a problem with the stylesheet. You had mentioned I
was missing some sets. Can you elaborate on this?

The statements

xsl = nothing
xml = nothing

need Set because they are object references. I don't think this is part of
your problem - just something I noticed.
 
M

Mike Mueller

Thank You again Peter

That is fixed. I can display the data now, now I need to
work on the stylesheet to format it.

Mike


message
: : > Thank you Peter,
: > I have cured that problem by adding in xml.asynch =
: > "false" which holds up the production until the data is
in.
: > Now I just get a blank page returned to me. I would
guess
: > that is a problem with the stylesheet. You had
mentioned I
: > was missing some sets. Can you elaborate on this?
: >
:
: The statements
:
: xsl = nothing
: xml = nothing
:
: need Set because they are object references. I don't think
this is part of
: your problem - just something I noticed.
:
: --
: Peter Aitken
:
: Remove the crap from my email address before using.
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top