Hussein Shafie wrote: > Eric van der Vlist wrote: > >> Currently, XEE relies on the xml:space attribute (usually defaulted in a >> DTD or schema) to detect when spaces need to be preserved. This info is >> also available in the CSS stylesheet (white-space attribute) and I think >> that in most cases, that's easier for a "power user" to fiddle the CSS >> than the DTD. >> >> Why not use the information of the CSS stylesheet (when available) and >> not normalize spaces when white-space is set to "pre"? > > > Your suggestion cannot be easily implemented given the architecture of XXE.
Probably because CSSs are used at browse/edit time, and not at load/save time. Editing formatted text requires no only 'whitespace: pre' in CSS, but also to preserve newlines at load/save. Otherwise the formatting will be lost between editing sessions. On other hand, the 'whitespace: pre' option could (should?) be used to handle the 'return' key. In this case it could behave like inside XML comments: it simply inserts a newline. Otherwise it could maintain its actual behaviour: split the element at the caret position. > > However you are right in saying that XXE could have a method other than > xml:space="preserve" to specify that spaces need to be preserved for > some elements. I had some troubles with the lack of this feature when editing invalid documents to make them valid. Sometime ago I asked for a 'repair mode' which shouldn't enforce valid ordering/nesting of elements (and attributes) to easy the editing task. A suggested workaround was to disable the DOCTYPE declaration. In doing so, all text data formatting is lost. So it isn't applicable if there are 'white-space: preserve' data. Perhaps an easy improvement would be to make 'white-space: preserve' the default behaviour in absence of an explicit DTD or schema. > > XSLT style sheets have such mechanism. For XXE, it seems natural to > specify this in configuration files. > > For example, this would allow to use unmodified DocBook DTDs from OASIS > and to specify in docbook.xxe that spaces need to be preserved inside > programlisting, screen, literallayout, etc. > > -- > XMLmind XML Editor Support List > xmleditor-support at xmlmind.com > http://www.xmlmind.com/mailman/listinfo/xmleditor-support > -- ------------------------------------------------------------------------ Manuel Collado Machuca | Facultad de Informatica UPM Universidad Politecnica de Madrid | Campus de Montegancedo Dep. LSIIS | Boadilla del Monte Tel.+34-91-336.74.57 Fax.+34-91-336.74.12 | 28660 MADRID - SPAIN ------------------------------------------------------------------------

