cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Funk <a24...@ducksburg.com>
Subject Re: CXF loses whitespace text nodes on the client side?
Date Wed, 03 Feb 2010 14:16:34 GMT
On 2010-01-25, Daniel Kulp wrote:

>
> Well, if anything, it's an issue either with the StAX parser or with JAXB, not 
> really CXF.   Would you be in a position to create a small test case using 
> just JAXB?
>
> Basically, do something like:  (pseudo code, probably not correct)
>
> JAXBContext ctx = JAXBContext.newInstance(TextWithNodes.class);
>
> XMLStreamReader reader = ... create a reader for you message
>
> Object o = ctx.createUnmarshaller().unmarshal(reader);
>
> And check out that object to see if that has the problem.   In theory, it 
> should as that's pretty much all we do.    The issue is whether the reader is 
> reporting the whitespace or not.     You could also try debugging that  a bit:
>
>
> while (int event = reader.next() != XMLStreamReader.END_DOCUMENT) {
>     System.out.println(event);
>     if (event ==  XMLStreamReader.TEXT) {
>       System.out.println("text: " + reader.getCharacters();
>    }
> }
>
> or similar just to see if the reader is reporting the whitespace texts.

Thanks.  We did something like that.  We know the XMLStreamReader is
reporting the whitespace (since it's the same implementation that we
use elsewhere, without losing it), so we think the DOMHandler is
dropping the whitespace-only text nodes.

Is there any way to configure it not to do this?  Or can anyone
recommend a more suitable DOMHandler?


Mime
View raw message