Error on XPath node

I use the XML Reader to load this XML document: https://www.uniprot.org/uniprot/P04637.xml

The document is read properly both with and without XPath filter on the XML Reader node.

However, when I attach an XPath node to do more filtering I cannot open the cofiguration of the XPath node. I get the following error message:

The dialog cannot be opened for the following reason:
Could not create XML hierarchy tree: XML-Dokumentstrukturen müssen innerhalb derselben Entity beginnen und enden.

I use KNIME in English but the error message seems to be partly translated to German. The last sentence means: “XML document structure must begin and end within the same Entity”.

The error occurs independant of the configuration of the XML Reader node. I Use KNIME 4.4.1.

Any pointers would be great, I currently use XML To JSON and JSONPath to work around this issue. That works but creates transformation overhead.

1 Like

Can you post your workflow? I can use the XPath node (after the XML reader node) on this xml file with no issues.

1 Like

Hi @mpreusse , this is something that has been raised by a few people. That exact same message, that is in German. I thought their machine were set to German, but from what you are saying for your case, it isn’t. The message itself translate this part to German?

The message “XML document structure must begin and end within the same Entity” (or rather “Could not create XML hierarchy tree:”) was something that was happening when you tried to open a malformed xml in older versions. This is supposed to be fixed in Knime 4.4.1.

I think something else is causing this particular message - the one with the German translation.

Unfortunately, like @elsamuel , I am able to open the xml from the url and open an XPath node configuration after that with no problem, so I’m not able to reproduce this.

That’s my default configuration dialog of my XPath:

3 Likes

Thanks @elsamuel and @bruno29a!

About the language: My system language is German but KNIME runs in English. I never actively selected a language, not sure if KNIME is translated at all.

I reinstalled KNIME 4.4.1 and the error persists. I use MacOS 11.5, at least @bruno29a is on Windows. Maybe it is OS related.

Here is the example workflow that causes the error on my system:

XML XPath Error.knwf (7.6 KB)

Fix available with v4.2.2. See here for more info: XPath Error