On Monday 16 February 2004 12:33, David Faure wrote: > On Monday 16 February 2004 12:28, Nicolas Goutte wrote: > > On Monday 16 February 2004 11:39, David Faure wrote: > > > On Monday 16 February 2004 11:33, Nicolas Goutte wrote: > > > > On Monday 16 February 2004 11:17, David Faure wrote: > > > > > The OASIS format has a special tag for whitespace to ensure > > > > > whitespace is preserved. This is more reliable than using real > > > > > whitespace and depending on the XML parser to respect it. > > > > > > > > Something like: > > > > > > > > too? > > > > > > No, for 4 spaces. > > > > Yes, but you do not write: > > > > but > > > > Yes, because one space is always preserved, the problem is that 2 or more > spaces can be collapsed as a single one, no? No, the problem is the feature: http://trolltech.com/xml/features/report-whitespace-only-CharData of Qt's SAX parser. (See QXmlSimpleReader in Qt's doc.) With it on (which QDomDocument does by default), if white space is the only content of an element, it is not reported (i.e. ignored.) > > Or do you see problems with XML parsers (which ones?) not seeing the single > space in ? Try it with a normal QDomDocument::setContent QDomDocument doc; doc.setContent( QCString( " " ) ); qDebug("%s\n", doc.toCString().data() ); And you get: (I know very well the problem. I have it since the start of KWord's AbiWord import filter. Without making it on purpose, the test file, which I had made, had exactly such a construction and of course gave problems with QDomDocument::setContent. That is why the AbiWord import filter is made with SAX (i.e. the QXML classes.)) Have a nice day! _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel