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 Imported this file:
XMLdata = Import["test.xml", "IncludeNamespaces" -> True]
Now I am Exporting 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?
Importline. I can import it as text and then importing that usingImportString. – Sjoerd C. de Vries Jul 03 '12 at 19:57ref/format/XML? there is an option"IncludeNamespaces"for import and"NamespacePrefixes"for export which I would expect to probably help, although I haven't tried it with your example. – Albert Retey Jul 04 '12 at 13:17"NamespacePrefixes"is some way can solve the problem but my current knowledge is insufficient. From the other side, I really do not understand why doesExportdrop namespace prefixes? I see no reasons since these prefixes are present in XMLData after importing the file. – Alexey Popkov Jul 04 '12 at 15:33