users@fi.java.net

Re: VTD speed

From: Tatu Saloranta <cowtowncoder_at_yahoo.com>
Date: Tue, 24 Jan 2006 22:47:44 -0800 (PST)

--- Jimmy Zhang <crackeur_at_comcast.net> wrote:

> Thanks for the comment.
>
> VTD-XML outperform's SAX (ns or not) because it
> minimizes object allocation.
>
> XML data is often hierarchical, which means the
best
> way to process them is to allow random access.

Yes. Random access is definitely most convenient, and
for some use cases mandated (many XSL features and
some XPaths things require access to full document).
So streaming approaches can not solve all problems,
and having efficient random access implementation
would be a great thing to have.

> Other issue of SAX: if the doc is not wellformed,
> say,
> the last character is not '>', in this case the
> document is not
> wellformed, but the code making use of SAX only
> processes
> a part of XML,so the well-formedness error is not
> really
> detected and probably won't matter ...

Like Paul said, with SAX error would be flagged. But
with Stax, not necessarily (since calling application
may just stop reading before the error is
encountered).

> I guess VTD-XML and SAX each has its pros and cons,
> direct apple-to-apple comparison is hard ...

Yes, this is true. But I think it is possible to
compare different approaches for some real life tasks;
data binding, simple tag replacements or content
analysis (term frequency in contained text etc).

Anyway, even with comments I had, I definitely hope
vtd-xml can add a fresh new approach to xml
processing,

-+ Tatu +-


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com