qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] How to get xml file providing an URL and to parse that

Subject: Re: [Qt-interest] How to get xml file providing an URL and to parse that xml file
From: Frans Englich
Date: Wed, 10 Dec 2008 08:46:20 +0100
On Wednesday 10 December 2008 05:46:37 Bijay Panda wrote:
> Hi All,
> I have a requirement like this.
> I have to provide an URL which will return  a XML file.
> then I've to parse that XML file and display data.
> Can i  make it  with Qt . getting xml file from a URL ( web call) can be
> done
> with cURL i know . but how can be  in Qt.
> My xml file will be of RSS 2.0 format.

On way is to use the QtXmlPatterns module, and write a small XQuery script. 
The XQuery script would maybe look like this:

declare namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";;
<html>
        <body>
                {
                        (: For each RDF description element, create a HTML 
paragraph and copy in
                           the description element's text. :)
                        for $desc in 
doc("http://site.com/path/to/feed.rss";)//rdf:description
                        return <p>{string()}</p>
                }
        </body>
</html>

And then you would run the query and insert the result into a 
QWebView(Webkit). See examples/xmlpatterns/recipes/, and in assistant view 
the page named A Short Path to XQuery.



Cheers,

                Frans
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>