Xmlparseentityref: No Name' Warnings While Loading Xml into a PHP File

Warning: simplexml_load_file():parser error : xmlParseEntityRef: no name in

It means some illegal characters exist into your xml file. search for symbols like as "$" "&" or so on in your xml file.

Error on strings that contains & in XML. How can I fix this?

You are not getting an error from the MySQL Server. Your error comes from simplexml_load_file() because the source XML file you are reading contains errors. In particular, a literal & must be encoded as &.

XML Load File Error

It's telling you the XML is invalid, probably because it contains an "&" character that should have been escaped as &.

Do what you would do with any faulty goods - send it back to the supplier and tell them to fix it.

simplexml_load_file problems while browsing securely

I figured out my own problem, but thank you to those of you who tried helping me. I appreciate it.

My solution:

This was being run in WordPress, so I really should have posted this in the WPSE site, but I don't blame anyone for not knowing all about WP from this site if they didn't.

The function plugins_url() should not have been used to define the path to the XML file, I should have been using dirname(__FILE__).'/settings.xml' - which is pretty obvious as to why if you know how plugins_url() works, I overlooked it completely but in the end solved my problem.

Two errors when using PHP XMLreader

xmlParseEntityRef: no name 

Means you've got bogus unescaped ampersands in the XML file. (Well, “XML”... technically if it ain't well-formed, it ain't XML.)

You'll need to check the file for lone &s (or fix the code that generated it) to escape them to &. According to the error, the first one's on line 43102 of the file (yikes!).



Related Topics



Leave a reply



Submit