1

I cannot get qtwebkit to display css/xsl. I have tried both and they work in web browsers, but not in the qtwebkit. Is there a setting I need to enable to apply a stylesheet, or is this a downfall of the qtwebkit?

EDIT: XSLT support is disabled in Qt 4.7 (http://gitorious.org/webkit/qtwebkit/commit/8961d12)

XML

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="status.xsl"?>
    <hk>
    <item><name>Some Parameter</name><value>value</value></item>
    <item><name>Test Count</name><value>38</value></item>
    </hk>

xsl (status.xsl)

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="*|/">
    <html><head>
    <meta http-equiv="refresh" content="1"></meta></head>
    <body> <h2>Status</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th>Parameter</th>
    <th>Value</th>
    </tr>
    <xsl:for-each select="hk/item"> <tr>
    <td><xsl:value-of select="name"/></td>
    <td><xsl:value-of select="value"/></td>
    </tr> </xsl:for-each> </table>

    </body> </html> </xsl:template> </xsl:stylesheet>

QtWebKit

     webView->settings()->setUserStyleSheetUrl(QUrl::fromLocalFile("file.css"));
     webView->load(QUrl("http://192.x.x.x:port/file.xml));

When viewing the URL in a browser the css looks fine... but not in webkit?

JonnyCplusplus
  • 881
  • 3
  • 12
  • 22
  • @JonnyCplusplus: What is the meaning of "I cannot get qtwebkit to display css/xsl"? Is it not honoring your `xml-stylesheet` PI? –  Apr 02 '11 at 17:17
  • @Alejandro: the text is being displayed in the webkit, but not the stylesheet. In a webrower, it is a table with colors and formatting in the webkit, straight text... just a line of all the data from the xml... – JonnyCplusplus Apr 02 '11 at 17:22
  • @JonnyCplusplus: You need to post reduce input sample, complete stylesheet and desired output in order to answer. –  Apr 02 '11 at 17:25
  • How do I mark this answered... I answered my own question! – JonnyCplusplus Apr 06 '11 at 01:12
  • @JonnyCplusplus: Just do not answer in question but in its own answer. –  Apr 06 '11 at 13:58

0 Answers0