[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 10:47:39 +0900 (JST) |
----- Original Message -----
> From: ngdias
> To: help-octave
> Cc:
> Date: 2017/3/22, Wed 09:42
> Subject: Re: Rad XML in octave
>
>T hanks so much for all the replies. You have been very helpful, the post by
> tmacchant was particularly detailed.
>
> I use Windows and Linux, but I'm running Octave in Windows at the moment.
> The system doesn't allow for the creation of a .octaverc using Explorer (a
> file needs a filename :P), but I found a workaround by going into the comand
> line and typing
>
> ren octaverc .octaverc
>
> I think this info about the pkg load io; command is super important and
> should be mentioned in
> https://octave.sourceforge.io/io/function/xmlread.html
> and
> http://wiki.octave.org/Cookbook#Load_XML_files
>
> I don't understand how the javaaddpath commands are indicated, but not the
> need to load this package.
>
> Also, could I load Xerces-J-bin.2.11.0.zip as a package instead of
> javaaddpath ("/path/to/xerces-2_11_0/xercesImpl.jar");
> javaaddpath ("/path/to/xerces-2_11_0/xml-apis.jar");
>
> ie pkg install -forge Xerces-J-bin.2.11.0 ?
> ie pkg install -forge Xerces-J-bin.2.11.0 ?
It is not.
According to https://octave.sourceforge.io/io/function/xmlread.htm,
Octave does not ship with a Xerces library.
You seems to have to set by yourself.
Extract
Xerces-J-bin.2.11.0.zip
to the path appropriate for you.
If you extracted to C:\octave, javaaddpath is to be
javaaddpath ("C:/octave/xerces-2_11_0/xercesImpl.jar");
javaaddpath ("C:/octave/xerces-2_11_0/xml-apis.jar");
I execute
javaaddpath ("C:/octave/xerces-2_11_0/xercesImpl.jar");
javaaddpath ("C:/octave/xerces-2_11_0/xml-apis.jar");
pkg load io
And execute Demonstration 1 in
https://octave.sourceforge.io/io/function/xmlread.htm,
But I change graphics_toolkit fltk to qt because fltk causes error.
## Create an svg file, which is nothing but an xml tree tk = graphics_toolkit
(); graphics_toolkit ("qt"); % change from fltk to qt hf = figure (); sombrero
(); fname = [tempname(), ".svg"]; print (fname); close (hf) graphics_toolkit
(tk); ## Read the svg file and check the root node is named "svg" dom = xmlread
(fname); if (dom.hasChildNodes ()) root_node = dom.getChildNodes ().item (0);
printf ("The name of the root node is \"%s\"\n", ... char
(root_node.getNodeName ())) endif
I could see
The name of the root node is "svg"
as shown in Demonstration 1 on the we page.
Tatsuro