[prev in list] [next in list] [prev in thread] [next in thread]
List: jibx-users
Subject: Re: [jibx-users] stax unmarshaling problem
From: Dennis Sosnoski <dms () sosnoski ! com>
Date: 2006-03-18 23:52:10
Message-ID: 441C9D2A.1090502 () sosnoski ! com
[Download RAW message or body]
Hi Pedros,
The /docs/runtime.html#stax document in the 1.1 distribution gives
information about using StAX rather than XMLPull. This doesn't cover how
to work with an existing XMLStreamReader, though.
I just realized in looking through the JavaDocs that a key class for
this was unintentionally made package access only. This is the
org.jibx.runtime.impl.StAXReaderWrapper class (doesn't show in the
JavaDocs since these are only the public classes). You can easily change
the source code for this class (under /build/src) to make it public
access, then recompile with "ant current" in the /build directory. To
use this class, you currently need to work with the implementation
classes rather than the runtime interfaces - so once you've created an
IUnmarshallingContext cast it to
org.jibx.runtime.impl.UnmarshallingContext, then create a
StAXReaderWrapper class wrapping your existing XMLStreamReader and set
it on the UnmarshallingContext with the setDocument() call. You can then
use the UnmarshallingContext unmarshalElement() call to unmarshal the
bound element from the XMLStreamReader.
I'll try to get out a beta 2 release of the 1.1 code soon which will
have the corrected StAXReaderWrapper class, along with other fixes.
- Dennis
Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117
Pedros wrote:
>Hi,
>Can somebody give me a hint how can i unmarshal object from XMLStreamReader ?
>I can't find any direct way to do this ( unmarshalDocument method of
>IUnmarshallingContext
>have only InputStream or Reader arguments which i can't use ).
>Thx
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>that extends applications into web and mobile media. Attend the live webcast
>and join the prime developer group breaking into this new coding territory!
>http://sel.as-us.falkag.net/sel?cmd_______________________________________________
>jibx-users mailing list
>jibx-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic