Hi,
I believe I've found a bug in whitespace handling. I've read some posts
about whitespace handling on the archives but I don't think this was
addressed already.
In short, if an element such as XHTML's p contains a text node with
leading/trailing whitespace, that text node is trimmed when opening the
document.
Steps to reproduce:
1. File, New, XHTML Strict/Page.
2. In the p element, type "test: " (note the ending space).
3. Save and close the document. The file is saved with <p>test: </p>
4. Open the document in XXE: notice that the ending space has
disappeared from the view. The file on disk hasn't been modified yet.
5. Type something in the title element (i.e. the <p> is not affected)
6. Save the document.The file is saved with <p>test:</p>, so the
ending space has been removed.
From my understanding of XML whitespace handling, I think XXE can
format that whitespace however it wants (add a new line, put several
spaces...), but it may not remove it. Or, so to speak, xml:space=default
does not mean "trim text nodes".
Note, this issue does not arise if there is an element following that
space, inside the <p>. As in <p>test: <b>bold</b></p>. Likewise, it does
not happen for <div>test: <p>paragraph</p></div>.
Regards,
Benoit
--
Benoit Maisonny benoit at synclude.com
Director & Consultant http://synclude.com
Synclude