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

XML problems using on ASP page

Status
Not open for further replies.

hallm

Programmer
Jun 11, 2000
159
US
On my online news site I need to be able to retrieve information from a remote xml page that updates every day. The script (which is being used by several sites in our area) works fine when I test it locally, but when I test it on my nt server (I lease server space from another company) I get the following error.

error '800c0007'
/test/start.asp, line 571

Line 571 is the line in my script that defines the remote url. I have the relevant parts of the script below. The network admins (server people) have been working on this for a week and they blame the xml data provider. But it works on my local system (which is only using PWS). Is this me or them? Am I doing something wrong? Any comments would be appreciated.

Complete script:

<%
Dim XML
Set XML = Server.CreateObject(&quot;msxml&quot;)
XML.URL = &quot;
Dim readings
Set readings = XML.root.children
Dim station
Set station = readings.item(0)
%>
<font size=&quot;1&quot;>Last modified on <% Response.Write(station.children.item(&quot;date&quot;).text)%></font></font></i><font color=&quot;#00ff00&quot;><br>
<font size=&quot;1&quot;><b>Elevation: <% Response.Write(station.children.item(&quot;elevation&quot;).text)%>
ft msl</b></font><br>
<font size=&quot;1&quot;>Minimum Temperature: <% Response.Write(station.children.item(&quot;min_temp&quot;).text)%>º</font><br>
<font size=&quot;1&quot;>Maximum Temperature: <% Response.Write(station.children.item(&quot;max_temp&quot;).text)%>º</font>
 
I'm wondering how to merge html fragments and layout using XSLT.

Say I have a XML file containing an HTML fragment:

Code:
<root>
   <fragment>
      <B>test</B>
   </fragment>
</root>

BTW, I need to build this XML using the DOM.

And an XSLT:

Code:
<xsl:stylesheet xmlns:xsl=&quot;[URL unfurl="true"]http://www.w3.org/TR/WD-xsl&quot;>[/URL]
	<xsl:template match=&quot;/&quot;>
	 <html>
	 <body>
            <p><xsl:value-of select=&quot;//fragment&quot;/></p>
	 </body>
	 </html>
	</xsl:template>
</xsl:stylesheet>

How do I make this work? I've tried a couple of things like using Cdata sections for the Html, but the result is always NOT html, but escaped html. Yours,

Rob.
 
(Oops; reply instead of post) Yours,

Rob.
 
Hallm-

I am having this same problem. Did you ever get this resolved?

Thanks

Aleksandra
 
Hi,

You could do something like this:

Code:
<xsl:stylesheet xmlns:xsl=&quot;[URL unfurl="true"]http://www.w3.org/TR/WD-xsl&quot;>[/URL]
    <xsl:template match=&quot;/&quot;>
     <html>
     <body>
	<p>
	<xsl:apply-templates select=&quot;root/fragment/B&quot;/>
        </p>
     </body>
     </html>
    </xsl:template>


    <xsl:template match=&quot;B&quot;>
	<xsl:copy>
		<xsl:value-of select=&quot;.&quot;/>
	</xsl:copy>
    </xsl:template>

</xsl:stylesheet>

Jordi Reineman
Cap Gemini Ernst & Young
 
hallm - i just tried fetching the file myself and got a 111 - connection refused error. is the xml url correct?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top