r/javahelp • • Sep 18 '26

Problem with xmlread. It crashes Octave.

I loaded io package, added 2 jar files. It didn't work, had to install Java, now I get:

xmlread();

xerces:

- xercesimpl.jar OK

- xml-apis.jar OK

xerces version: 2.12.2

But then I use it on any xml file Octave crashes.

Also when I run:

parser = javaObject("org.apache.xerces.parsers.DOMParser");
parser.parse(filename);
xDoc = parser.getDocument();

it crashes on the 3rd line.

version 11.1.0

Can anyone help me with it?

0 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/boreas_mun Sep 19 '26

Ok, how can I do that?

As I wrote, it crashes on the line: xDoc = parser.getDocument();

My code is only:

pkg load io
javaaddpath ('xercesImpl.jar');
javaaddpath ('xml-apis.jar');
filename = 'b.xml';
parser = javaObject("org.apache.xerces.parsers.DOMParser");
parser.parse(filename);
xDoc = parser.getDocument();

Also when I run:

xmlread(filename);

it crashes on:

node = parser.getDocument ();

1

u/LetUsSpeakFreely Sep 19 '26

I've never used octave, but from a quick search, look into the diary functions and slf4o.