Found in http://www.codetoad.com/xml/beginners_guides/newsfeed.asp
<%
dim objHTTP , objXML , objXSL
set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.open "GET", "www.yourdomain.com/yourXmlfile.xml", false
objHTTP.send
set objXML = objHTTP.responseXML
set objXSL=Server.CreateObject("microsoft.xmldom")
objXSL.async=false
objXSL.load(Server.MapPath("style.xsl"))
if (objXSL.parseError.errorCode = 0) then
Response.Write(objXML.transformnode(objXSL))
else
Response.Write "Error: " & objXSL.parseError.reason & "<br> URL:" & objXSL.url
end if
Set objHTTP = Nothing
Set objXML = Nothing
Set objXSL = Nothing
%>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>moreover...</TITLE>
</HEAD>
<BODY BGCOLOR="ffffff">
<br/><br/>
<br/>
<DIV ALIGN="center">
<TABLE BGCOLOR="ffffff" BORDER="0" CELLPADDING="4" CELLSPACING="0" WIDTH="100%">
<xsl:for-each select="moreovernews/article">
<TR VALIGN="middle">
<TD ALIGN="left" BGCOLOR="ffffff">
<B>
<A>
<xsl:attribute name="HREF">
<xsl:value-of select="url"/>
</xsl:attribute>
<xsl:attribute name="TARGET">
_blank
</xsl:attribute>
<FONT FACE="Verdana, Arial,Helvetica, sans-serif" SIZE="-1" COLOR="000000">
<xsl:value-of select="headline_text"/>
</FONT>
</A>
</B>
<BR/>
<A>
<xsl:attribute name="HREF">
<xsl:value-of select="document_url"/>
</xsl:attribute>
<xsl:attribute name="TARGET">
_blank
</xsl:attribute>
<FONT FACE="Verdana, Arial,Helvetica, sans-serif" SIZE="-2" COLOR="666666">
<xsl:value-of select="source"/>
</FONT>
</A>
<A>
<xsl:attribute name="HREF">
<xsl:value-of select="access_registration"/>
</xsl:attribute>
<xsl:attribute name="TARGET">
_blank
</xsl:attribute>
<FONT FACE="Verdana, Arial,Helvetica, sans-serif" SIZE="-2" COLOR="666666">
<xsl:value-of select="access_status"/>
</FONT>
</A>
<FONT FACE="Verdana, Arial,Helvetica, sans-serif" SIZE="-2" COLOR="666666">
<xsl:value-of select="harvest_time"/> GMT
</FONT>
</TD>
</TR>
</xsl:for-each>
</TABLE>
</DIV>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
No comments:
Post a Comment