[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 04:54:20 -0800 (PST) |
----- Original Message -----
> From: "address@hidden" <address@hidden>
> To: address@hidden
> Cc:
> Sent: Wednesday, November 28, 2012 2:21 PM
> Subject: any suggestions for reading in a XML file?
>
> Dear all,
>
> From the io-1.0.20 I understand that reading an xml file is not yet
> implemented.
> I started writing a script to read in an xml file like
>
> <tag1 spec1=x spec2=y>
> <tag2>
> <tag3>blah</tag3>
> <tag3>blahblah</tag3>
> </tag2>
> </tag1>
>
> For ease of use and generality I would like to read in all values as strings.
> As
> an example I'd like to end up with a
>
> structure.tag1.tag2.tag3="blah"
>
> But since there can be several <tag3>s, I think I need to put them
> together into
> structure.tag1.tag2.tag3{1,1:2} (or any other size).
>
> This however prohibits me of creating further sub groups like .tag3.tag4,
> since
> tag3 is now an 'end station', being a cell.
>
> Is there a way to make tag3 contain subgroups and ALSO give assign a value or
> matrix to tag3?
>
> My choice for a struct is based on my preference for 'easy scrolling'
> through the structure. Once the XML file is read in, I call the
> structure.<TAB> on the command line to see what its subgroups are.
>
> Any suggestions are welcome on the approach or philosophy (or anything).
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
Rather take a scripting language (Perl or Python) and use coming with it XML
parser, e.g. http://search.cpan.org/search?query=XML+parser&mode=all ->
http://search.cpan.org/~toddr/XML-Parser-2.41/Parser.pm .
It should be trivial to convert data from Perl/Python data structure in Octave
one.
Regards,
Sergei.