• 0

[XML] Render RSS feed using JavaScript


Question

Hi all

I have searched this, and done some development, but to no avail.

I am looking to import a remote RSS feed, apply an XSLT transformation, and render it, in ASP.

So far I have:

<% 
dim xmlDoc, xslDoc

set xmlDoc = Server.CreateObject("Msxml2.DomDocument")
xmlDoc.async = false
xmlDoc.load("http://www.theregister.co.uk/internet/excerpts.rsset xslDoc = Server.CreateObject("Msxml2.DomDocument")
xslDoc.async = false
xslDoc.load("render.xsllDoc.transformNodeToObject xslDoc, Response
%>

With a very simple Render.xsl containing:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">;xsl:template match="rss/">
  <html>
  <body>
    <xsl:for-each select="item">
    	<xsl:value-of select="title"/>
    </xsl:for-each>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

But upon executing the page I get:

  Quote
Error Type:

msxml3.dll (0x80004005)

The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.

Any help?

Edited by njlouch
Link to comment
https://www.neowin.net/forum/topic/279222-xml-render-rss-feed-using-javascript/
Share on other sites

3 answers to this question

Recommended Posts

  • 0

It can, you're just using the wrong component.

MSXML2.DOMDocument is used for local files (as in accessible via the filesystem from the current execute location)

MSXML2.ServerXMLHTTP is the kiddie you want to retrieve a remote file. Then you can get the XSL and transform the XML.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.