[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: any suggestions for reading in a XML file?
From: |
Sergei Steshenko |
Subject: |
Re: any suggestions for reading in a XML file? |
Date: |
Wed, 28 Nov 2012 16:45:47 -0800 (PST) |
----- Original Message -----
> From: "address@hidden" <address@hidden>
> To: Philip Nienhuis <address@hidden>
> Cc: address@hidden
> Sent: Wednesday, November 28, 2012 7:31 PM
> Subject: Re: any suggestions for reading in a XML file?
>
> On Wed, Nov 28, 2012 at 09:13:37AM -0800, Philip Nienhuis wrote:
>> indium wrote
>> > Dear all,
>> >
>> > From the io-1.0.20 I understand that reading an xml file is not yet
>> > implemented.
>> > <snip>
>>
>> In the io package (Octave-Forge) there's an xmlread and an xmlwrite
>> function.
>> A bit of a problem is that they are too sparsely documented and -as the
>> creator disappeared from sight-hitherto unmaintained.
>>
>> If you feel sufficiently proficient in C++ you could have a look; and maybe
>> maintain those functions?
>>
>> Philip
>>
>
> Dear Philip, dear others,
>
> I have very little C and no C++ experience. That's why I hoped to do it in
> octave itself.
>
> The suggestion of going via python/perl/java seems to me not the way to go,
> since it implies a cross-dependence of any changes on the interpreter side
> combined with any future Octave changes.
>
> My pragmatic approach at the moment is to grep/awk out the pieces that I want
> and write out temporary files that are easily readable inside octave. Those
> tools are less prone to fail due to version changes than interpreters like
> perl/python/java.
>
> If I manage to solve my problem on the structure (as in my original post),
> then
> I'll post it here.
>
> I'm sorry not to be able to contribute on the C++ level.
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
"My pragmatic approach at the moment is to grep/awk out the pieces that I want
and write out temporary files that are easily readable inside octave. Those
tools are less prone to fail due to version changes than interpreters like
perl/python/java."
- up to you, but your approach is much more error-prone because XML is not a
line-oriented format.
OTOH, in, say, Perl XML parser exists for years, comes with a test suite, etc.
It is also very widely used, e.g. to build other libraries (I know this because
I'm routinely building from source a lot of stuff), so it's unlikely it has
major bugs.
By the way, there is an 'expat'-based XML parser for Perl too.
Perl XML parsers are maintained, look at release dates.
Regards,
Sergei.