Problem with using of xlmread command in Octave

Viewed 77

I am trying to use a command xmlread in Octave, but unfortunately, I get an error:

error: xmlread: no xercesImpl.jar and/or xml-apis.jar > v2.11.0 in javaclasspath

error is called from:

xmlread at line 71 column 7

XML_LOAD at line 6 column 6

IO package was used before executing the command.

1 Answers

if you look at the documentation for xmlread, you'll find:

Function File: node = xmlread (fname)

    Parse an xml file fname using Xerces Java library and return a Java object representing an XML DOM document.

    Octave does not ship with a Xerces library so you should take care of adding the required .jar files to your java_path, e.g:

    javaaddpath ("/path/to/xerces-2_11_0/xercesImpl.jar");
    javaaddpath ("/path/to/xerces-2_11_0/xml-apis.jar");

    xmlread will check for Java support and proper xerces Java libraries in the javaclasspath until the check passes, or if it is called without arguments...

The current version this Java library can be obtained from:

http://xerces.apache.org/

Specifically, selecting the Downloads, scrolling down to Binary Distributions, and selecting the "Xerces2 Java 2.XX.YY - zip" for download (XX and YY being the latest versions). File can be unzipped to a folder, and the two .jar files mentioned above will be in the base of that folder tree.

The javaaddpath commands above edited to point to those files can then be added to the script you're building, or your .octaverc (startup commands) file in your user or home folder so they run every time you use Octave. (I've also seen cases where they just keep those two .jar files in the working folder, and the javaaddpath points to local files)

Related