Ralf and Alan-

While digging through the UnmarshalHandler for something completely unrelated, I think I came across your solution. Castor looks for the attribute space in the namespace http://www.w3.org/XML/1998/namespace, which if set to "preserve" (it is case sensitive), Castor will not strip trailing whitespace.

So my sample output looked like this:

<?xml version="1.0" encoding="UTF-8"?>
<string-holder xmlns:xml="http://www.w3.org/XML/1998/namespace";>
   <str xml:space="preserve">This is a test     .   </str>
</string-holder>

And in Java all the spaces were preserved.

HTH,
Stephen


Ralf Joachim wrote:
Hi Alan,

what version of castor are you using?

I think I can remember having seen some mails or an issue in jira where
someone provided a solution for a situation where he also lost some
whitespaces. Therefore I suggest you to search jira or mailing lists. Or
could anyone else have a solution or can remember better then I do.

Regards
Ralf
Castor JDO, committer


Alan Andrade schrieb:

Hi

Need help is switching off whitespace trimming ..

Eg

<class>Alan' Class</class>



Is printed as Alan'Class



Is there a way to make castor ignore whitespaces rather than trim them?



Thanks

Alan






-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to