How to debug an xml script used for Excel

I'm trying to make an Excel sheet with input from a database using php. When executing the xml (XML sheet 2003) file using Excel I get an error message like

XML-ERROR In Table
REASON:      Erroneous value  
(This a translation from Swedish, could be erroneous, inaccurate, wrong, incorrect in Engliish. I don't have the English version an hand)
FILE:      C:\Users\Lennart\Downloads\Matrikel 2011-10-12.xls
GROUP:      Table
HTML-CODE:      Row
ATTRIB:      Index
VALUE:      150

XML-ERROR In Table
REASON:      Erroneous value
FILE:      C:\Users\Lennart\Downloads\Matrikel 2011-10-12.xls
GROUP:      Table
HTML-CODE:      Row
ATTRIB:      Index
VALUE:      155

XML-ERROR In Table
REASON:      Erroneous value
FILE:      C:\Users\Lennart\Downloads\Matrikel 2011-10-12.xls
GROUP:      Table
HTML-CODE:      Row
ATTRIB:      Index
VALUE:      157

XML-ERROR In Table
REASON:      Erroneous value
FILE:      C:\Users\Lennart\Downloads\Matrikel 2011-10-12.xls
GROUP:      Table
HTML-CODE:      Row
ATTRIB:      Index
VALUE:      159

Is there a method to debug the code? Any advice how I could find out what is wrong?
Lennart EricsonAmateurAsked:
Who is Participating?
 
andrewssd3Connect With a Mentor Commented:
Hi
The problem is with the xml highlighted in this screenshot: xml file screenshot.  I'm not an expert on Excel 2003 xml format files, but if I manually edit this and remove the ss:index="150" attribute altogether (as well as the 155, 157 and 159 attributes in the following <row> elements), it will open happily in Excel.

I'm also not an expert at php, but it looks like the template for this xml is at line 219 of your php file - so I think just removing the ss:index attributes here will sort out your problem.

Stuart
0
 
andrewssd3Commented:
If this is output from Excel, I think it's from a user macro. If you could post the Excel file and the input xml it would be easier to help.
0
 
Lennart EricsonAmateurAuthor Commented:
andrewssd3,

I enclose two scripts:
1 - the php script used to get the records from the database and populating the xml file. (There is an error somewhere in this file, thus I can't produce an Excel sheet. )
2 - the xml file created by the php script.

I want to know if there is a method to help finding the error in the php file.
   2.xml
1.php
0
 
Lennart EricsonAmateurAuthor Commented:
Stuart,

Right you are, it happily opened in Excel. Thank you so much for your help.

Well done, my friend.

Lennart
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.