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$