Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:14:22+00:00 2026-06-17T20:14:22+00:00

I have created a script that take XML from URL and updates mysql database

  • 0

I have created a script that take XML from URL and updates mysql database and parses data to csv file.

I get HTML strings in XML and they should not be there. How to remove them while parsing?

I load XML file like this:

$xml = simplexml_load_file(utf8_encode($xml_url), 'SimpleXMLElement', LIBXML_NOCDATA);

Error that I get when running the script:

Warning: simplexml_load_file() [function.simplexml-load-file]: http://domain.com/api/get_catalog.php?id=351&user=878&key=b8:1: parser error : Space required after the Public Identifier in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: http://domain.com/api/get_catalog.php?id=351&user=878&key=b8:1: parser error : SystemLiteral " or ' expected in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: http://domain.com/api/get_catalog.php?id=351&user=878&key=b8:1: parser error : SYSTEM or PUBLIC, the URI is missing in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /dokumenti/skripte/xmlupdate/lost/test/lost_xml.php on line 59
xml $ not loaded.

When I use a Firefox and save XML from url to disk I have no problem parsing it just when I try to get it from url.

XML looks fine:
Part of XML:

<?xml version="1.0" encoding="UTF-8"?>
<RecroKatalog>
<viewCustomerDiscount>
    <BrojArtikla>10214</BrojArtikla>
    <Naziv>Eksterno kucište 2.5&quot; S-ATA+IDE HDD, Aluminium, USB 2.0</Naziv>
    <NetoPrice>81.8224</NetoPrice>
    <Status>Dostupno</Status>
    <Opis></Opis>
    <dugi_opis>Isporucuje se u SIVOJ boji</dugi_opis>
    <Image>http://shop.lost.hr/data/images/big/10.jpg</Image>
    <WEB_Grupa>Ladice i eksterna kucišta - OSTALO</WEB_Grupa>
    <Akcija>0</Akcija>
    <Proizvodjac></Proizvodjac>
    <Klasifikacija>PH-25SD-B/VK220</Klasifikacija>
</viewCustomerDiscount>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:14:23+00:00Added an answer on June 17, 2026 at 8:14 pm

    There are some HUGE clues in the error messages. It is complaining about seeing:

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    

    It is the start of a HTML document being provided by that website… not the XML you’re looking for.

    This usually happens when you have to authenticate against the remote service (hence working in your browser, as you logged in), but you’re not telling SimpleXML to do that for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that is created by a script that is run during
I have created the following script that move old days files as defined from
I have created a script that saves some files in the Documents directory of
I have created a script that will upload files to a general uploads folder,
I have created a Greasemonkey script that runs fine in the firebug editor, with
I have created an R script that it needs to load some libraries first.
I have created one ruby script that I want to run with some flags
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have a script task that executes a dynamically created SQL restore statement. This
I have to create a script that takes a mySQL table, and exports it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.