SOLVED: DOMDocument->load() Opening and ending tag mismat
Posted: Fri Jul 13, 2007 10:05 am
I'm getting what appears to me to be some really strange errors. I'm trying to load an XML document from http://banners.willhill.com/xml/viewxml ... B&style=12.
I don't understand the references to p, font, td and tr tags in the error messages, this is an XML file - there are no html tags and I'm sure that the XML file is well formed.
When I run the script on the same file locally it works fine.
Here's the error messages
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 70 and font in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 71 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 68 and td in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 95 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 67 and tr in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 96 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Entity 'nbsp' not defined in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 98 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: attributes construct error in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Couldn't find end of Start Tag input line 104 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Entity 'nbsp' not defined in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: font line 63 and table in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 106 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: td line 61 and div in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 107 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: tr line 60 and body in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 110 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: table line 55 and html in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 111 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag div line 54 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag body line 8 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag html line 3 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
line 12 is
I get the errors with and without
Any help would be much appreciated.
I don't understand the references to p, font, td and tr tags in the error messages, this is an XML file - there are no html tags and I'm sure that the XML file is well formed.
When I run the script on the same file locally it works fine.
Code: Select all
$dom = new DomDocument;
$dom->preserveWhiteSpace = FALSE;
$dom->load("http://banners.willhill.com/xml/viewxml.asp?sport=FB&style=12");PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 70 and font in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 71 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 68 and td in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 95 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: p line 67 and tr in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 96 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Entity 'nbsp' not defined in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 98 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: attributes construct error in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Couldn't find end of Start Tag input line 104 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Entity 'nbsp' not defined in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 104 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: font line 63 and table in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 106 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: td line 61 and div in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 107 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: tr line 60 and body in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 110 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Opening and ending tag mismatch: table line 55 and html in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 111 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag div line 54 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag body line 8 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
PHP Warning: DOMDocument::load() [<a href='function.DOMDocument-load'>function.DOMDocument-load</a>]: Premature end of data in tag html line 3 in http://banners.willhill.com/xml/viewxml ... B&style=12, line: 112 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xml-testing\\parseWillhillXML.php on line 12
line 12 is
Code: Select all
$dom->load("http://banners.willhill.com/xml/viewxml.asp?sport=FB&style=12");I get the errors with and without
Code: Select all
$dom->preserveWhiteSpace = FALSE;Any help would be much appreciated.