WordPress.org

Support

Support » How-To and Troubleshooting » XML-Error, OPML-Import

XML-Error, OPML-Import

  • Since upgrading to WP 2.1 I get this Error when importing my opml-file:

    Importing…
    XML error: no element found at line 1

    Inserted 0 links into category 56. All done! Go manage those links.

    I searched in the Forum, but can’t find any relating post to WP 2.1. Before upgrading to 2.1 I got the latest 2.0 – Version running and had no Problems with importing from file.

    Any hints or resolutions?

Viewing 15 replies - 16 through 30 (of 31 total)
  • For people looking for a quick hack, the following patch did the trick for me. I am not a WP hacker, so just replaced the wp function with the php builtin.

    Index: wp-filer/link-import.php
    ===================================================================
    --- wp-filer/link-import.php    (revision 303)
    +++ wp-filer/link-import.php    (revision 304)
    @@ -97,7 +97,11 @@
                                    }
    
                     if (isset($opml_url) && $opml_url != '') {
    -                    $opml = wp_remote_fopen($opml_url);
    +                        if (substr($opml_url,0,4) == 'http') {
    +                                $opml = wp_remote_fopen($opml_url);
    +                        } else {
    +                                $opml = file_get_contents ($opml_url);
    +                        }
                         include_once('link-parse-opml.php');
    
                         $link_count = count($names);

    thx!

    Works fine! You made my day 🙂

    what file did you edit?

    /wp-admin/link-import.php

    Worked for me as well. Thanks! That’s a relief!

    Sorry if this is a really dumb question, but how do I apply that patch? (still getting to grips with WordPress). Mark

    I’d love some more explicit instructions too please!

    Anyone able to help out learnerblogger and I? Or can someone confirm if this is fixed in 2.1.3? M

    cfm, it’s fixed in the 2.1.3-Release. I’ve tested it out with my google-reader.opml-File.

    So I think, this case is closed.

    bye, Kim

    I still can’t get my OPML file to import.

    I have tried an OPML created by FeedDemon and one created in Bloglines but still get the same error …

    XML error: no element found at line 1

    And yes, I have upgraded to WP2.1.3

    @kimhbel – thanks, although I still couldn’t get it to work using a local file – only via URL (I also used Google Reader)

    @learnerblogger – see above – try importing from a file in your webspace. You could also try to validate your OPML.

    nizz and others
    i have the right file , thankyou
    /wp-admin/link-import.php

    now where do i insert the below code in link-import.php?
    and do i have to delete anything?

    --- wp-filer/link-import.php    (revision 303)
    +++ wp-filer/link-import.php    (revision 304)
    @@ -97,7 +97,11 @@
                                    }
    
                     if (isset($opml_url) && $opml_url != '') {
    -                    $opml = wp_remote_fopen($opml_url);
    +                        if (substr($opml_url,0,4) == 'http') {
    +                                $opml = wp_remote_fopen($opml_url);
    +                        } else {
    +                                $opml = file_get_contents ($opml_url);
    +                        }
                         include_once('link-parse-opml.php');
    
                         $link_count = count($names);

    Hi.

    You must open the file “link-import.php” in a text-editor of your trust and search for the line that is commented with the single “-” ($opml = wp_remote_fopen($opml_url);). This line you must comment out and put in the code marked with “+” after the line… then it would work fantastic 🙂

    I had the same error with version 2.1.3. I modified the file as suggested but the only change is that now it reports that it’s importing links and that they’ve been inserted, but when I go in the management page there’s nothing.
    I updated to WP 2.2 but it’s the same thing. I deleted old link-import.php and uploaded the new one, and I get the same result as with the old, modified, one: it still looks like everything goes fine but then there’s nothing. I tried also the http method, uploading opml on my web space, but the result is, again, the same.
    Any idea about how this could be solved?

    Thanks in advance.

    Okay, I got the same exact error that everyone else did. I am the least technologically advanced person you’ll ever meet, and so I need very specific, step-by-step instructions on how to make a work around. I went to my /wp-admin/link-import.php page, and absolutely nowhere on there was all of that code. It says:

    Import your blogroll from another system
    If a program or website you use allows you to export your links or subscriptions as OPML you may import them here.
    Specify an OPML URL:
    Or choose from your local disk:

    No codes anywhere.

    Can someone please help me out? Remember, simple step-by-step instructions for the technology-impaired. 😉

    On a related note, I’m surprised this is an issue at all. I am porting from WP.com to WP.org, and so it seems like my blogroll would have ported along with everything. Is that going to be changed in an upcoming release? And if that isn’t going to be changed, can I suggest that along with having an “import the blogroll” tab in the admin, that there also be an “export the blogroll” tab? The only reason I knew how to export was because of doing a search on here and finding another thread that said the webpage to go to, to find my XML file. Why do we allow imports if we don’t have the ability to export (easily anyway)?

    Okay, I’m all done whining now, I promise. 😛 My thanks for any help or light you guys can shed on the subject. 🙂

    Hava

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘XML-Error, OPML-Import’ is closed to new replies.