How i can port this recursive node on a QXmlStreamWriter?
Is this possibel?

I see QXmlStreamWriter direct on QIODevice is faster and i like to use ...

I need only to write svg xml vector image, and the QStandardItemModel pdf bookmark

Qt Code:
  1. QDomElement FopDom::bookMarkTree( const QByteArray xmlt )
  2. {
  3. StreamFop *buf = new StreamFop(); /* Ram QIODevice QDomDocument creator */
  4. buf->device()->write( xmlt );
  5. if (buf->isValid()) {
  6. QDomDocument bbdoc = buf->Dom(); /* new doc from external chunk */
  7. QDomElement bbroot = bbdoc.documentElement();
  8. QDomElement e = bbroot.firstChildElement("fo:bookmark-tree");
  9. QDomElement Pbb = dom.createElement("fo:bookmark-tree");
  10. QDomNamedNodeMap alist = e.attributes();
  11. for (int i=0; i<alist.count(); i++){
  12. QDomNode nod = alist.item(i);
  13. Pbb.setAttribute(nod.nodeName().toLower(),nod.nodeValue());
  14. }
  15. QDomNode child = e.firstChild();
  16. while ( !child.isNull() ) {
  17. if ( child.isElement() ) {
  18. Pbb.appendChild(dom.importNode(child,true).toElement());
  19. }
  20. child = child.nextSibling();
  21. }
  22. return Pbb;
  23. } else {
  24. return dom.createElement("dummy");
  25. }
  26. }
To copy to clipboard, switch view to plain text mode