[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal XML Toolbox for Octave
From: |
Andy Adler |
Subject: |
Re: Proposal XML Toolbox for Octave |
Date: |
Tue, 13 Feb 2007 14:14:02 -0500 (EST) |
On Fri, 9 Feb 2007, Thomas Geiger wrote:
2. I quite like the format of the XMLtoolbox output. I just have a few
issues:
- if each tag is converted into an identifier, how does
it handle XML like <é- ï$="1" />?
Honestly, I've never seen such element tag in an XML before, and as far as I
understand XML,
it should be a human readable format. Do you have an example for this?
I haven't seen stuff like that (but it exists, I'm sure). However, I have
seen
<123 456="789" />
This will cause problems because octave/matlab identifiers can't
start with numbers
xmlstr= xmlparseany(' <123 456="789" /> ');
would give:
xmlstr.ATTRIBUTE.123 = '789'
- the converted format is slightly non-unique. The following
XML files will parse identically:
1. <a> <b> <c> <b> </a>
2. <a> <b> <b> <c> </a>
Assuming the XML is well-formed (otherwise the parser will reject it),
My mistake, I mean that both
xmls1= xmlparseany('<a><b/><c/><b/></a>');
xmls2= xmlparseany('<a><b/><b/><c/></a>');
would give:
xmls1.b{1} ... =
xmls1.b{2} ... =
xmls1.c{1} ... =
This could be solved by adding an TAGORDER attribute, so we have
xmls2.b{1}.TAGORDER = 1;
xmls2.b{2}.TAGORDER = 3;
xmls2.c{1}.TAGORDER = 2;
3. I would very much like to see a parser that accepts an XPath
statement to only parse a part of a file. It may be possible
to add this later.
Xerces-C just implements parts of XPath which are necessary to handle
schemas.
For fully supprt Xalan-C (http://xml.apache.org/xalan-c/) might be an
option, there's
lots to think about regarding this and as you mention it could be added in a
later version.
An XPath expression would help coding speed (users are
normally are only interested in a small part of the XML file) and
memory user (only a small part need be loaded)
I would suggest that this is a good way to go (as long as the
code from geodise works well - I haven't tested it).
HOwever, I suggest we ask geodise to clarify their licence first.
It may be possible to reuse some of the code - saving you time.
--
Andy Adler