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: Fri, 30 Jun 2006 07:34:13 -0400 (EDT)

On Thu, 29 Jun 2006, Andy Adler wrote:

But the issue here is the extensibility at the heart of XML. The point is that you should be able to add extra information (the <metadata/>) and a parser for the old format should still work

That sounds good, and I like what you have below with a small change to how ORDER is used.

Here is my latest idea for the format:
<a b="c" d="e"> text <f g="h"/> more <é->text</é-> <f>data</f></a>

v.a.UTFNAME         : "a"
v.a.NAMESPACE       : ""
v.a.ORDER           : 1
v.a.ATTS.b          : "c"
v.a.ATTS.d          : "e"
v.a.TEXT{1}         : " text "
v.a.TEXT{2}         : " more "
v.a.TEXT{3}         : " "

v.a.f{1}.UTFNAME    : "f"
v.a.f{1}.NAMESPACE  : ""
v.a.f{1}.ORDER      : 2
v.a.f{1}.ATTS.g     : "h"

v.a.f{2}.UTFNAME    : "f"
v.a.f{2}.NAMESPACE  : ""
v.a.f{2}.ORDER      : 6
v.a.f{2}.TEXT{1}    : "data"

v.a.e_{1}.UTFNAME    : "é-"
v.a.e_{1}.NAMESPACE  : ""
v.a.e_{1}.ORDER      : 4
v.a.e_{1}.TEXT{1}    : "text"

Here I keep the order of the tags in each tag. The text elements are
then interspersed between them. Names (like é- are modified, but
the original is kept, as required).

Comments?

If you could count the text elements when keeping track of the order variable, then I think that everything would work the way I want because then you would have reversibility. The way that ORDER could give reversibility is if they were specified with counting the text but not specifically numbering it i.e.

v.a.ORDER           : 1
v.a.f{1}.ORDER      : 3
v.a.f{2}.ORDER      : 8
v.a.e_{1}.ORDER     : 5

with the rest of the data the same. That way, someone who cares about reversing it can put in a text element when order is missing an element. I would like that parser. It is fully defined because you must fully handle the e_ element before you can leave so you can know that its TEXT element must be 6 and that the third text must be 7. If you wanted to make reversing parsing simpler, you could add a TEXTORDER field (a vector with each element corresponding to one element of the cell array TEXT) so that the book keeping would all be done during the original parse.

Bill

--
"The chaos escalated when a group of armed revolutionaries from the
Honduran countryside raided JCPenney."
  -- Mall Of Central America Looted On Opening Day, The Onion

reply via email to

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