File Format and Extension Mismatch during XML Import with XSLT Stylesheet

Diskutiere File Format and Extension Mismatch during XML Import with XSLT Stylesheet im Office Forum im Bereich Microsoft Community Fragen; Dear All, I am importing the following XML into Microsoft Excel: <?xml version="1.0" encoding="utf-8"?> <?mso-application...
M

MSCom

Neuer Benutzer
Threadstarter
Dabei seit
20.09.2016
Beiträge
1
Dear All,


I am importing the following XML into Microsoft Excel:


<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<?xml-stylesheet type="text/xsl" href="test1.xsl"?>
<someData>
<r><c>a</c><c>b</c><c></c><c>c</c></r>
<r><c>A</c><c/><c>B</c><c>C</c></r>
</someData>

The stylesheet "test1.xsl" referenced therein transforms it into an XMLSS (i.e. Excel 2003 XML) workbook:


<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" omit-xml-declaration="no"/>
<xsl:template match="/">
<xsl:processing-instruction name="mso-application">progid=&quot;Excel.Sheet&quot;</xsl:processing-instruction>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Worksheet ss:Name="Sheet1">
<Table>
<xsl:for-each select="someData/r">
<Row>
<xsl:for-each select="*">
<Cell><Data ss:Type="String">
<xsl:value-of select="." />
</Data></Cell>
</xsl:for-each>
</Row>
</xsl:for-each>
</Table>
</Worksheet>
</Workbook>
</xsl:template>
</xsl:stylesheet>

Resulting in the following, transformed XML (verified using MS Visual Studio):


<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:o="urn:schemas-microsoft-com:office:office">
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<Cell>
<Data ss:Type="String">a</Data>
</Cell>
<Cell>
<Data ss:Type="String">b</Data>
</Cell>
<Cell>
<Data ss:Type="String"/>
</Cell>
<Cell>
<Data ss:Type="String">c</Data>
</Cell>
</Row>
<Row>
<Cell>
<Data ss:Type="String">A</Data>
</Cell>
<Cell>
<Data ss:Type="String"/>
</Cell>
<Cell>
<Data ss:Type="String">B</Data>
</Cell>
<Cell>
<Data ss:Type="String">C</Data>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>

When I import the original XML into Excel I am prompted to choose the stylesheet to use for the import. There I choose the "test1.xsl" entry.

Then I get the warning that "File Format and Extension of 'test1' do not match" and am prompted to choose whether to open it none the less.

If I choose to do so then the workbook is opened in protected view.


When, on the other hand, I do the XSLT transformation in Visual Studio and save the resulting XML as a separate file, I can open this file afterwards in Excel without receiving any warnings about file format and extension mismatches and it is displayed by Excel in the full function view.


I have verified this unexpected behaviour of Excel, i.e. the warning and the opening in protected view, in 32bit versions 2013, 2016 and 2019. In Excel 2019 I experience the additional, annoying issue that I cannot even unprotect the resulting workbook because when trying to do so Excel issues the following error: "We could not find 'B8D8CAE2.tmp'. Has the object been moved, renamed or deleted?" (the displayed file name varies from attempt to attempt but the extension ".tmp" remains).


Do you have any suggestions as to how to improve the stylesheet or to configure Excel so that the hoax file format extension mismatch warning does not appear any more and thus the resulting workbook is opened in full function view by Excel?


Many thanks in advance for your help and suggestion!

Alf
 
Thema:

File Format and Extension Mismatch during XML Import with XSLT Stylesheet

File Format and Extension Mismatch during XML Import with XSLT Stylesheet - Ähnliche Themen

Using Vlookup on other Workbook whichs path is stored in a Cell: Good Day Im Trying to do Vlookup on a closed Workbook whichs path is stored in a Cell. For that im writing a Function which opens the Workbook...
Strange Excel behavior in some IF functions: Yesterday I was notified about the false calculation results in one of our interface files. After some research I came to the conclusion that the...
Problem with data import: I wanted to import data within the actual Office365 Excel version. When I changed separator to space most of my data just disappeared. When I use...
Excel Bug: tables with Power Query and without header line (or at least very peculiar behaviour): Dear Microsoft Community, I would like to report an Excel bug as follows (Windows 10, Excel build 11601.20204 click-and-go, Version 1904 -...
Movie Maker: Hello, Unfortunately, I do have a problem with a Microsoft movie maker file. I know Microsoft doesn’t support the program anymore but I‘ve used...

Sucheingaben

planet 7 casino mobile

,

poker deluxe vip

,

po1ker deluxe vip

,
rivers casino pittsburgh
, rivers cas5ino pittsburgh, how do casinos make money on poker, tradition casino, tradition ca8sino, river *poker, top online cabsinos, poker flush, mpoker flush, casinos in palm springs, cascinos in palm springs, betfair cas$ino, p.oker odds, poker odds, free online strip poker, free online strip poPker, free casino games no download, free casfino games no download, poker texas holdem rules, porker texas holdem rules, chinook winds casino, chinook winds clasino
Oben