Results 1 to 8 of 8

Thread: Pass xml file from javascript to qt using qwebkit bridge

  1. #1
    Join Date
    Feb 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Pass xml file from javascript to qt using qwebkit bridge

    Hi!

    Have some problem with trying to pass a xml file as a domdocument from javascript to my c++ code in qt. Is there any way doing this?

    The reason is that I need to parse a xml file using xslt using but I find it to time inefficient to first convert the xml document to a string and then send it to qt. Would be much bether if I can just send it directly. Or is there maybe any other approach doing this that would be bether? Also how good is the internal xslt transformation in qt compare to other libraries for example xalan? As I have understand it you have to use an external library to parse xml files with xslt to get a good result viewing webpages that is using this? Many questions I know but have been sitting with this for a while and would really appreciated any help I can get

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Quote Originally Posted by linus11 View Post
    Would be much bether if I can just send it directly.
    Using what API?

    Also how good is the internal xslt transformation in qt compare to other libraries for example xalan?
    Xalan is more complete. WebKit should have its own XSL transformer though that should be complete (feature-wise).

    As I have understand it you have to use an external library to parse xml files with xslt to get a good result viewing webpages that is using this?
    I don't understand what you mean.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Quote Originally Posted by wysota View Post
    Using what API?
    I am pretty new to these things but and have only been programming in c++ before but any API that make it possible to pass a xml domdocument in a similar way to the way qwebelement can pass html domdocument from javascript to c++ would be great.


    Xalan is more complete. WebKit should have its own XSL transformer though that should be complete (feature-wise).
    Ok, thanks!


    I don't understand what you mean.
    Similar to the first question so sorry for this, just ignore it!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Quote Originally Posted by linus11 View Post
    I am pretty new to these things but and have only been programming in c++ before but any API that make it possible to pass a xml domdocument in a similar way to the way qwebelement can pass html domdocument from javascript to c++ would be great.
    There is no common API between WebKit and QDomDocument. You can access the page DOM directly from C++ using QWebElement and family, if you want but you can't "convert" it to QDomDocument.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Quote Originally Posted by wysota View Post
    There is no common API between WebKit and QDomDocument. You can access the page DOM directly from C++ using QWebElement and family, if you want but you can't "convert" it to QDomDocument.
    Is there any simple way to implement for webkit to be able to send new user defined types then from javascript to c++? QWebelement doesn't work for xml files as i understand it...

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    You can expose your own C++ API to WebKit.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Quote Originally Posted by wysota View Post
    You can expose your own C++ API to WebKit.
    Can you explain or link any webpage that shows more exactly how to do that? Been looking for it myself but haven't been able to find anything...

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Pass xml file from javascript to qt using qwebkit bridge

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. adob flash and javascript plugin for QWebkit
    By Fafa in forum Installation and Deployment
    Replies: 0
    Last Post: 16th August 2011, 17:47
  2. Pass data from QT to javascript function
    By thanhluanbk88 in forum Qt Programming
    Replies: 3
    Last Post: 3rd March 2011, 10:40
  3. Webkit Bridge Tutorial Missing??
    By rick,reynolds in forum Newbie
    Replies: 1
    Last Post: 2nd November 2010, 23:41
  4. QWebKit JavaScript Console ?
    By kwisp in forum Qt Programming
    Replies: 0
    Last Post: 20th October 2009, 10:22
  5. QT 4.4 QGraphicsProxyWidget bridge Drag and Drop help
    By patrik08 in forum Qt Programming
    Replies: 9
    Last Post: 27th March 2008, 15:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.