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
{
StreamFop *buf = new StreamFop(); /* Ram QIODevice QDomDocument creator */
buf->device()->write( xmlt );
if (buf->isValid()) {
QDomDocument bbdoc
= buf
->Dom
();
/* new doc from external chunk */ QDomElement e
= bbroot.
firstChildElement("fo:bookmark-tree");
QDomElement Pbb
= dom.
createElement("fo:bookmark-tree");
for (int i=0; i<alist.count(); i++){
Pbb.setAttribute(nod.nodeName().toLower(),nod.nodeValue());
}
while ( !child.isNull() ) {
if ( child.isElement() ) {
Pbb.appendChild(dom.importNode(child,true).toElement());
}
child = child.nextSibling();
}
return Pbb;
} else {
return dom.createElement("dummy");
}
}
QDomElement FopDom::bookMarkTree( const QByteArray xmlt )
{
StreamFop *buf = new StreamFop(); /* Ram QIODevice QDomDocument creator */
buf->device()->write( xmlt );
if (buf->isValid()) {
QDomDocument bbdoc = buf->Dom(); /* new doc from external chunk */
QDomElement bbroot = bbdoc.documentElement();
QDomElement e = bbroot.firstChildElement("fo:bookmark-tree");
QDomElement Pbb = dom.createElement("fo:bookmark-tree");
QDomNamedNodeMap alist = e.attributes();
for (int i=0; i<alist.count(); i++){
QDomNode nod = alist.item(i);
Pbb.setAttribute(nod.nodeName().toLower(),nod.nodeValue());
}
QDomNode child = e.firstChild();
while ( !child.isNull() ) {
if ( child.isElement() ) {
Pbb.appendChild(dom.importNode(child,true).toElement());
}
child = child.nextSibling();
}
return Pbb;
} else {
return dom.createElement("dummy");
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks