Hi

On 2010-01-26, Sergey Beryozkin wrote:

As Dan said, it could be that an Element representing TextWithNodes
can have the whitespaces significant for your specific case lost
(not reported) by the reader. Perhaps the reader has to be
instructed to report these whitespace nodes, which are
non-significant by default ?  Please check if whitespace nodes are
reported and if not then may be CXF can introduce a contextual
property which would ensure a message-specific reader is instrcuted
accordingly

We know the XMLStreamReader is reporting the whitespace (because we
use it elsewhere, without this problem).

Any idea where the "contextual property" might be documented, so I can
get some configuration tips?

according to

http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#setIgnoringElementContentWhitespace(boolean)

it is set to false by default. But see : "Due to reliance on the content model this setting requires the parser to be in validating mode", so may be if it is not validating it just ignores the whitespaces ? Can you try to enable the validation at the CXF level and see if it solves the issue... I'm actually not sure if DocumentBuilderFactory is even involved, Dan knows...

I was thinking that we could introduce a property like "org.apache.cxf.xml.drop.ignorablewhitespaces", which if set as a jaxws:property (or jaxrs:) would help the code creating the parsers to set the corresponding property as needed...


cheers, Sergey


Thanks,
Adam


Reply via email to