You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2010/02/03 13:23:46 UTC

JAXB databinding converting from/to xml and trailing spaces

Are there any configuration options on the JAXB databinding to control
what happens with leading and trailing spaces? There seems to be some
intermittent issue where these sometimes get stripped off which is
causing problems with the JMS callbacks itest which happened to have
leading and trailing spaces in the strings it used. I've changed the
itest to remove all the leading and trailing spaces for now in r906026
but it would be good to find the underlying issue - any one have any
ideas?

   ...ant

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
The element text spaces get trimmed. Which sounds like what the
default transformer does though from googling a bit about it I've not
yet found anything simple that fixes it.

   ...ant

On Wed, Feb 3, 2010 at 6:11 PM, Raymond Feng <en...@gmail.com> wrote:
> What spaces are lossing? The element text or the attribute value? The
> DOMHelper uses the default XML transformer to convert a node into a string.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "ant elder" <an...@apache.org>
> Sent: Wednesday, February 03, 2010 5:35 AM
> To: <de...@tuscany.apache.org>
> Subject: Re: JAXB databinding converting from/to xml and trailing spaces
>
>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com>
>> wrote:
>>>
>>> Is this peculiar to a particular type of field and/or a particular
>>> wire format? I've been looking at an issue recently to do with how XML
>>> elements with a whiteSpace facet of "collapse" should have
>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>
>>> Simon
>>>
>>
>> Actually after debugging through I think its not the databinding but
>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>> there are some Transformer properties that could be set to control it.
>>
>>  ...ant
>
>

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by Raymond Feng <en...@gmail.com>.
What spaces are lossing? The element text or the attribute value? The 
DOMHelper uses the default XML transformer to convert a node into a string.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <an...@apache.org>
Sent: Wednesday, February 03, 2010 5:35 AM
To: <de...@tuscany.apache.org>
Subject: Re: JAXB databinding converting from/to xml and trailing spaces

> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com> 
> wrote:
>> Is this peculiar to a particular type of field and/or a particular
>> wire format? I've been looking at an issue recently to do with how XML
>> elements with a whiteSpace facet of "collapse" should have
>> trailing(leading) whitespace removed but it's not happening with wstx.
>>
>> Simon
>>
>
> Actually after debugging through I think its not the databinding but
> the DOMHelper saveAsString method where it losing the spaces. Perhaps
> there are some Transformer properties that could be set to control it.
>
>   ...ant 


Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
The same error happens don Hudson once yesterday but its been fine
since, and i#'m not seeing it, but it looks likely the same issue as
the callbacks case where intermittently the wrong transformer is
getting used.

   ...ant

On Thu, Feb 4, 2010 at 4:00 PM, Simon Laws <si...@googlemail.com> wrote:
> I'm not seeing a failure in FormatJMSBytesXMLTestCase. I haven't
> completely ruled out that it's something I've broken but I'm seeing
> the following stack.
>
> java.lang.NumberFormatException: For input string: "RnJlZCBCbG9nZ3M="
>        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>        at java.lang.Integer.parseInt(Integer.java:447)
>        at java.lang.Byte.parseByte(Byte.java:151)
>        at java.lang.Byte.parseByte(Byte.java:108)
>        at org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.parseByte(XSDDataTypeConverter.java:707)
>        at org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl.toJavaObject(SimpleTypeMapperImpl.java:301)
>        at org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer.transform(SimpleType2JavaTransformer.java:55)
>        at org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer.transform(DefaultTransformerExtensionPoint.java:209)
>        at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:114)
>        at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:232)
>        at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:1)
>        at org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer.transform(DefaultTransformerExtensionPoint.java:209)
>        at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:114)
>        at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediateInput(MediatorImpl.java:432)
>        at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:65)
>        at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
>        at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
>        at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:57)
>        at org.apache.tuscany.sca.binding.jms.wireformat.jmsbytesxml.runtime.WireFormatJMSBytesXMLServiceInterceptor.invoke(WireFormatJMSBytesXMLServiceInterceptor.java:58)
>        at org.apache.tuscany.sca.binding.jms.wire.CallbackDestinationInterceptor.invoke(CallbackDestinationInterceptor.java:53)
>        at org.apache.tuscany.sca.binding.jms.wire.OperationPropertiesInterceptor.invoke(OperationPropertiesInterceptor.java:53)
>        at org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.runtime.OperationSelectorJMSDefaultServiceInterceptor.invoke(OperationSelectorJMSDefaultServiceInterceptor.java:80)
>        at org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor.invoke(TransportServiceInterceptor.java:82)
>        at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invokeBinding(RuntimeInvoker.java:50)
>        at org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:221)
>        at org.apache.tuscany.sca.binding.jms.host.DefaultServiceInvoker.invokeService(DefaultServiceInvoker.java:93)
>        at org.apache.tuscany.sca.binding.jms.host.DefaultServiceInvoker.onMessage(DefaultServiceInvoker.java:69)
>        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1021)
>        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122)
>        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192)
>        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
>        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
>
> Simon
>

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by Simon Laws <si...@googlemail.com>.
I'm not seeing a failure in FormatJMSBytesXMLTestCase. I haven't
completely ruled out that it's something I've broken but I'm seeing
the following stack.

java.lang.NumberFormatException: For input string: "RnJlZCBCbG9nZ3M="
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Integer.parseInt(Integer.java:447)
	at java.lang.Byte.parseByte(Byte.java:151)
	at java.lang.Byte.parseByte(Byte.java:108)
	at org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.parseByte(XSDDataTypeConverter.java:707)
	at org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl.toJavaObject(SimpleTypeMapperImpl.java:301)
	at org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer.transform(SimpleType2JavaTransformer.java:55)
	at org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer.transform(DefaultTransformerExtensionPoint.java:209)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:114)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:232)
	at org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:1)
	at org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer.transform(DefaultTransformerExtensionPoint.java:209)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:114)
	at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediateInput(MediatorImpl.java:432)
	at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:65)
	at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:91)
	at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:74)
	at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invoke(RuntimeInvoker.java:57)
	at org.apache.tuscany.sca.binding.jms.wireformat.jmsbytesxml.runtime.WireFormatJMSBytesXMLServiceInterceptor.invoke(WireFormatJMSBytesXMLServiceInterceptor.java:58)
	at org.apache.tuscany.sca.binding.jms.wire.CallbackDestinationInterceptor.invoke(CallbackDestinationInterceptor.java:53)
	at org.apache.tuscany.sca.binding.jms.wire.OperationPropertiesInterceptor.invoke(OperationPropertiesInterceptor.java:53)
	at org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.runtime.OperationSelectorJMSDefaultServiceInterceptor.invoke(OperationSelectorJMSDefaultServiceInterceptor.java:80)
	at org.apache.tuscany.sca.binding.jms.transport.TransportServiceInterceptor.invoke(TransportServiceInterceptor.java:82)
	at org.apache.tuscany.sca.core.invocation.RuntimeInvoker.invokeBinding(RuntimeInvoker.java:50)
	at org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointImpl.invoke(RuntimeEndpointImpl.java:221)
	at org.apache.tuscany.sca.binding.jms.host.DefaultServiceInvoker.invokeService(DefaultServiceInvoker.java:93)
	at org.apache.tuscany.sca.binding.jms.host.DefaultServiceInvoker.onMessage(DefaultServiceInvoker.java:69)
	at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1021)
	at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122)
	at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192)
	at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
	at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

Simon

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
On Thu, Feb 4, 2010 at 10:17 AM, ant elder <an...@apache.org> wrote:
> On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com> wrote:
>>> Is this peculiar to a particular type of field and/or a particular
>>> wire format? I've been looking at an issue recently to do with how XML
>>> elements with a whiteSpace facet of "collapse" should have
>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>
>>> Simon
>>>
>>
>> Actually after debugging through I think its not the databinding but
>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>> there are some Transformer properties that could be set to control it.
>>
>>   ...ant
>>
>
> It turns out that wasn't true, where its actually going wrong is in
> the databinding in the SimpleType2JavaTransformer mediator and what
> makes it intermittent is that it seems to randomly choose either the
> SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
> handles the spaces ok, SimpleType2JavaTransformer normalizes
> whitespace. Not sure yet why it chooses different ones and its
> difficult to debug as it can pick the same one lots of times in a row
> so it can be hard to trap the different cases in the debugger.
>
>   ...ant
>

I've raised TUSCANY-3456 to track this.

   ...ant

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
Wonderful, the fix in r906613 has fixed this for me. Thanks Raymond, I
was starting to think i'd have to put back the jms binding to the old
away.

   ...ant

On Thu, Feb 4, 2010 at 5:08 PM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> This is an interesting case where we have two DIRECT transformers between
> the source and target types. We only find the 1st one without considering
> the weight. Let me see if I can check the weight too.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "ant elder" <an...@apache.org>
> Sent: Thursday, February 04, 2010 8:45 AM
> To: <de...@tuscany.apache.org>
> Subject: Re: JAXB databinding converting from/to xml and trailing spaces
>
>> Thanks. I did try messing about with some of the rankings but not
>> really knowing what i was doing it just seemed to make things worse.
>>
>>  ...ant
>>
>> On Thu, Feb 4, 2010 at 4:37 PM, Raymond Feng <en...@gmail.com> wrote:
>>>
>>> I'll take a look at the databinding registrations to make sure JAXB2Node
>>> has
>>> a priority.
>>>
>>> Thanks,
>>> Raymond
>>> --------------------------------------------------
>>> From: "ant elder" <an...@apache.org>
>>> Sent: Thursday, February 04, 2010 2:17 AM
>>> To: <de...@tuscany.apache.org>
>>> Subject: Re: JAXB databinding converting from/to xml and trailing spaces
>>>
>>>> On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
>>>>>
>>>>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com>
>>>>> wrote:
>>>>>>
>>>>>> Is this peculiar to a particular type of field and/or a particular
>>>>>> wire format? I've been looking at an issue recently to do with how XML
>>>>>> elements with a whiteSpace facet of "collapse" should have
>>>>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>>>>
>>>>>> Simon
>>>>>>
>>>>>
>>>>> Actually after debugging through I think its not the databinding but
>>>>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>>>>> there are some Transformer properties that could be set to control it.
>>>>>
>>>>>  ...ant
>>>>>
>>>>
>>>> It turns out that wasn't true, where its actually going wrong is in
>>>> the databinding in the SimpleType2JavaTransformer mediator and what
>>>> makes it intermittent is that it seems to randomly choose either the
>>>> SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
>>>> handles the spaces ok, SimpleType2JavaTransformer normalizes
>>>> whitespace. Not sure yet why it chooses different ones and its
>>>> difficult to debug as it can pick the same one lots of times in a row
>>>> so it can be hard to trap the different cases in the debugger.
>>>>
>>>>  ...ant
>>>
>>>
>

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by Raymond Feng <en...@gmail.com>.
Hi,

This is an interesting case where we have two DIRECT transformers between 
the source and target types. We only find the 1st one without considering 
the weight. Let me see if I can check the weight too.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <an...@apache.org>
Sent: Thursday, February 04, 2010 8:45 AM
To: <de...@tuscany.apache.org>
Subject: Re: JAXB databinding converting from/to xml and trailing spaces

> Thanks. I did try messing about with some of the rankings but not
> really knowing what i was doing it just seemed to make things worse.
>
>   ...ant
>
> On Thu, Feb 4, 2010 at 4:37 PM, Raymond Feng <en...@gmail.com> wrote:
>> I'll take a look at the databinding registrations to make sure JAXB2Node 
>> has
>> a priority.
>>
>> Thanks,
>> Raymond
>> --------------------------------------------------
>> From: "ant elder" <an...@apache.org>
>> Sent: Thursday, February 04, 2010 2:17 AM
>> To: <de...@tuscany.apache.org>
>> Subject: Re: JAXB databinding converting from/to xml and trailing spaces
>>
>>> On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
>>>>
>>>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com>
>>>> wrote:
>>>>>
>>>>> Is this peculiar to a particular type of field and/or a particular
>>>>> wire format? I've been looking at an issue recently to do with how XML
>>>>> elements with a whiteSpace facet of "collapse" should have
>>>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>>>
>>>>> Simon
>>>>>
>>>>
>>>> Actually after debugging through I think its not the databinding but
>>>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>>>> there are some Transformer properties that could be set to control it.
>>>>
>>>>  ...ant
>>>>
>>>
>>> It turns out that wasn't true, where its actually going wrong is in
>>> the databinding in the SimpleType2JavaTransformer mediator and what
>>> makes it intermittent is that it seems to randomly choose either the
>>> SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
>>> handles the spaces ok, SimpleType2JavaTransformer normalizes
>>> whitespace. Not sure yet why it chooses different ones and its
>>> difficult to debug as it can pick the same one lots of times in a row
>>> so it can be hard to trap the different cases in the debugger.
>>>
>>>  ...ant
>>
>> 

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
Thanks. I did try messing about with some of the rankings but not
really knowing what i was doing it just seemed to make things worse.

   ...ant

On Thu, Feb 4, 2010 at 4:37 PM, Raymond Feng <en...@gmail.com> wrote:
> I'll take a look at the databinding registrations to make sure JAXB2Node has
> a priority.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "ant elder" <an...@apache.org>
> Sent: Thursday, February 04, 2010 2:17 AM
> To: <de...@tuscany.apache.org>
> Subject: Re: JAXB databinding converting from/to xml and trailing spaces
>
>> On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
>>>
>>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com>
>>> wrote:
>>>>
>>>> Is this peculiar to a particular type of field and/or a particular
>>>> wire format? I've been looking at an issue recently to do with how XML
>>>> elements with a whiteSpace facet of "collapse" should have
>>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>>
>>>> Simon
>>>>
>>>
>>> Actually after debugging through I think its not the databinding but
>>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>>> there are some Transformer properties that could be set to control it.
>>>
>>>  ...ant
>>>
>>
>> It turns out that wasn't true, where its actually going wrong is in
>> the databinding in the SimpleType2JavaTransformer mediator and what
>> makes it intermittent is that it seems to randomly choose either the
>> SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
>> handles the spaces ok, SimpleType2JavaTransformer normalizes
>> whitespace. Not sure yet why it chooses different ones and its
>> difficult to debug as it can pick the same one lots of times in a row
>> so it can be hard to trap the different cases in the debugger.
>>
>>  ...ant
>
>

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by Raymond Feng <en...@gmail.com>.
I'll take a look at the databinding registrations to make sure JAXB2Node has 
a priority.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <an...@apache.org>
Sent: Thursday, February 04, 2010 2:17 AM
To: <de...@tuscany.apache.org>
Subject: Re: JAXB databinding converting from/to xml and trailing spaces

> On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
>> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com> 
>> wrote:
>>> Is this peculiar to a particular type of field and/or a particular
>>> wire format? I've been looking at an issue recently to do with how XML
>>> elements with a whiteSpace facet of "collapse" should have
>>> trailing(leading) whitespace removed but it's not happening with wstx.
>>>
>>> Simon
>>>
>>
>> Actually after debugging through I think its not the databinding but
>> the DOMHelper saveAsString method where it losing the spaces. Perhaps
>> there are some Transformer properties that could be set to control it.
>>
>>   ...ant
>>
>
> It turns out that wasn't true, where its actually going wrong is in
> the databinding in the SimpleType2JavaTransformer mediator and what
> makes it intermittent is that it seems to randomly choose either the
> SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
> handles the spaces ok, SimpleType2JavaTransformer normalizes
> whitespace. Not sure yet why it chooses different ones and its
> difficult to debug as it can pick the same one lots of times in a row
> so it can be hard to trap the different cases in the debugger.
>
>   ...ant 


Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
On Wed, Feb 3, 2010 at 1:35 PM, ant elder <an...@apache.org> wrote:
> On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com> wrote:
>> Is this peculiar to a particular type of field and/or a particular
>> wire format? I've been looking at an issue recently to do with how XML
>> elements with a whiteSpace facet of "collapse" should have
>> trailing(leading) whitespace removed but it's not happening with wstx.
>>
>> Simon
>>
>
> Actually after debugging through I think its not the databinding but
> the DOMHelper saveAsString method where it losing the spaces. Perhaps
> there are some Transformer properties that could be set to control it.
>
>   ...ant
>

It turns out that wasn't true, where its actually going wrong is in
the databinding in the SimpleType2JavaTransformer mediator and what
makes it intermittent is that it seems to randomly choose either the
SimpleType2JavaTransformer or the Node2JAXB mediator.  Node2JAXB
handles the spaces ok, SimpleType2JavaTransformer normalizes
whitespace. Not sure yet why it chooses different ones and its
difficult to debug as it can pick the same one lots of times in a row
so it can be hard to trap the different cases in the debugger.

   ...ant

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by ant elder <an...@apache.org>.
On Wed, Feb 3, 2010 at 1:01 PM, Simon Laws <si...@googlemail.com> wrote:
> Is this peculiar to a particular type of field and/or a particular
> wire format? I've been looking at an issue recently to do with how XML
> elements with a whiteSpace facet of "collapse" should have
> trailing(leading) whitespace removed but it's not happening with wstx.
>
> Simon
>

Actually after debugging through I think its not the databinding but
the DOMHelper saveAsString method where it losing the spaces. Perhaps
there are some Transformer properties that could be set to control it.

   ...ant

Re: JAXB databinding converting from/to xml and trailing spaces

Posted by Simon Laws <si...@googlemail.com>.
Is this peculiar to a particular type of field and/or a particular
wire format? I've been looking at an issue recently to do with how XML
elements with a whiteSpace facet of "collapse" should have
trailing(leading) whitespace removed but it's not happening with wstx.

Simon