Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael 22 posts 61 karma points
    Aug 11, 2014 @ 08:33
    Michael
    0

    GetXmlDocumentByUrl


    <xsl:variable name="feed" select="http://www.fx678.com/news/rss/news.xml"/>
    <xsl:variable name="cacheRate" select="number(1800)"/>
    <xsl:variable name="feedContent" select="umbraco.library:GetXmlDocumentByUrl($feed, number($cacheRate))"/>

    <xsl:value-of select="$feedContent"/>

    I use this method to get xml for RssFeed, but I try to output the variable $feedContent, there is a error follwing like this: 

    System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at umbraco.library.GetXmlDocumentByUrl(String Url)

    I don't know what's the reason, I notice the content of url includes image tags, I'm not sure if that is the reason.

    Hope someone could help me out, thanks very much. 

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Aug 11, 2014 @ 10:44
    Lee Kelleher
    0

    Hi Michael,

    It appears that the RSS feed isn't valid XML - hence the server error.

    Run it against the W3C validation service to see the errors:
    http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.fx678.com%2Fnews%2Frss%2Fnews.xml

    Are you in control of the RSS feed? or is it a 3rd-party service?

    I'm not too sure how you can fix it (if the RSS feed is out of your control).

    Cheers,
    - Lee

Please Sign in or register to post replies

Write your reply to:

Draft