Loading an XML document with QDomDocument and namespace processing enabled (*) works, but saving it back gives a bloated and redundant XML file with "xmlns:prefix=namespaceuri" added to each and every element. [...] Redefining xmlns:office in every element other than the toplevel office:document-content is unnecessary since the definition in an element is applicable to any child element. The initial XML document simply defined all the namespaces in the element. Even worse, the elements got xmlns:style defined twice. Checking the validity of this document with jing and a relaxng schema shows that as an error: content.xml:4:234: fatal: Attribute "xmlns:style" was already specified for element "style:font-face". The initial document was [...] QDomElementPrivate::save() has a TODO comment about this. To "only declare namespaces that are not yet declared" should indeed be implemented. (*) QXmlInputSource source( inputDevice ); QXmlSimpleReader reader; reader.setFeature( "http://xml.org/sax/features/namespaces", true ) reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", false ); QString errorMsg; int errorLine, errorColumn; bool ok = doc.setContent( &source, &reader, &errorMsg, &errorLine, &errorColumn ); Then using doc.toByteArray() when saving. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel