Bug 122206 - FILEOPEN: Opening XML file with XSLT filter opens with plain text import dialogue
Summary: FILEOPEN: Opening XML file with XSLT filter opens with plain text import dial...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.1.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-12-19 21:44 UTC by Steve Edmonds
Modified: 2021-05-16 04:19 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Test data XML file for import (4.77 KB, application/xml)
2018-12-19 21:47 UTC, Steve Edmonds
Details
XSLT filter for import of XML test file. (9.39 KB, text/plain)
2018-12-19 21:49 UTC, Steve Edmonds
Details
Step by Step procedure (219.24 KB, application/pdf)
2021-05-01 18:30 UTC, Steve Edmonds
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Edmonds 2018-12-19 21:44:28 UTC
Description:
Opening a XML file with File>Open and select my filter and then the XML file I get the text import dialogue and not a correct import.
A XML file will open correctly with Tools>XML Filter Settings, select filter and click "Test XSLTs..." 
Problem occurs on Calc 6.1.3.2 and not on Calc 6.0.5.2.

Steps to Reproduce:
1. Install XSLT XML filter
2. Go File>Open
3. Select XML filter above
4. Select XML file

Actual Results:
File opens in Calc

Expected Results:
Text import dialogue opens


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.1.3.2
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 4.12; UI render: default; VCL: gtk3_kde5; 
Locale: en-NZ (en_GB.UTF-8); Calc: group threaded
Comment 1 Steve Edmonds 2018-12-19 21:47:03 UTC
Created attachment 147682 [details]
Test data XML file for import

File to import
Comment 2 Steve Edmonds 2018-12-19 21:49:45 UTC
Created attachment 147683 [details]
XSLT filter for import of XML test file.

Import filter to install for importing test XML file
Comment 3 Oliver Brinzing 2018-12-21 14:51:43 UTC
i can not confirm with

Version: 6.1.4.2 (x64)
Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: 

spreadsheet with caption and 3 data opens fine

Linux only?
Comment 4 Steve Edmonds 2018-12-22 01:37:40 UTC
Just noticed I have Actual and expected results back to front.
Should be;
Actual Results:
Text import dialogue opens

Expected Results:
File opens in Calc
Comment 5 raal 2018-12-26 07:55:05 UTC
I can not confirm with Version: 6.3.0.0.alpha0+
Build ID: 1b7bcaa714f0af45c6a9660d1f0940cb7931ba0f
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
File opens without any dialog.
Comment 6 Xisco Faulí 2019-02-07 20:38:04 UTC Comment hidden (obsolete)
Comment 7 Steve Edmonds 2019-02-12 08:01:23 UTC Comment hidden (obsolete)
Comment 8 Xisco Faulí 2019-02-12 09:59:09 UTC Comment hidden (obsolete)
Comment 9 Steve Edmonds 2019-02-12 18:47:39 UTC
Just tested with
Version: 6.1.5.2
Build ID: 10(Build:2) from  
https://download.opensuse.org/repositories/LibreOffice:/6.1/openSUSE_Leap_15.0/

and the problem persists so I am assuming this to be an OpenSUSE build issue.
Comment 10 Jean-Christophe Helary 2020-02-21 04:44:12 UTC
I confirm this is reproduced on my macos 10.15.3 / LO 6.3.1.2.

The file opens in the foremost opened application: either Calc, as text, where it triggers the text format import dialog, or Writer, in which it just opens in plain text.

I had exactly the same issue on a different file set and when faced with this problem I asked the user list where Steve told me it looked like his bug.
Comment 11 Alex Thurgood 2020-02-21 08:25:32 UTC
I can confirm this with 

Version: 6.4.0.0.alpha0+
Build ID: f0c832acb53326ccc9a8c1a47401fbc9e1081feb
CPU threads: 8; OS: Mac OS X 10.15.3; UI render: GL; VCL: osx; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2019-09-11_05:45:47
Locale: fr-FR (fr_FR.UTF-8); UI-Language: en-US
Calc: threaded


Testing the XSLT against the XML file succeeds and displays the data in a Calc sheet, correctly separated into columns with the corresponding column headers.

However, dragging and dropping the XML file onto a Calc sheet, or dragging and dropping the XML file onto the StartCenter window of a running LO instance, opens the XML file as text, either in Calc via the text import wizard, which shows all of the XML, or else in Writer displaying the XML as text.
Comment 12 Alex Thurgood 2020-02-21 08:26:57 UTC
Just a bit of wild guessing here, but could this by any chance have anything to do with the addition of the new XML import feature for Calc ? Might that code be overriding the call to the XSLT filter ?
Comment 13 Steve Edmonds 2020-02-22 08:12:47 UTC
The new XML Source import seems to be an experimental feature in LO 6.3. I have tried with it enabled and with it disabled and I can no longer reproduce the bug on

Version: 6.3.5.2
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 4.12; UI render: default; VCL: kde5; 
Locale: en-NZ (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 14 Buovjaga 2020-06-08 18:31:49 UTC Comment hidden (obsolete)
Comment 15 Steve Edmonds 2020-06-09 19:44:12 UTC
I am now getting this bug again in 6.4.4.2
Comment 16 Buovjaga 2020-06-09 19:49:42 UTC
(In reply to Buovjaga from comment #14)
> I created the XSLT filter based on these instructions:
> https://help.libreoffice.org/latest/en-US/text/shared/guide/
> xsltfilter_create.html
> 
> When I open the xml file, it opens in Calc as empty and I see this in the
> terminal:
> compilation error: file
> file:///home/user/libobugs/vboxshare/CustomerXMLimportSerenade.xslt line 2
> element stylesheet
> xsl:version is missing: document may not be a stylesheet
> 
> Please advise.

Steve: please help me.
Comment 17 Steve Edmonds 2020-06-10 01:38:17 UTC
Try going Tools>Macros>XML filter settings.
Select your filter and click Test XSLT and browse your XML file.
This still works even with this bug.
Comment 18 Buovjaga 2020-06-10 06:08:21 UTC Comment hidden (obsolete)
Comment 19 Buovjaga 2020-06-10 06:11:00 UTC
(In reply to Buovjaga from comment #14)
> When I open the xml file, it opens in Calc as empty and I see this in the
> terminal:
> compilation error: file
> file:///home/user/libobugs/vboxshare/CustomerXMLimportSerenade.xslt line 2
> element stylesheet
> xsl:version is missing: document may not be a stylesheet

To be clear, I was asking Steve for help in getting rid of this compilation error in the XSLT file he supplied. Or confirm that this error is irrelevant. Errors are usually fatal, though, as opposed to warnings, so I assumed the whole process failed and thus nothing appeared.
Comment 20 Jean-Christophe Helary 2020-06-14 02:40:27 UTC
(In reply to Buovjaga from comment #18)
> (In reply to Alex Thurgood from comment #11)
> > However, dragging and dropping the XML file onto a Calc sheet, or dragging
> > and dropping the XML file onto the StartCenter window of a running LO
> > instance, opens the XML file as text, either in Calc via the text import
> > wizard, which shows all of the XML, or else in Writer displaying the XML as
> > text.
> 
> From what I understand, this is not the way to reproduce this bug and should
> not be taken as confirmation. The file needs to be opened per the steps in
> the description, not by dragging and dropping or any way that does not
> involve selecting the custom-created XML filter.
> 
> Would be good to hear from Jean-Christophe to confirm that he was indeed
> using the procedure Steve describes in his original message.

I confirm that I was using the procedure described in the original message. I was not using drag and drop.
Comment 21 Timur 2021-04-30 12:47:37 UTC
(In reply to Steve Edmonds from comment #0)
> Description:
> Opening a XML file with File>Open and select my filter and then the XML file
> I get the text import dialogue and not a correct import.
> A XML file will open correctly with Tools>XML Filter Settings, select filter
> and click "Test XSLTs..." 
> Problem occurs on Calc 6.1.3.2 and not on Calc 6.0.5.2.
> 
> Steps to Reproduce:
> 1. "Install XSLT XML filter" 
"Tools>Macros>XML filter settings." - in Calc
"Select your filter" - which one?
"and click Test XSLT and browse your XML file." - I guess Import?
> 2. "Go File>Open" - in Calc?
> 3. "Select XML filter above" - where do you select it exactly?
> 4. Select XML file
>   
> Actual Results:   Text import dialogue opens
> Expected Results: File opens in Calc

Please be precise for those who don't use it, do not assume obvious.
Comment 22 Steve Edmonds 2021-04-30 20:49:22 UTC
Just checked with 7.1.2.2 and the bug no longer presents.
Comment 23 Jean-Christophe Helary 2021-05-01 00:58:03 UTC
Steven, can you give item by item directions for installing the filter and opening the file because it looks like the procedure I'm following (seemingly the one you describe in your first comment) does not show improvement.
Comment 24 Jean-Christophe Helary 2021-05-01 01:11:47 UTC
In fact, when I "Test XSLT" on the test file I get a "General Error General input/output error"...
Comment 25 Steve Edmonds 2021-05-01 18:30:19 UTC
Created attachment 171574 [details]
Step by Step procedure

Screen shots of procedure
Comment 26 Timur 2021-05-06 08:39:50 UTC
Steve, thanks for instructions. 
I could follow but I couldn't repro "Text import dialogue" in latest Lo 6.1 nor in master 7.2+.
That itself wouldn't be enough, but with Comment 22 I set WFM.
Comment 27 Alex Thurgood 2021-05-06 10:34:34 UTC
No repro for me either with :

Version: 7.1.2.2 / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

Using File > Open and selecting the specific filter in the Options dialog of Finder, the file gets loaded into Calc and displayed as values in cells.

What still doesn't work is dragging and dropping the xml file onto a running instance of LO (Dock icon).