[
Lists Home |
Date Index |
Thread Index
]
> >Obviously I can't test every possible internal form that might be
> >used by an application. However, the vast majority of XML document
> >processing in Java is currently built on the event streams produced
> >by SAX parsers. Any general XML format should be convertible to and
> >from an event stream of this type, and in practice that's the way
> >any alternative general formats are likely to be used (at least in
> >the near term).
>
>
> That doesn't sound at all plausible to me. If I have a specific
> internal data structure that I wish to convert to XML, I would never
> go through SAX. If I really didn't care about performance I might go
> through XOM or JDOM, but if I cared about performance I'd just dump
> out the strings or bytes as seemed appropriate. While certainly a few
> people are using the SAX API to drive output, it's hardly a common
> thing to do, nor is it at all necessary. I just can't see how the
> task you want to benchmark corresponds to how XML is used.
I often go from xml to java data structure and vice vera. The xml is
parsed using SAX into a set of data objects. The data is then modified
by the user through an interface, and then written back out as xml. In
order to write back out well formed xml, I generate SAX events from the
data structure, passing them to an emtpy TransformHandler() which has a
specified Result.
Mike Kay has just stated that (with Saxon) there is no tree building
cost so surely this the fastest way from data held in java objects to
well-formed xml text?
cheers
andrew
|