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