[Qt-interest] Problem with URI in QXmlQuery

Thiago Macieira thiago.macieira at trolltech.com
Mon Apr 6 18:01:28 CEST 2009


Em Segunda-feira 06 Abril 2009, às 17:32:44, Jan Zegan escreveu:
> I posted this on two boards before, but got no responses and still
> haven't figured it out myself.
> I am executing an XQuery on data I get from Yahoo's financial site for
> a single value, a change in currency rate since last trade. This which
> works under Linux Qt 4.4.3 and doesn't under Qt 4.5.
>
> 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().toLower().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().toLower() +                                   //
> this stays plnjpy=x
> "\"]/strong')&format=xml";

Hello Jan

Your paste is unreadable. Please remove indentation and make sure your lines 
wrap at 72 characters before pasting code in email.

In any case, why are you building your URL by hand? Use QUrl and it will be 
sure to encode properly any reserved characters.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
     Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090406/12044ee2/attachment.bin 


More information about the Qt-interest-old mailing list