Page 1 of 1

XML Export Error

PostPosted: Wed Sep 07, 2011 2:42 am
by fauners
Hi All

i have searched the forums looking to see if this is happening to anyone else but haven't had any look. I'm running the latest version of xataface on xampp on windows 7 pro. It's also the latest version of xampp with Apache 2.2.17, MySQL 5.5.8 and PHP 5.3.5.

when i press the XML export button on any of my tables i get the following error appear on screen:

XML Parsing Error: XML or text declaration not at start of entity
Location: http://localhost/cashman/CMS/index.php? ... -mode=list
Line Number 3, Column 1:
<?xml version="1.0"?>
^

Anyone have any idea why this is happening?

Thanks in advance

Adam

Re: XML Export Error

PostPosted: Wed Sep 07, 2011 9:22 am
by shannah
This looks like a browser error. What browser are you using? Firefox, IE, Safari, etc...?
If you check "view source" you should see the XML source and perhaps there will be a clue as to what is corrupted. Can you post the beginning of said source?

-Steve

Re: XML Export Error

PostPosted: Thu Sep 08, 2011 2:55 am
by fauners
Hi Steve

Thanks for the reply. I'm using firefox when the error occurs.
Just tried it on explorer and it works!
Here is the page source from firefox
Code: Select all
<?xml version="1.0"?>
<record><parking_meter_lodgment id="parking_meter_lodgment?Parking_Lodgment_No=2">
   <Parking_Lodgment_No>2</Parking_Lodgment_No>
   <Parking_Meter_ID>1</Parking_Meter_ID>
   <Lodgment_Date>2011-08-08</Lodgment_Date>
   <Lodgment_Total>3445</Lodgment_Total>
   <Expected_Total>234</Expected_Total>

   <Lodgment_Difference>234</Lodgment_Difference>
   <PM_Lodgment_Comment>324</PM_Lodgment_Comment>
</parking_meter_lodgment>
<parking_meter_lodgment id="parking_meter_lodgment?Parking_Lodgment_No=3">
   <Parking_Lodgment_No>3</Parking_Lodgment_No>
   <Parking_Meter_ID>1</Parking_Meter_ID>
   <Lodgment_Date>2011-08-10</Lodgment_Date>

   <Lodgment_Total>687</Lodgment_Total>
   <Expected_Total>678</Expected_Total>
   <Lodgment_Difference>678</Lodgment_Difference>
   <PM_Lodgment_Comment>678</PM_Lodgment_Comment>
</parking_meter_lodgment></record>


it looks ok on IE,it comes up as I would have expected it too, it's just happening on firefox.

I have just tried it on a couple of networked computers and they are also having the same issue on firefox.

The IE fix will get me out of a hole anyway so thanks a lot for that, but if there is a solution to this it would be great.

Thanks

Adam

Re: XML Export Error

PostPosted: Thu Sep 08, 2011 9:30 am
by shannah
Is there any whitespace at the beginning of the XML source? That XML looks valid but the error seems to indicate that there are 2 lines preceding the <?xml declation.

-Steve

Re: XML Export Error

PostPosted: Mon Sep 12, 2011 7:04 am
by fauners
Hi Steve

Sorry for the delay in replying.
Yes you are right, there are 2 blank lines at the start of the source.
the <?xml version="1.0"?> starts on line 3.

Adam

Re: XML Export Error

PostPosted: Mon Sep 12, 2011 10:24 am
by shannah
Likely you have some whitespace either at the beginning or end of one of your delegate classes (or your index.php file). Best practice in PHP files is to omit the closing ?> at the end of your file so you don't accidentally introduce whitespace. If you don't end the PHP tag PHP will just close it at the end of the file like normal.

Also check that all of your beginning open <?php tags are at the very beginning of its file with no blank lines before it.

-Steve