[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: best xml parser to use

  • From: Tatu Saloranta <cowtowncoder@y...>
  • To: xml dev <xml-dev@l...>
  • Date: Thu, 7 Sep 2006 14:20:42 -0700 (PDT)

stax xml parser
--- petera <peter.anderson@e...> wrote:

> 
> 
> Thanks to all who replied to my e-mail.
> 
> The approach I have decided upon is to try two
> implementations:
> 
> 1. XSLT
> 
> 2. StAX

I would agree with these main choices. While you could
use data binding (xmlbeans, jaxb2), that seems bit
heavy-weight route since you don't care about type
mappings etc, so most of the work would be overhead.
SAX could of course be used, but I don't know of many
benefits over Stax for this use case.

> 
> XSLT is really the simplest but my bosses might not
> like the memory
> requirements so StAX would a good alternative
> 
> The URL provided by Brennan is excellent on StAX:
>
http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP2.html

In addition, if you decide to go Stax route (which may
make sense if you will eventually get bigger files --
1 M is still with about any solution, unless there's
lots of concurrent processing), you may want to check
out stax-utils project

https://stax-utils.dev.java.net/

since 'raw' Stax API is bit of PITA to use for many
tasks. For copying xml, using Event API it is quite
straight-forward.

You could also try out StaxMate that I wrote
(http://woodstox.codehaus.org/StaxMate) which has
support for accessing xml content in streaming way,
but still allowing hierarchic traversal (in forward
direction).
Documentation is bit sparse, best way may be to read
entries at
(http://www.cowtowncoder.com/blog/blog.html). I should
write sample code for this particular use case though,
since it seems to be kind of recurring question
(usually on stax_builders list though), and it should
also be easy to add sub-tree pass-through copy
operation, so that this particular task would be just
couple of lines total.

-+ Tatu +-


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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.