octave-maintainers
[Top][All Lists]
Advanced

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

Re: XML tools for Octave


From: Alois Schloegl
Subject: Re: XML tools for Octave
Date: Tue, 13 Jun 2006 17:33:18 +0200
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

Andy Adler wrote:

On Mon, 12 Jun 2006, Alois Schloegl wrote:

3. Doesn't manage xml comments (<!-- -->)


Comments are loaded and appear in the substructure  data  as strings.


Yes, but the parser doesn't specially identify them, so you need
to search for comments.

Comments are not really an issue for me; but someone else might care about it.

4. Confused by processing instructions
     <?xml version="1.0" encoding="UTF-8"?>

What do you mean by "confused"? So far I've not observed a problem with this.


The parser gives an error for this file.
     <?xml version="1.0" ?><a></a>

Not for me, I get:

t=xmlstruct('<?xml version="1.0" ?><a></a>')
warning: resizing object with index = 502 out of bounds
warning: resizing object with index = 1 out of bounds
warning: resizing object with index = 1 out of bounds
t =
{
 data =

 (,
   [1] =
   {
     version = 1.0
     x_ = 1.0
   }

   [2] =
   {
     1x1 struct array containing the fields:

   }

   [3] =
 ,)

 name =

 (,
   [1] = x_xml
   [2] = a
   [3] = a
 ,)

 type =

 (,
   [1] = 1
   [2] = 1
   [3] = 3
 ,)

}



Currently, the biggest issue for me is that the outcome needs some postprocessing.
Instead of
     X.data.='aECG'
     X.sub = {anystruct}

I'd like to see
     X.aECG = {anystruct}


Yes. This would be much better.

Instead of just complaining, I've decided to make a positive proposal.

Good..

Attached is a concept parser (it just parses files to stdout), based
on the libexpat library.

The advantage is that libexpat is available on all linux platforms and
is distributed with Matlab on windows, so it would be fairly easy to
port to Matlab as well.

Could you take a look to give some feedback on this parser?


Ok. I compiled it with

mkoctfile xmlparse.cc

octave2.9:3> xmlparse('Exa01.xml')
octave2.9: symbol lookup error: /home/schloegl/matlab/octave/xmlparse.oct: undefined symbol: XML_ParserCreate
address@hidden:~/matlab/octave$

and Octave quit.

I guess, some library is missing or need to be included at compile time. I checked and the debian packages expat, libexpat1, and libexpat1-dev are install on my system.

Did I miss something ?


Basically, I want to load large XML data sets, e.g. like this one
http://hci.tugraz.at/schloegl/biosig/xml/Exa01.xml
and extract the information which is needed for the common interface on biomedical data formats in the "BioSig for Octave and Matlab" toolbox.

Moreover, reading OpenOffice Spreadsheet files (which are just zipped XML) would be a nice and useful feature.


OpenOffice files have many components, including images and several
xml files. It would be necessary to specify which file to parse, but this
shouln't be difficult if we can assume that libz is available (which I
don't think is the case for Matlab).

The easiest would be to decompress to a temprorary file.


Yes, that's what I do. See lines 7598-7678 at
http://biosig.cvs.sourceforge.net/biosig/biosig/t200/sopen.m?annotate=1.139


Cheers,
   Alois


P.S.: I'm travelling.for one week, do not expect a response.



reply via email to

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