users@jaxb.java.net

Re: unmarshalling deep child elements to avoid traversal?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 29 Sep 2006 16:34:59 -0700

Andrew Hughes wrote:
> Hey All,
>
> I would like to know if there is a way of unmarshalling a child element
> directly? Seems like a very popular thing to do... (ie XPATH).
>
> My XSD is very complicated :( and traversal is a bit of a pain. I guess I am
> being lazy and just trying to reduce the amount of coding.
>
> Example, if "*IWantToUnmarshallThis*" :
>
> <Root>
> <Something>
> <SomethingElse>
> <ManyMoreParents>
> ...............
> * <IWantToUnmarshallThis>
> </IWantToUnmarshallThis>*
> ...............
> </ManyMoreParents>
> </SomethingElse>
> </Something>
> </Root>
>
>
> Any suggestions????

See pull-parser and partial-unmarshalling example.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com