• 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.
  • Posts

    • "A Microsoft spokesperson said that it had been in contact with the court since February “throughout the process that resulted in the disconnection of its sanctioned official from Microsoft services.” The spokesperson added that “at no point did Microsoft cease or suspend its services to the ICC.” Microsoft declined to comment further in response to questions regarding the exact process that led to Khan's email disconnection, and exactly what it meant by “disconnection.” The ICC declined to comment. However, German business magazine WirtschaftsWoche reported Tuesday that Microsoft's lawyers have now reached the view that it merely provides a technical platform and that its customers decide whether to give their employees access to its services. Microsoft would no longer intervene in scenarios similar to the ICC case, WirtschaftsWoche wrote." Source: https://www.politico.eu/articl...ump-tech-icc-amazon-google/ So while they haven't targeted the ICC, they seem to have targeted a sanctioned individual and cut that individual off from their services. At least I cannot read the statement from their spokesperson in any other way. It can however be understood as they did this on behalf of the ICC, which would line up with Smith's statements that they never cut off services to the ICC. But I don't know if there is any confirmed sources back that up.
    • Oof, that's a pretty glaring issue. They seem to be consistently proving that they don't do the necessary QA before sending things out.
    • They have removed th way to download directly the iso of windows from rufus ? i have tried the version 4.9, the button selection isn't a select list to choose download
  • Recent Achievements

    • Week One Done
      patrickft456 earned a badge
      Week One Done
    • One Month Later
      patrickft456 earned a badge
      One Month Later
    • One Month Later
      Jdoe25 earned a badge
      One Month Later
    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      617
    2. 2
      ATLien_0
      281
    3. 3
      +FloatingFatMan
      174
    4. 4
      Michael Scrip
      153
    5. 5
      Steven P.
      125
  • Tell a friend

    Love Neowin? Tell a friend!