Does this mean this is a bug in Castor ? Or can I get around this by
specifying in the schema to preserve whitespace ? If so how do I
specify ? Also Werner mentioned using a mapping file to preserve
whitespace. Could you please provide a sample of how to do it ? It
would help me a lot.

Thanks,
Sunil.

On 5/4/07, Godmar Back <[EMAIL PROTECTED]> wrote:
On 5/4/07, Werner Guttmann <[EMAIL PROTECTED]> wrote:
> Which I think is actually valid, as you don't specify (anywhere) that you 
want whitespaces to be preserved. I hope I am not wrong with this, but one option 
would be (by the means of a mapping file) to specify that you want whitespaces to 
be preserved.
>

I don't think you're correct here.
This whitespace is significant since it doesn't occur between
elements. It mus be preserved. See
http://www.oracle.com/technology/pub/articles/wang-whitespace.html
and
http://xml.silmaril.ie/authors/whitespace/

I would urge Castor to preserve all whitespace and to not introduce
any, not even any insignificant whitespace by default. For instance,
we're using Castor to produce text that we'd like to process using
line-based tools, such as "readLine()" functions or regular
expressions. We'd like to send it over a TCP socket which uses
line-based readers/writers at either end. It would be an extreme
hassle having to remove newlines castors introduces before we could do
that. (CodeSynthesis's XSD/C++ product, unfortunately, decided to
introduce insignificant whitespace by default, which required us to
change it before we could use it.)

If you want, you could - optionally - introduce a "format" or
"pretty-print" option, similar to xmllint -format or similar to say
SimpleXML's "format => 1" option - but please make this optional, and
not the default.

 - Godmar

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to