PDA

View Full Version : QXmlQuery URL normalization differences between Qt 4.4.3 and 4.5



joshz
30th March 2009, 22:02
Hi all,
I have an xquery, which works under Qt 4.4.3 and doesn't under Qt 4.5. It sends a query with Yahoo's YQL to to grab a single node which holds a change in currency quote.

here's the code:


QString query = "http://query.yahooapis.com/v1/public/yql?q=";
query += "select * from html where url=\"http://finance.yahoo.com/q?s=" +
tempQuote->getCode().replace(6, 1, "%3D") + // this is supposed to be something
// like plnjpy=x, which becomes plnjpy%3Dx
"\" and (xpath='//span[@id=\"yfs_c10_" +
tempQuote->getCode() + // this stays plnjpy=x
"\"]/strong')&format=xml";
query = query.toLower();

QString xq = "doc('%1')";

QXmlQuery queryxml;

queryxml.setQuery(xq.arg(query) + "/query/results/strong[1]");


and the error i'm getting under Qt 4.5:
Error FODC0005 in file:///usr/bin/plasmoidviewer, at line 1, column 1: http://query.yahooapis.com/v1/public/yql?q=select * from html where url="http://finance.yahoo.com/q?s=plnjpy%3dx" and (xpath='//span[@id="yfs_c10_plnjpy=x"]/strong')&format=xml is not a valid value of type xs:anyURI.

Any suggestions as to how to type this query so it works would be greatly appreciated.

Thanks!