Benoit Maisonny wrote:
> 
> What you find reasonable is to process whitespace differently depending
> on whether that space is in the beginning of a text node or in the
> middle, or if there is an opening tag following the text node.
> 
> I would have seen more logical to treat the same way all whitespace in a
> given text node.
> 
> I found another special handling:
> <body>
>    <div><p>test: </p><p>test</p></div>
>  </body>
> In this case, XXE keeps the space in the first p.
> But not in the following:
> <body>
>    <p>test: </p>
> 
>    <p>test</p>
>  </body>
> 
> What is the difference? Do you look at the text node's grand-parent's
> content model (mixed not not) to decide whether to trim or not?

Something like that. (Note that body has mixed content in XHTML
transitional and has element-only content in XHTML strict.)



> I would need to know:
> 1. What is the decision process leading to trim or not
> 2. If your method is a widely accepted way of processing whitespace in
> "default" mode.
> 3. How did you decide on this method rather than not trimming as I
> expected?
> 

I'm sorry but answering all these questions in detail would take me too
much time. All the answers are contained in the source code of XXE. See
src/com/xmlmind/xmledit/edit/Trimmer.java (You are a customer of
Professional Edition: you have access to the source code.)

http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/edit/Trimmer.html


Reply via email to