octave-maintainers
[Top][All Lists]
Advanced

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

Re: XML tools for Octave


From: Andy Adler
Subject: Re: XML tools for Octave
Date: Tue, 13 Jun 2006 13:08:21 -0400 (EDT)

On Tue, 13 Jun 2006, Alois Schloegl wrote:
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
,)

}

But that means that the processing instructions are represented
as element data. Is that what you want??


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$


Did I miss something ?


yes, you need to compile with
    mkoctfile xmlparse.cc -lexpat


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



reply via email to

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