I have spent quite a bit of time trying to find an answer to this but nothing so far. Hopefully someone here can point me in the right direction.
I'm trying to load an XML file into a php DOMDocument object and getting an error even though my xml file appears to be in the expected file location and be valid XML.
I'm getting the error
Warning: DOMDocument::loadXML() [<a href='domdocument.loadxml'>domdocument.loadxml</a>]: Start tag expected, '<' not found in Entity, line: 1 in C:\wamp\www\BmTest01.php on line 3
As seen below Line 3 contains the loadXML() function.
Here is my code.
$doc = new DOMDocument();
I will post my XML file below but first I want to say that the XML file BmTest01.xml is in the wamp root (www) directory as is the php file above. In an attempt to debug, I altered the code to confirm the file exists and I also read the file using readfile(). When viewing the resulting source output from readfile() everything seems to be in order, most notably the opening < as the forst character in the document. I also ran my XML through a validator and my XML showed no errors.
Here is the XML file
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="styles/BmSQL.xsl"?>
<description>Play With SQL - Query Tips and Tricks</description>
<tooltip>Tool Tip for Play With SQL</tooltip>
<tooltip>This is the official home page for MySQL</tooltip>
<description>W3Schools XML Tutorial</description>
<tooltip>Almost forgot this tool tip</tooltip>
<tooltip>Unofficial but popular MySQL tutorial website</tooltip>
I figured this must be a common problem but I have not been able to find anyting about it anywhere. Any thoughts would be greatly appreciated.
I am running
PHP Version :5.3.13
Windows 7 Home Premium (Ver 6.1 Build 7601 Service Pack 1)
I get the same error on