How do I find out what the current practices are on XML and how to work with
it in Java? I don't want to waste a lot of time trying to figure out how to
use tools and techniques that have long since been replaced by far better
techniques. For example, having to use DOM to read an entire XML document in
order to insert a single element seems like a pretty dubious way of doing
something. It reminds me of storing data on magnetic tape and having to read
through most of the tape to add information to it. This seems more like the
1960s than the first decade of the 21st century. I have to assume that
someone has come up with better approaches by now.
I was also intrigued by Xindice but I'm not clear if this is a popular
approach or just an idea that never really amounted to anything.
Does anyone have any insights for me? Or suggestions on where to get good
information on this subject?
--
Rhino
> For example, having to use DOM to read an entire XML document in
> order to insert a single element seems like a pretty dubious way of doing
> something. It reminds me of storing data on magnetic tape and having to read
> through most of the tape to add information to it. This seems more like the
> 1960s than the first decade of the 21st century. I have to assume that
> someone has come up with better approaches by now.
This is a nice comparison. I'm looking forward to
answers from the Java/XML experts in this newsgroup.
I'm not a Java expert, but my first guess would be
that in many cases there is no way for you to avoid
using a DOM.
The basic APIs haven't changed very much since then.
> For example, having to use DOM to read an entire XML document in
> order to insert a single element seems like a pretty dubious way of doing
> something.
That's a classic example of a task which may be better handled by using
SAX-based processing rather than a DOM... which is, in fact, similar to
your tape analogy. See discussion of SAX vs. DOM at
http://www.w3.org/DOM/faq.html#SAXandDOM
On the other hand, if you're going to do a lot of this, XML may be the
wrong data representation. It's perfectly reasonable, and often
desirable, to use XML as your format for communicating data between
applications but to use something more specialized within the
application... a custom data structure, or a database. (Plug: IBM's DB2
now has native support for both relational AND XML-structural data.
Claimer: I'm with IBM, and contributed some of the ideas to that effort.)
> I was also intrigued by Xindice but I'm not clear if this is a popular
> approach or just an idea that never really amounted to anything.
I don't know the status of that particular project. It's an Apache
effort, so it probably has a mailing list for its users/contributors;
that'd be the best place to ask to find out current status. The website
says the most recent official version was released December of last year.
"rhino" <No.offline.c...@anonymous.com> wrote in message
news:g5atsq$j02$1...@news.datemas.de...
*plonk*
///Peter