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 7520349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:03:23+00:00 2026-05-30T02:03:23+00:00

I have a XML String retrieved from a XML file. I can’t access the

  • 0

I have a XML String retrieved from a XML file. I can’t access the file directly using simplexml_load_file(). Reason is I have to get this through Amazon S3 getObject(). When I echo the string I can see the out put as a real XML file. But when I try to load it to a XML object using bellow code it doesn’t work. The variable $s3Data exactly contain the XML content in the given link.

$xml = simplexml_load_string($s3Data);

I need your help to figure this out. The XML string I am getting is available here.

http://mediatheques-aphp.bibliomedias.net/12.xml

EDIT

I created the XML string and tested. Now I get following errors. How can I fix these.

Warning: simplexml_load_string() [function.simplexml-load-string]:
Entity: line 12: parser error : Input is not proper UTF-8, indicate
encoding ! Bytes: 0xEF 0x76 0x65 0x3C in C:\Program
Files\Zend\Apache2\htdocs\voxmedia\application\modules\import\controllers\NaiveController.php
on line 1458

Warning: simplexml_load_string() [function.simplexml-load-string]:
2009 naïve in C:\Program
Files\Zend\Apache2\htdocs\voxmedia\application\modules\import\controllers\NaiveController.php
on line 1458

Warning: simplexml_load_string() [function.simplexml-load-string]: ^
in C:\Program
Files\Zend\Apache2\htdocs\voxmedia\application\modules\import\controllers\NaiveController.php
on line 1458

OK Now I feel the issue is with sort of string encoding or something. Is there any way to fix this?

Thanks.

  • 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-05-30T02:03:24+00:00Added an answer on May 30, 2026 at 2:03 am

    I could find an answer to my question with a small workaround. simplexml_load_string() continuously displayed encoding errors. So I used simplexml_load_file() as bellow. I’ve saved the file in to local location and then load with simplexml_load_file().

    $tempLocalPath = "temp/data.xml";
    file_put_contents($tempLocalPath, $s3Data);
    $xml = simplexml_load_file($tempLocalPath);
    

    However still I don’t understan why simplexml_load_string() couldn’t parse the same thing.

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

Sidebar

Related Questions

I have an object that can build itself from an XML string, and write
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)
I have two resources file in res/values directory: string.xml and names.xml how can I
I have a xml string: <Test> Result : this is the result</Test> How do
I have to replace the content of this xml string through java <My:tag>value_1 22&#xA;value_2
Suppose I have this XML as a string: <calles> <calle> <nombre>CALLAO AV.</nombre> <altura>1500</altura> <longitud>-58.3918617027</longitud>
I have generated a XML file automatically from the below code. if (isset($_POST[song])&& $_POST['song']
I have retrieved some XML from an API (at least I think so, the
I have Button and its text, I retrive it from string.xml i.e. I have
I'm trying to retrieve N number of items from an XML file using simpleXML

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.