[Qt-interest] Remove line breaks in QDomDocument

Ben Swerts benswerts at telenet.be
Fri Dec 17 13:02:24 CET 2010


Hi Marcelo,
 
You could use QDomDocument::toString( 0 ), remove any linebreaks and save
this string.
 
Hope it helps,
 
 
    Ben


Hi,

I am creating an xml and I need this QDomDocument xml does not contain line
breaks and indentation. There's how to do this without reading the xml file,
remove the line breaks and save it? How can I do?
To save a file in the xml I'm using the following function, since it allows
you to remove the indentation:

bool class :: saveFile(QIODevice *device, QDomDocument &d) {
   QTextStream out(device) ;
   d.save(out, 0) ;
   return true ;
}

Thanks,

Marcelo E. Geyer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101217/808117b8/attachment.html 


More information about the Qt-interest-old mailing list