octave-maintainers
[Top][All Lists]
Advanced

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

Re: XML and Octave: review of tools


From: Alois Schloegl
Subject: Re: XML and Octave: review of tools
Date: Thu, 27 Apr 2006 09:23:19 +0200
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

Hi Andy,

Andy Adler wrote:

Alois,

A few comments about XML and Octave.

- Matlab does not have a proper / approved XML
 approach yet. They may very well invent one in the
 future, and we will be almost certainly incompatible.
I agree that Mathworks does not have a proper approach. However, XMLTREE is very useful, it is GPL and it will stay around. If we provide a solution that works on both platforms, who cares if Mathworks tries to do it differently.

- XML approaches based on the classic parsers (DOM, SAX)
 suck. They make the programmer write way too much
 code, and encourage broken micro-optimizations.

 For a detailed rant about problems with XML, see my
 talk: "10 Mistakes with XML and Perl"
  http://www.site.uottawa.ca/~adler/talks/2003/YAPC-CA-2003-XML-talk.pdf
I enjoyed reading these slides of yours. It shows many possible pitfalls in supporting XML. However, there is no way around XML - everyone is using. And now also the OpenDocumentFormat (ODF) is based on XML, we have to deal with it on one way or another.
- A good / easy to use approach needs to provide vectorized
 output. This means we cannot iterate to read the XML
 structure.

As you point out, none of the current offerings are
satisfactory for various reasons (reading all xml files,
code complexity).

Before we put effort into this, could we have a discussion
on this list of what we want to get out of XML tools
for Octave.
For most applications, a result similar to the output of XMLTREE would be sufficient. Using a modified version of XMLTREE, I'm already able to load ODF data into the workspace.

As a start, we can compare to what is offered by other
scripting languages. I propose something like XML::Simple
in perl.

Do you suggest to use XML::Simple for reading XML data into Octave? Or do you suggest to (re-)implement something similar within Octave?


Alois


--
Andy Adler <address@hidden> 1(613)562-5800x6218

On Wed, 26 Apr 2006, Alois Schloegl wrote:

XML support would important for a variaty of data formats. For example,
it would also enable a simple interface to the ODF-spreadsheet format.
In order to indentify the most useful approach, I was investigating the
various XML tools available. Here is the result:

(1) There are XMLREAD and XMLWRITE in Octave-forge. That these functions
support (only) XML data which follow octave.dtd; other .DTD's are not
supported.

(2) Then, there is XMLTREE from http://www.artefact.tk/software/matlab/xml/
It is GPL,  but  it uses object-oriented language elements which are not
(yet?) supported in Octave.
Although, XMLTREE extracts only parts of the information in XML files,
it seems to be the most powerful and flexible approach for reading XML
files.

(3) XML-toolbox from http://www.geodise.org/downloads/ :
BSD-like license, The software is distributed as p-code, the m-files
contain just the help documentation.
Therefore, it can not be used with Octave.

(4) And there is XML4MAT from http://xml4mat.sourceforge.net/
It is GPL and come as pure M-file, this would be suitable for Octave.
However, it requires REGEXPREP. Paul Kienzle did a M-file implemenation
- Thanks - its already in Octave-forge; an oct-implementation will
certainly improve speed.
Unfortunately, XML4MAT does not work with all XML-files. For example,
it does not work for  the XML files extracted from an ODF spreadsheet.

(5) Finally, there is the attempt to use LIBXML for reading XML files.
Muthu is familiar with libxml2 and will look into this.

Any thoughts on that ? Did I miss any other approach on XML support in
Octave?
Currently, no solution is fully satisfying. If anyone is interested
working on this, I can provide a suite of XML files for testing and/or
I'm willing to do the tests.


Alois



















reply via email to

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