java - Unmarshall single non-root node of a long XML file -


i have xml looks this:

<root>   <header>     ...   </header>   <entries>     ...   </entries> </root> 

there single header node, lot of entries. there way extract node java bean, without reading whole xml file.

if possible, there support in springbatch or xstream?

i don't think using springbatch chunk-oriented tasklet staxeventitemreader appropriate since want read 1 item.

you can write own itemreader extending staxeventitemreader (or, better, delegating it), redefine method itemreader.read() , change condition indicate reader "exhausted" returning null after first valid node read: when spring-batch found itemreader.read() method returning null stop processing file.
can use chunk-oriented , avoid full file read.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -