xanatos1992
New Member
I'm trying to output an XLS file in the XML format.This is what the data should look like for Excel 2003 to render (can be saved as an xls file):\[code\]<? xml version='1.0' ?><? mso-application progid='Excel.Sheet' ?><Workbook xmlns='urn:schemas-microsoft-comffice:spreadsheet' xmlns='urn:schemas-microsoft-comfficeffice' xmlns:x='urn:schemas-microsoft-comffice:excel' xmlns:ss='urn:schemas-microsoft-comffice:spreadsheet' xmlns:html='http://www.w3.org/TR/REC-html40'> <Worksheet ss:Name='Connections'> <Table> <Row> <Cell><ssata ss:Type='String' xmlns="http://www.w3.org/TR/REC-html40"><B>Test</B></Data></Cell> <Cell><ssata ss:Type='String' xmlns="http://www.w3.org/TR/REC-html40"><B>Test 2</B></Data></Cell> </Row> <Row> <Cell><ssata ss:Type='String'>Data</Data></Cell> <Cell><ssata ss:Type='String'>More data</Data></Cell> </Row> </Table> </Worksheet></Workbook>\[/code\]What I'm currently getting is this:\[code\]<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-comffice:spreadsheet" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet" xmlns:x="urn:schemas-microsoft-comffice:excel" xmlns:html="http://www.w3.org/TR/REC-html40"> <Worksheet ss:Name="Test"> <Table> <Row> <Cell><ssata xmlns="http://www.w3.org/TR/REC-html40" ss:Type="string"><B>Test</B></ssata></Cell> <Cell><ssata xmlns="http://www.w3.org/TR/REC-html40" ss:Type="string"><B>Test 2</B></ssata></Cell> </Row> <Row> <Cell><ss:data ss:type="string">Data</ssata></Cell> <Cell><ss:data ss:type="string">More data</ssata></Cell> </Row> </Table> </Worksheet></Workbook>\[/code\]Which Excel can't parse. It throws four of these errors in its log file:\[code\]XML ERROR in TableREASON: Bad ValueFILE: test.xlsGROUP: CellTAG: DataATTRIB: TypeVALUE: string\[/code\]I think that the main problem is that the \[code\]<ssata>\[/code\] tags which I'm creating with \[code\]DomDocument::CreateElement('ssata')\[/code\] should be closed with \[code\]</Data>\[/code\], whereas DomDocument is outputting \[code\]</ssata>\[/code\]. I can't use \[code\]CreateElementNS()\[/code\], because there isn't a namespace (I think