help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rad XML in octave


From: Tatsuro MATSUOKA
Subject: Re: Rad XML in octave
Date: Wed, 22 Mar 2017 08:27:22 +0900 (JST)

----- Original Message -----

> From: ngdias 
> To: help-octave
> Cc: 
> Date: 2017/3/22, Wed 05:48
> Subject: Rad XML in octave
> 
> I'm new in Octave and I'm trying to read XML files.
> I read this post
> http://octave.1599824.n4.nabble.com/xml-in-octave-td4663034.html
> 
> and this section
> http://wiki.octave.org/Cookbook#Load_XML_files
> 
> I downloaded the .jars from apache and loaded them with javaaddpath.
> I can get a result '1' for the code in this last page. 
> 
> But this function xmlread()
> https://octave.sourceforge.io/io/function/xmlread.html
> is not working:
>>>  xmlread ();
> 
> warning: the 'xmlread' function is not yet implemented in Octave
> 
> And the instructions saying run javaaddpath for the 2 .jars doesn't do
> anything to make xmlread() work.
> I'd like to have the xml processing capability load everytime I load Octave
> and I couldn't find a way to do it. It seems I have to run the javaaddpath
> command for the 2 .jars everytime I start octave.
> 
> Is it supposed to be installed with pkg install -forge and point to the
> compressed file where I got the .jars from?
> 
> All of this is absent from guide pages...

*******************************

Hello ngdias

I'm not specialist for for xml nor java.
Therefore my suggestion may not be correct.

> http://wiki.octave.org/Cookbook#Load_XML_files


This page seems not to show the way to use xmlread but
load xmlfile without xmlread.

> https://octave.sourceforge.io/io/function/xmlread.html

From the page xmlread is a function of io package of octave-forge 
but is not octave core one.

To use io package, 

1. install io package
From octave prompt

pkg install -forge io

This is required once.
To confirm io package is installed, execute

pkg list io

2. load io package. 
From octave prompt

pkg load io

This is required for  every time before you want use the package.

If you want to load io package at octave startup,
you can use startup file.

https://www.gnu.org/software/octave/doc/interpreter/Startup-Files.html#Startup-Files


Usually I use 
~/.octaverc


If you are a unix like os user, you know what ~ means.
~ indicates home directory.
On windows, home directory is C:\Users\<user name>.

Use an editor and make  .octaverc file in home directory and describe


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

and save it.

Tatsuro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]