Php Xml Parsing Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions simplexmlelement error handling you might have Meta Discuss the workings and policies of
Simplexml_load_string Error Handling
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring xml error message developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Xml Error Message Example
a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up XML parsing error in php up vote 0 down vote favorite When I use the below code and parse the xml locally it works fine but when upload the same script at xml error codes the server it shows error. the code is Note: I retrieved the $lng and $lat from the query string and it works fine locally. $lng=$_GET['lng']; $lat=$_GET['lat']; $conn=new LoginSystem(); $conn->connect(); $dom = new DOMDocument("1.0"); $query="select catch_id,catch_details,image from mycatch where longitude='$lng' AND latitude='$lat'"; $result = mysql_query($query); if (!$result) { die("Invalid query: " . mysql_error()); } header("Content-type: text/xml"); // Iterate through the rows, adding XML nodes for each while ($row = @mysql_fetch_assoc($result)) { $node = $dom->createElement("mycatch"); $node = $dom->appendChild($node); foreach ($row as $fieldname => $fieldvalue) { $child = $dom->createElement($fieldname); $child = $node->appendChild($child); $value = $dom->createTextNode($fieldvalue); $value = $child->appendChild($value); } } $conn->disconnect(); $xml_string = $dom->saveXML(); echo $xml_string; On the server I get this error. And the document is also empty..... This page contains the following errors: error on line 2 at column 1: Extra content at the end of the document Below is a rendering of the page up to the first error. php xml domdocument share|improve this question edited Fe
1, Column 1: ^ When I run it on my own server, it runs
Simplexml_load_file Error Handling
fine. But I'm putting the script on my clients web
Error Loading Xml Mlb Tv
host, (hostway), and this is the message that comes up.. Here's what the calendar.php file libxml_use_internal_errors looks like: http://stackoverflow.com/questions/4544369/xml-parsing-error-in-php must-revalidate" ); header("Pragma: no-cache" ); header("Content-Type: text/xml; charset=utf-8"); ////////////////////////////////////// // set these variables for your MySQL $dbhost = 'dbhost'; // usually localhost $dbuser = 'user'; // database username $dbpass = 'password'; // database password $database = 'databaseName'; // database ////////////////////////////////////// $db = @mysqli_connect($dbhost, $dbuser, $dbpass, $database) or die (" index All times are UTC - 5 hours Information The requested topic does not exist. Board index All times are UTC - 5 hours Powered by phpBB Forum Software © phpBB Group / Science/Technology / Webmasters / Xml Parsing Error: No Element Found Location (2025 Views) Joomla 3.4 Installation Error "No File Selected:unable To Find Install Package" / Free Xmlprov Xml Prov Creator Maker And Generator / Create Ajax Chat & Learn Web Page Data Xchange via Json Vs Xml (1) (2) (3) (4) (0) (Reply) Xml Parsing Error: No Element Found Location by Nobody: 10:49pm On Sep 21, 2010 please help me with this code it work locally but when uploaded i get errorthis is the site xtranok.awardspace.co.uk/guestbook-1.0.9/index.phpRe: Xml Parsing Error: No Element Found Location by ogzille(m): 11:43pm On Sep 21, 2010 Check your php page that echoes your xml, there could be another output (output could be text, html tags, error notice or php echo/print) apart from your xmlRe: Xml Parsing Error: No Element Found Location by dhtml18(m): 6:49am On Sep 22, 2010 The area generating your xml is where your problem lies. since you did not post that source code, there is very little i can do.(0) (Reply) My Nigerian Webhost Review / Any Webmaster That Knows Forum Development : / Can One Make Money From Running An Online Forum(e.g. Nairaland.com) Viewing this topic: 1 guest(s)(Go Up) Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) Nairaland - Copyright © 2005 - 2016 Oluwaseun Osewa. All rights reserved. See How To Advertise. 24Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.