Why this crash ...?
is an other method to debug?
{
qDebug() << "### open file " << inputfile;
if (file.exists()) {
qDebug() << "### file found ok " << inputfile;
inside =file.readAll();
file.close();
}
}
doc.createElementNS("http://www.pulitzer.ch/2005/shop/shema/1.0/","s");
doc.createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0","cms");
doc.appendChild(root);
QDomElement page
= doc.
createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0",
"page");
root.appendChild(page);
QDomAttr language
= e.
attributeNode("la");
language.setValue(set_lang);
page.setAttributeNodeNS(language);
QDomText t
= doc.
createTextNode(inside
);
/* filter self text? */ page.appendChild(t);
qDebug() << "### xml result " << xml;
return xml;
}
QString Gui_Tidy::Createtag(QString inputfile,QString set_lang)
{
QString inside="File not found!";
qDebug() << "### open file " << inputfile;
QFile file(inputfile);
if (file.exists()) {
qDebug() << "### file found ok " << inputfile;
if (file.open(QFile::ReadOnly | QFile::Text)) {
inside =file.readAll();
file.close();
}
}
QDomDocument doc("shghshsh");
QDomElement root = doc.createElement("root");
doc.createElementNS("http://www.pulitzer.ch/2005/shop/shema/1.0/","s");
doc.createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0","cms");
doc.appendChild(root);
QDomElement page = doc.createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0","page");
root.appendChild(page);
QDomElement e;
QDomAttr language = e.attributeNode("la");
language.setValue(set_lang);
page.setAttributeNodeNS(language);
QDomText t = doc.createTextNode(inside); /* filter self text? */
page.appendChild(t);
QString xml = doc.toString();
qDebug() << "### xml result " << xml;
return xml;
}
To copy to clipboard, switch view to plain text mode
Bookmarks