XPath Error

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

Hi @ipazin
no I am on windows 10 (latest KNIME version)
br

1 Like

@bjoern.lohrmann

Hey I am allowed to share my BMECat and Workflow. But I am not allowed to post them in the forum. Can i send it to you directly?

@CyberCrimeFlo (and everyone else running into this issue)

We believe we have found the root cause of the error. The internal ticket number is AP-17454 and we are aiming to release a fix with KNIME AP 4.4.2 (coming soon).

We could reproduce this issue in the XPath node using XML documents with more than 2000 lines, when the operating system is using a non-English locale (e.g. German localization). The XML parser of Java 11 (which we adopted with AP 4.4) seems to behave differently for non-English locales.

  • Björn
7 Likes

A temporary fix could be to run your local KNIME instance with an additional parameter to change the locale. This can be done by navigating to your KNIME folder where the knime.exe lives and exectue it via console with “knime.exe -nl en_US”. This allows you to get rid of this error for the time being until 4.4.2 is released. :slight_smile:

5 Likes

Hello @CyberCrimeFlo, @e2dboden and @mpreusse,

in case you haven’t seen version 4.2.2. is out. Would be good if you can verify that included fix is working for you.

Br,
Ivan

3 Likes

Thanks @ipazin, it works now!

And big thanks to the KNIME team for fixing this bug.

2 Likes

Glad to hear that @mpreusse :slight_smile:
Ivan

Hey @ipazin,

it works!

Thank you very much

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.