XPath Error

Hi,

I have the problem that this error has appeared here in my workflow since the update to version 4.4. Unfortunately, I can not access the configuration. Is there a solution for this?

Hello @CyberCrimeFlo,

and welcome to KNIME Community!

This is a known issue in 4.4.0. See here. Upon fix someone will update this topic to notify you.

Br,
Ivan

3 Likes

Thank you very much @ipazin

1 Like

Hello @CyberCrimeFlo,

with KNIME version 4.4.1 invalid XML generation issue is addressed. In case you haven’t done update feel free to do so and give it a try.
Just as reference here is link to entire changelog: KNIME Analytics Platform 4.4 | KNIME

Br,
Ivan

Hey @ipazin ,

Thank you for your reply.

I updated Knime to v4.4.1 yesterday.
Unfortunately the problem still exists and nothing has changed.

Hi @CyberCrimeFlo and welcome to the Knime Community.

I can’t understand what the message is saying, but the “Could not create XML hierarchy tree” message generally means that the XML data might not be valid. Could you share the XML data or the results of the XML Reader?

Hey @bruno29a ,

The XML has to be correct because I use it a lot and it doesn’t cause any problems only with this Xpath. Sharing the XML becomes difficult because of sensitive data. The workflow runs through, only I can’t open the XPath.

Hi @CyberCrimeFlo , it’s going to be hard to investigate if we can’t see the data…

Can you validate the data via an XML validator just to be sure? Any “hidden” characters (hidden characters are basically special characters that are physically there, but the editor does not know how to display it, hence it’s “hidden”)?

Notepad++ has a plugin to validate XMLs, may be you could validate your data in Notepad++.

Also, if you could translate what the error message says to English, it could be helpful to see what it’s saying.

1 Like

@bruno29a is right
In general, this error indicates that something is wrong with the range of the start and end tags.
but without seeing it it is hard to tell more
br

2 Likes

Hello @CyberCrimeFlo,

the fix I mentioned seems to apply to JSON to XML node. In your case might be that invalid XML is read/created by XML Reader node. Is XML file you read created maybe with KNIME or what’s the origin of it?

Br,
Ivan

2 Likes

Hey @ipazin ,

I am not allowed to share the file because of sensitive data. It is catalog data as BMECat. The workflow used to work with exactly the same file.

Hello @CyberCrimeFlo,

tnx for additional info. Let me see if someone more familiar with XML can help.

Edit: New ticket created to address it. (AP-17454)

Br,
Ivan

2 Likes

Hi @CyberCrimeFlo , have you run the xml via a validator as I suggested?

You should at least confirm that the xml is valid. I get it that “The workflow used to work with exactly the same file.”, that does not necessarily mean that the xml was valid. Maybe previous versions were more “lenient” and allowed certain things which are no longer allowed.

And if that were to be the case, what do you want to end up doing? Revert to previous versions and stay on old versions forever, or would you rather fix the XML if it’s invalid?

1 Like

@CyberCrimeFlo We are trying to investigate this issue but cannot reproduce it. In order to fix any of this, it would be very helpful to have:

  • The stack trace with the error from the KNIME log (click View > Open KNIME Log)
  • If possible, some sample data. We don’t need your confidental data, just something that is structurally similar enough (tag names, etc) to reproduce the issue.

Best,
Björn

2 Likes

@bjoern.lohrmann @bruno29a

Is there a possibility in Knime to replace the content in the XML file with “example”. Then I can share the file.

Visual Studio did not find an error in the XML file.

Hi there,

I´m also having problems when working with the BMECAT Format. Unfortunately, I also can´t share my data. But I found a couple BMECAT examples online. Maybe you can work with these to reproduce the error.

beispiel_mercateoBMEcat-1.2.xml (56.4 KB)
BMECAT_Example.xml (8.2 KB)

1 Like

Hi there again,

I was able to recreate the issue with one of my BMECAT Catalogues. Unfortunately this is not one of the example files.

Here´s the content of the knime.log:

2021-09-15 08:50:48,467 : WARN : main : : Node : XML Reader : 3:1 : Please specify a file
2021-09-15 08:52:49,620 : WARN : KNIME-Worker-5-XML Reader 3:1 : : Node : XML Reader : 3:1 : Node created an empty data table.
2021-09-15 08:53:10,726 : WARN : KNIME-Worker-6-XML Reader 3:1 : : Node : XML Reader : 3:1 : Node created an empty data table.
2021-09-15 08:53:23,100 : WARN : KNIME-Worker-7-XML Reader 3:1 : : Node : XML Reader : 3:1 : Node created an empty data table.
2021-09-15 09:20:40,576 : ERROR : KNIME-Worker-7-XML Reader 0:1 : : Node : XML Reader : 0:1 : Execute failed: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 37; Pseudoattributname wird erwartet.
java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 37; Pseudoattributname wird erwartet.
at org.knime.core.data.xml.io.XMLDOMCellReader.readXML(XMLDOMCellReader.java:170)
at org.knime.core.data.xml.XMLCellContent.parse(XMLCellContent.java:267)
at org.knime.core.data.xml.XMLCellContent.(XMLCellContent.java:137)
at org.knime.core.data.xml.XMLCellFactory.create(XMLCellFactory.java:192)
at org.knime.xml.node.filehandling.reader.XMLBlobRead.next(XMLBlobRead.java:97)
at org.knime.filehandling.core.node.table.reader.read.CheckSameSizeRead.next(CheckSameSizeRead.java:78)
at org.knime.filehandling.core.node.table.reader.DefaultIndividualTableReader.fillOutputWithProgress(DefaultIndividualTableReader.java:142)
at org.knime.filehandling.core.node.table.reader.DefaultIndividualTableReader.fillOutput(DefaultIndividualTableReader.java:121)
at org.knime.filehandling.core.node.table.reader.DefaultMultiTableRead.fillRowOutput(DefaultMultiTableRead.java:135)
at org.knime.xml.node.filehandling.reader.XMLMultiTableReadFactory$XMLMultiTableRead.fillRowOutput(XMLMultiTableReadFactory.java:183)
at org.knime.filehandling.core.node.table.reader.MultiTableReader.fillRowOutput(MultiTableReader.java:90)
at org.knime.filehandling.core.node.table.reader.MultiTableReader.readTable(MultiTableReader.java:173)
at org.knime.filehandling.core.node.table.reader.TableReaderNodeModel.execute(TableReaderNodeModel.java:160)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:556)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1259)
at org.knime.core.node.Node.execute(Node.java:1039)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 37; Pseudoattributname wird erwartet.
at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.knime.core.data.xml.io.XMLDOMCellReader.readXML(XMLDOMCellReader.java:168)
… 25 more

2 Likes

I have the same issue using KNIME 4.4.1, I posted an example workflow here: Error on XPath node - #3 by bruno29a

In that thread others were able to read the XML file and use XPath on Windows. I use MacOS, could that be related?

I could reproduce the error as well. I guess it’s better to stick to json

Hello @Daniel_Weikert,

are you also on MacOS?

Br,
Ivan