• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 423
  • Last Modified:

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?
0
Lennart Ericson
Asked:
Lennart Ericson
  • 2
  • 2
1 Solution
 
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
 
andrewssd3Commented:
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now