I am trying to generate an Excel-compatible XML file from Mathematica. First, I created a test XML file by saving a Microsoft Excel workbook
as "XML Table". Then I Import
ed this file:
XMLdata = Import["test.xml", "IncludeNamespaces" -> True]
Now I am Export
ing this back to XML:
Export["test_exported.xml", XMLdata, "AttributeQuoting" -> "\""]
The generated file cannot be opened by Excel. Comparing it with the
original file shows that most of namespace prefixes are dropped although
they were present in XMLdata
. Why does this happen? How can I correctly Export
an XML file which will be compatible with Excel?
Import
line. I can import it as text and then importing that usingImportString
. $\endgroup$