octave-maintainers
[Top][All Lists]
Advanced

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

Re: XML tools for Octave


From: Bill Denney
Subject: Re: XML tools for Octave
Date: Thu, 29 Jun 2006 13:26:10 -0400 (EDT)

On Thu, 29 Jun 2006, Andy Adler wrote:

I honestly don't know how to address this. Your suggestion would basically mean that we expose the full DOM API. Matlab did this with a thin wrapper over Java's DOM.

However, this is a really bad idea. It means that all the effort of
XML parsing falls on the user - who will either make mistakes or
shortcuts, with the result of really fragile code.

For example a user will parse
    <data><item> 1 </item></data>

using
  v.data.CHILD{1}.item.TEXT{1}

But this will break when you have
    <data> <item> 1 </item></data>

or
    <data><metadata/><item> 1 </item></data>

That's true, but users will always write fragile code like that. One option around this would be to have options like "strip-space" (taking a cue from XSL: http://www.w3schools.com/xsl/el_preserve-space.asp) that would relatively intelligently help the user. Perhaps make stripping spaces the default would be most helpful to the users.

So I don't think that pushing all the complexity to the user is right.
Somehow it should be easy to do easy things, but possible to do correct things.

How about:
<a b="c" d="e"> text <f g="h"/> more text <f>data</f> </a>

v.a.ATTS.b      : "c"
v.a.ATTS.d      : "e"
v.a.TEXT{1}     : " text "
v.a.TEXT{2}     : " more text "
v.a.TEXT{3}     : " "
v.a.f{1}.g      : "h"
v.a.f{2}.TEXT{1}: "data"

and some extra information in:

v.a.NAMESPACE
v.a.ORDEREDELEMS
v.a.UTFNAMES

This is starting to look like a big project ;-<

How would you do ORDEREDELEMS? Would that be the entire file again or would it just be some sort of permutation vector?

Bill

--
"Which brings up another thing... limitless credit cards the way to a
woman's heart."
  -- Hilary Mills



reply via email to

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