th3Phallex
Newbie
- Joined
- Dec 1, 2004
- Messages
- 131
- Reaction score
- 0
I am trying to use the news feed that is supplied by this site.
First, I have an ASP page that does this:
Also, I have an .XSL page that is doing this:
I have made it work using the SteamPowered.com RSS feed, but it won't work with this site. I've changed all the variables to be the correct names (title, description, link, etc...) and it still won't even get anything to show.
The STEAM feed is an .XML file, whereas the feed from HL2.net is a link:
http://www.halflife2.net/forums/external.php?type=rss&forumids=32.
I also noticed that this site has a PHP page that generates the XML. Does this matter?
Pleeeeeez help!
First, I have an ASP page that does this:
PHP:
<%
' define the variables
dim objHTTP , objXML , objXSL
'create an instance of the xmlHTTP object
set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
' get the requested XML data from website
objHTTP.open "GET", "http://www.halflife2.net/forums/external.php?type=rss&forumids=32", false
objHTTP.send
' save the XML in the objXML object as XML
set objXML = objHTTP.responseXML
'create an instance of the DOM obdct
set objXSL=Server.CreateObject("microsoft.xmldom")
objXSL.async=false
' load the XSL style sheet into the objXSL object
objXSL.load(Server.MapPath("hl2net.xsl"))
' check for errors in the XSL
if (objXSL.parseError.errorCode = 0) then
' parse the XML with the XSL file
Response.Write(objXML.transformnode(objXSL))
else
'if an error occurs, report it
Response.Write "Error: " & objXSL.parseError.reason & "[br] URL:" & objXSL.url
end if
'destroy the objects
Set objHTTP = Nothing
Set objXML = Nothing
Set objXSL = Nothing
%>
Also, I have an .XSL page that is doing this:
PHP:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>RSS Test</TITLE>
</HEAD>
<BODY BGCOLOR="ffffff">
<DIV ALIGN="center">
<TABLE BGCOLOR="ffffff" CELLPADDING="4" CELLSPACING="0" >
<xsl:for-each select="channel/item">
<xsl:choose>
<xsl:when expr="childNumber(this) > 5"></xsl:when>
<xsl:otherwise>
<TR VALIGN="middle">
<TD ALIGN="left" BGCOLOR="ffffff">
[b]
<A>
<xsl:attribute name="HREF">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:attribute name="TARGET">
_blank
</xsl:attribute>
<FONT SIZE="1" COLOR="000000">
<xsl:value-of select="title"/>
</FONT>
[/url]
[/b]
</TD>
</TR>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</TABLE>
</DIV>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I have made it work using the SteamPowered.com RSS feed, but it won't work with this site. I've changed all the variables to be the correct names (title, description, link, etc...) and it still won't even get anything to show.
The STEAM feed is an .XML file, whereas the feed from HL2.net is a link:
http://www.halflife2.net/forums/external.php?type=rss&forumids=32.
I also noticed that this site has a PHP page that generates the XML. Does this matter?
Pleeeeeez help!