Re: Format in XML export from Excel 2010
Well, to explain a little better and how to recreate this error.. i thought I'd give it a second go.
When exporting a XML table from Excel, if a cell is formated as a number.. the export will not choose the default settings from regional settings in control panel. All numbers with decimals are exported with a period for the decimal separator instead of a comma like we use here in Iceland and many countries.
So to recreate this problem here it is:
In notepad, create and save as .xml a simple XML document. Here is my example:
PHP:
<?xml version="1.0" encoding="iso-8859-1"?>
<ITEMS>
<Product>
<Product_id>007</Product_id>
<Name>Apple</Name>
<Price>107,56</Price>
</Product>
</ITEMS>
Now choose import under development in a blank workbook and import the xml document and then format the 107,56 to a number then activate the cell and press enter. Now the number is a number, not text.
When this table is exported, it will show the following:
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</items>
PHP:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ITEMS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Product>
<Product_id>7</Product_id>
<Name>Apple</Name>
<Price>107.56</Price>
</Product>
</ITEMS>
As we see, now the price has a period instead of a comma seperationg the decimals... this is not importable by my sql database.
Does anyone have an answer on how to choose the decimal seperator in XML export?