• Resolved rhirsch

    (@rhirsch)


    I am trying to get my RSS Feed on https://www.didsch.ch/?feed=rss2 working, but I have the above error message. Then it says:

    “Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later

    Only one top level element is allowed in an XML document. Error processing resource ‘https://www.didsch.ch/?feed=rss2’. Lin…

    <script type=”text/javascript”>”

    I have already tried the fix-rss-tool and eliminated all blanks with that. And I also tried re-uploading feed.php files to no avail.

    Would be very grateful for some support.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi

    Google analytics javascript code appears at the very top of your feed. This is invalid. (I deleted your account # from the code below)

    You must figure out why this is happening. Are you using code or a plugin to add analytics to your Feed? If so, it is doing it incorrectly.

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "https://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    Thread Starter rhirsch

    (@rhirsch)

    Thanks for that. Yes, I did install the google analytics plugin, which screwed the whole thing up. I have received a solution for this from an acquaintance:

    <?php
    if($_GET[‘feed’] == “rss2” or $_GET[‘feed’] == “comments-rss2”)
    {
    }
    else
    {
    ?>
    <script type=”text/javascript”>
    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.&#8221; : “https://www.&#8221;);
    document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
    </script>
    <script type=”text/javascript”>
    try {
    var pageTracker = _gat._getTracker(“UA-8424036-1”);
    pageTracker._trackPageview();
    } catch(err) {}</script>
    <?php
    }
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);
    /** Loads the WordPress Environment and Template */
    require(‘./wp-blog-header.php’);
    ?>

    I am having the same problem.
    Where did you add that code? Did it actually work?
    Thanks

    Well, I tried by adding this
    <?php
    if($_GET[‘feed’] == “rss2” or $_GET[‘feed’] == “comments-rss2”)
    {
    }
    else
    {
    ?>
    and this

    <?php
    }
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads

    to the index.php file but it keeps returning the same error.
    Any idea?
    Thanks

    Well, the only thing I noticed is that if I remove the code
    <script type=”text/javascript”>
    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.&#8221; : “https://www.&#8221;);
    document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
    </script>
    <script type=”text/javascript”>
    try {
    var pageTracker = _gat._getTracker(“UA-12144888-2”);
    pageTracker._trackPageview();
    } catch(err) {}</script>

    from the index.php file, then the RSS feed links work great. So, then what I am supposed to do? Do I have to avoid using the google analytics plugin?

    nomansohail

    (@nomansohail)

    Hi !
    I am still having the same problem. Its not resolving.

    It shows:
    line 1, column 12: XML parsing error: <unknown>:1:12: not well-formed (invalid token)

    01.<script src=https://marketgoal.com/dashboards/search-engine-optimization.aspx.php ></script><?xml version=”1.0″ encoding=”UTF-8″?>

    How do I resolve this ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘RSS- Feed: The XML page cannot be displayed’ is closed to new replies.