xml in octave

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

xml in octave

Alexander Barth-3
Hi all,

In the past there have been some mails about how reading xml in octave. Actually one can do so easily by using the java library Xerces (from apache). Attached is the file test_xml which works in octave with java support and actually matlab too.

It seems that the matlab's xmlread is just a thin wrapper around the Xerces library which is also included in matlab. One odd thing however, is that java functions have the working directory set to the working directory when octave starts and the working directory is not modified by a cd in octave. Matlab has the same behavior. To avoid any issues it is thus better to use the absolute path to the xml file.

Cheers,
Alex

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave

sample.xml (56 bytes) Download Attachment
test_xml.m (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xml in octave

Nir Krakauer-2
Thanks, Alexander. Would you mind also adding this information to the Wiki?

Nir

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xml in octave

Alexander Barth-3
OK, I added the information here:
Alex


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xml in octave

Nir Krakauer-2
very nice, thanks.

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: xml in octave

Philip Nienhuis
This post has NOT been accepted by the mailing list yet.
In reply to this post by Alexander Barth-3
Alexander Barth-3 wrote
Hi all,

In the past there have been some mails about how reading xml in octave.
Actually one can do so easily by using the java library Xerces (from
apache). Attached is the file test_xml which works in octave with java
support and actually matlab too.

It seems that the matlab's xmlread is just a thin wrapper around the Xerces
library which is also included in matlab. One odd thing however, is that
java functions have the working directory set to the working directory when
octave starts and the working directory is not modified by a cd in octave.
Matlab has the same behavior. To avoid any issues it is thus better to use
the absolute path to the xml file.
Thanks for this.

Just as a remark, Xerces is also used in the I/O package for reading/writing OpenOffice/LibreOffice Calc spreadsheets using the OTK (ODF Toolkit) interface.
A potential problem is that ODF Toolkit, while not bad at all, is barely maintained these days and still relies exclusively on xercesImpl.jar v. 2.9.1 from 14 Sep 2007.

So users should be wary that Calc spreadsheet I/O using functions from the io package and reading XML using Xerces can interfere with each other.

Should this remark be added to the XML reading stanza on the wiki?

On a related note, the io package contains some xml I/O stuff too.
The binary xmlread/write are unmaintained and worse yet, lack any internal documentation, and one of these days I'll throw them out.
But there are also two .m file functions there that still can useful. I needed them for I/O of XML-based spreadsheet formats (OOXML, ODF and gnumeric).

Philip