PDA

View Full Version : QtWebkit and XSLT



yop
14th October 2008, 15:01
It seems that XSLT will not be supported in QtWebkit for Qt 4.5 (http://englich.wordpress.com/2008/09/10/xsl-t-and-qt/#comment-5476) but in the same comment it is mentioned that it should be possible with the public API.
The comment is too abstract to guide anyone. Does anyone have any ideas how we could glue the Qt 4.5 XSLT implementtion with QtWebkit?

patrik08
15th October 2008, 10:21
use another browser like firefox + selfmade plugin
or begin your adventure on..
http://doc.trolltech.com/main-snapshot/qwebpluginfactory.html

qt 4.5 XSLT2 is not same as gmone xslt1

example <xsl:param name=*** run on qt4.5 on other xslt you must write
<xsl:variable name=***

if you like to become compatibility on 70% from browser as java script + xslt this is a hard work.

xslt on browser is a bad place
the best way to transform xslt documnet or item , direct on server:
http://cocoon.apache.org/ java framework
http://wiki.flux-cms.org/display/FLX/Popoon and his friend php framework
all two can output xhtml page pdf transformation rtf and all other choise...

On qt as client xslt is enough to transform local / remote document or rss
like -> http://fop-miniscribus.googlecode.com/svn/trunk/doc/draw_paper/main.cpp





#if QT_VERSION >= 0x040500
QDateTime timer1( QDateTime::currentDateTime() );
StreamBuf *buf = new StreamBuf();
QXmlQuery xquery(QXmlQuery::XSLT20);
xquery.setFocus(QUrl("http://www.qtcentre.org/forum/external.php?type=RSS2"));
xquery.bindVariable("unixtime", QVariant(timer1.toTime_t()));
xquery.bindVariable("ddate", QVariant(timer1.toString()));
xquery.bindVariable("ddformat", QVariant(QDir::homePath () ));
xquery.setQuery(QUrl("http://fop-miniscribus.googlecode.com/svn/trunk/doc/draw_paper/browser_rss.xsl"));
xquery.evaluateTo(buf->device());
_doc->setHtml ( buf->data() );
////////////buf->PutOnFile( "ddebughtml.html" );
#endif