xls 文件中有语法错误?
不知道源代码中的错误在哪里,excel将所有内容打印成1行?
<?xml version="1.0" encoding="utf-8"?\>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><Styles>
</Styles>
<Worksheet ss:Name="Export">
<Table>
<ROW>
<CELL><Data ss:Type="String">id</Data></CELL><CELL><Data ss:Type="String">barcode</Data></CELL><CELL><Data ss:Type="String">name</Data></CELL><CELL><Data ss:Type="String">price</Data></CELL><CELL><Data ss:Type="String">currency</Data></CELL><CELL><Data ss:Type="String">store</Data></CELL><CELL><Data ss:Type="String">timestamp</Data></CELL><CELL><Data ss:Type="String">longitude</Data></CELL><CELL><Data ss:Type="String">latitude</Data></CELL><CELL><Data ss:Type="String">deal</Data></CELL><CELL><Data ss:Type="String">type</Data></CELL><CELL><Data ss:Type="String">devicename</Data></CELL>
</ROW>
<ROW>
<CELL><Data ss:Type="String">1</Data></CELL>
<CELL><Data ss:Type="String">9783827328168</Data></CELL>
<CELL><Data ss:Type="String">123</Data></CELL>
<CELL><Data ss:Type="String">345</Data></CELL>
<CELL><Data ss:Type="String">EUR</Data></CELL>
<CELL><Data ss:Type="String">Lidl</Data></CELL>
<CELL><Data ss:Type="String">1315573726</Data></CELL>
<CELL><Data ss:Type="String">8.666193</Data></CELL>
<CELL><Data ss:Type="String">49.552096</Data></CELL>
<CELL><Data ss:Type="String">dealyes</Data></CELL>
<CELL><Data ss:Type="String">typebrutto</Data></CELL>
<CELL><Data ss:Type="String">m.münzner</Data></CELL>
</ROW>
</Table></Worksheet></Workbook>
dont know where the error is in the sourcecode, excel print all the content into 1 line?
<?xml version="1.0" encoding="utf-8"?\>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><Styles>
</Styles>
<Worksheet ss:Name="Export">
<Table>
<ROW>
<CELL><Data ss:Type="String">id</Data></CELL><CELL><Data ss:Type="String">barcode</Data></CELL><CELL><Data ss:Type="String">name</Data></CELL><CELL><Data ss:Type="String">price</Data></CELL><CELL><Data ss:Type="String">currency</Data></CELL><CELL><Data ss:Type="String">store</Data></CELL><CELL><Data ss:Type="String">timestamp</Data></CELL><CELL><Data ss:Type="String">longitude</Data></CELL><CELL><Data ss:Type="String">latitude</Data></CELL><CELL><Data ss:Type="String">deal</Data></CELL><CELL><Data ss:Type="String">type</Data></CELL><CELL><Data ss:Type="String">devicename</Data></CELL>
</ROW>
<ROW>
<CELL><Data ss:Type="String">1</Data></CELL>
<CELL><Data ss:Type="String">9783827328168</Data></CELL>
<CELL><Data ss:Type="String">123</Data></CELL>
<CELL><Data ss:Type="String">345</Data></CELL>
<CELL><Data ss:Type="String">EUR</Data></CELL>
<CELL><Data ss:Type="String">Lidl</Data></CELL>
<CELL><Data ss:Type="String">1315573726</Data></CELL>
<CELL><Data ss:Type="String">8.666193</Data></CELL>
<CELL><Data ss:Type="String">49.552096</Data></CELL>
<CELL><Data ss:Type="String">dealyes</Data></CELL>
<CELL><Data ss:Type="String">typebrutto</Data></CELL>
<CELL><Data ss:Type="String">m.münzner</Data></CELL>
</ROW>
</Table></Worksheet></Workbook>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XML 区分大小写。将“单元格”和“行”替换为“单元格”和“行”。有了这个和 Pekka 建议的修复,你的文件加载到 Excel 中对我来说很好。
XML is case-sensitive. Replace "CELL" and "ROW" with "Cell" and "Row". With that and the fix suggested by Pekka, your file loads into Excel fine for me.