A single file would have many <tempdatapoint>
elements. You might want to use attributes for this
data, but you would still have a bunch of extra tags. If there was a structure in XML that allowed this
information to be more compact it could solve the
problem. Something like:


<flatelementset rowname="tempdatapoint" delimeter=","
linedelimeter="\n">
<element number="1" name="time">
<element number="2" name="temperature">
10,45
11,46
12,52
...
</flatelementset>

The XML parsers like SAX and DOM would then have to be
smart enough to expand the second compact notation
into the first notation when it is read by a program. If anyone know whether this exists, please respond. BTW, I mean in general not as a proprietary extension.
But it would be nice to know even if it was just a
proprietary extension. Much more thought would have
to be given to this kind of an extension.



SAX can do this by default. You'll get several calls to "ignorable white space" and "characters". Whether by spec or by chance, Xerces's SAX parser will give you one call to "characters" for each line there.


I do not think that this will result in a substantial benefit given the extra work it takes. XML is not the silver bullet. Use it where appropriate. It isn't always appropriate. For instance, it might be entirely appropriate to use XML to present data in 3 different formats or aggregate a number of data sources together, cache them and present them differently based on circumstance. It would be totally silly to use XML from your graphics card (for instance). It would be totally silly to send XML from your EJBs, parse it, and then present it in a JSP (what advatage are you serving over a strict value object?).

XML isn't bad, its just one format. There are many. Consider what your performance and memory requirements are, against the facts that XML has the most widely available and free parsers, is readible, debuggable, open, non-proprietary. Sometimes you'll say "hey, this suites my needs exactly", othertimes you'll say "that would be totally dog slow".

Of course the vendors are going to push "XML everywhere" and try and sell you modeling tools which make every class in your system a web service. Certainly such a system will sell a lot of hardware and software and put you out on your ear. Be pragmatic. Its useless to argue that XML is bad. Its appropriate to judge whether its appropriate for your circumstance.

-Andy



_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to