[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: |
Thu, 29 Jun 2006 09:05:12 -0400 (EDT) |
On Thu, 29 Jun 2006, Bill Denney wrote:
Andy Adler wrote:
I'm trying to write this. My idea is that XML like this
<a b="c" d="e"> text <f g="h"/> more text <f>data</f> </a>
will load into octave as
v= xmlparse( filename)
with:
v.a.ATTS.b => "c"
v.a.ATTS.d => "e"
v.a.TEXT => " text more text "
v.a.f(1).ATTS.g => "h"
v.a.f(2).TEXT => "data"
Shouldn't it parse as something more like
v.a.ATTS.b = "c"
v.a.ATTS.d = "e"
v.a.CHILD{1} = " text "
v.a.CHILD{2}.f.ATTS.g => "h"
v.a.CHILD{3} = " more text "
v.a.CHILD{4}.f.CHILD{1} => "data"
because otherwise you lose the fact that <f g="h"/> is between " text " and "
more text ".
Bill
My concern is that this output makes writing software to parse the
xml output really frustrating - you need to loop through the CHILD
vectors to find what you're looking for. This would result in
people taking shortcuts that make the code fragile.
This is actually a big debate in the XML semantics community -
the fact that XML does not map easily to data structures.
The other issue is that XML allows tag names to be full unicode,
but octave will only allow [0-9A-Za-z_] characters for structs.
I'm not sure how to deal with this, but I want to keep a simple
output format.
--
Andy Adler <address@hidden> 1(613)562-5800x6218
- Re: XML tools for Octave, (continued)
- Re: XML tools for Octave, David Bateman, 2006/06/10
- Re: XML tools for Octave, Andy Adler, 2006/06/10
- Re: XML tools for Octave, Alois Schloegl, 2006/06/12
- Re: XML tools for Octave, Andy Adler, 2006/06/12
- Re: XML tools for Octave, Alois Schloegl, 2006/06/13
- Re: XML tools for Octave, Andy Adler, 2006/06/13
- Re: XML tools for Octave, Schloegl Alois, 2006/06/21
- Re: XML tools for Octave, Andy Adler, 2006/06/28
- Re: XML tools for Octave, John W. Eaton, 2006/06/28
- Re: XML tools for Octave, Bill Denney, 2006/06/29
- Re: XML tools for Octave,
Andy Adler <=
- Re: XML tools for Octave, Bill Denney, 2006/06/29
- Re: XML tools for Octave, Andy Adler, 2006/06/29
- Re: XML tools for Octave, Dmitri A. Sergatskov, 2006/06/29
- Re: XML tools for Octave, John W. Eaton, 2006/06/29
- Re: XML tools for Octave, Bill Denney, 2006/06/29
- Re: XML tools for Octave, Bill Denney, 2006/06/29
- Re: XML tools for Octave, Andy Adler, 2006/06/29
- Re: XML tools for Octave, John W. Eaton, 2006/06/30
- Re: XML tools for Octave, Dmitri A. Sergatskov, 2006/06/30
- Re: XML tools for Octave, John W. Eaton, 2006/06/30