Bug 118772 - FILTERXML function's behavior having xmlns document element is different from Excel 2016
Summary: FILTERXML function's behavior having xmlns document element is different from...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: interoperability
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-15 12:46 UTC by Tomofumi Yagi
Modified: 2018-08-24 17:25 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ods (19.79 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-07-15 13:06 UTC, Tomofumi Yagi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomofumi Yagi 2018-07-15 12:46:51 UTC
Description:
FILTERXML function can't get a value from some XML Responses(ex. XML Responses from mojikiban API).


Steps to Reproduce:
1. Paste '=WEBSERVICE("https://mojikiban.ipa.go.jp/mji/MJ010057.xml")' to cell A1 and press Enter
2. Paste '=FILTERXML(A1,"//MJ文字情報一覧表/MJ文字情報/MJ文字図形名")' to cell A2 and press Enter




Actual Results:
Cell A2 is "#N/A"

Expected Results:
Cell A2 is "MJ010057" 
That works well on Excel 2016.



Reproducible: Always


User Profile Reset: No



Additional Info:
LibreOffice version
バージョン: 6.2.0.0.alpha0+ (x64)
Build ID: 4b7ce45c2384fdd65c17ab18036899cd76577254
CPU threads: 8; OS:Windows 10.0; UI render: default; 
ロケール: ja-JP (ja_JP); Calc: group threaded

バージョン: 6.0.4.5
Build ID: 6840e4519a6ce8bcc1328eb2d87b5c46c6df1038
CPU threads: 4; OS:Mac OS X 10.13.5; UI render: default; 
ロケール: ja-JP (ja_JP.UTF-8); Calc: group

The information about mojikiban API(MJ文字図形取得API / MJ文字情報取得API) is follows.
https://mojikiban.ipa.go.jp/search/help/api
Comment 1 Tomofumi Yagi 2018-07-15 13:06:02 UTC
Created attachment 143560 [details]
Sample ods
Comment 2 himajin100000 2018-07-15 14:33:22 UTC
Hi, Mr.Yagi.

Have you taken the XML's "default namespace" into account?

https://superuser.com/questions/1048743/how-does-one-use-libreoffice-filterxml-function-on-xml-documents-with-namespaces

IMHO, I don't like Excel's ignorance of default namespace.
Comment 3 Tomofumi Yagi 2018-07-16 08:24:02 UTC
(In reply to himajin100000 from comment #2)
> Hi, Mr.Yagi.
> 
> Have you taken the XML's "default namespace" into account?
> 
> https://superuser.com/questions/1048743/how-does-one-use-libreoffice-
> filterxml-function-on-xml-documents-with-namespaces
> 
> IMHO, I don't like Excel's ignorance of default namespace.

Hi himajin100000,
Thanks for your advice.

I have correct the expression(such as the following),then FILTERXML function worked well on LibreOffice and Excel 2016 both.

=FILTERXML(A1,"//*[name()='MJ文字情報一覧表']/*[name()='MJ文字情報']/*[name()='MJ文字図形名']")

=FILTERXML(A1,"//*[name()='MJ文字図形名' and namespace-uri()='urn:mojikiban:ipa:go:jp:mji']")

Umm, I think Excel 2016 can accept some fuzzy or incorrect expressions, but kindly a bit in this case.
After all, FILTERXML function on LibreOffice is right.
Comment 4 Buovjaga 2018-08-24 17:25:24 UTC
Closing as notabug per last comments. I checked with Eike first.